Skip to content

Commit

Permalink
Merge pull request #21 from MesquiteProject/development
Browse files Browse the repository at this point in the history
Chromaseq 1.5
  • Loading branch information
DMaddison authored Dec 28, 2018
2 parents c3e0664 + 3ad0031 commit e982c05
Show file tree
Hide file tree
Showing 68 changed files with 2,601 additions and 500 deletions.

This file was deleted.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public boolean canExportData(Class dataClass){
}

protected int taxonNameLengthLimit() {
return 15;
return 50;
}

/* ============================ exporting ============================*/
Expand Down
2 changes: 1 addition & 1 deletion Source/mesquite/chromaseq/PhredPhrap/PhredPhrap.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
/* Mesquite source code. Copyright 1997-2009 W. Maddison and D. Maddison.Version 2.72, December 2009.Disclaimer: The Mesquite source code is lengthy and we are few. There are no doubt inefficiencies and goofs in this code. The commenting leaves much to be desired. Please approach this source code with the spirit of helping out.Perhaps with your help we can be more than a few, and make Mesquite better.Mesquite is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.Mesquite's web site is http://mesquiteproject.orgThis source code and its compiled class files are free and modifiable under the terms of GNU Lesser General Public License. (http://www.gnu.org/copyleft/lesser.html)*/package mesquite.chromaseq.PrefixTaxNameWCode;import java.util.*;import java.awt.*;import mesquite.chromaseq.lib.ChromaseqUtil;import mesquite.lib.*;import mesquite.lib.duties.*;import mesquite.lib.table.*;/* ======================================================================== */public class PrefixTaxNameWCode extends TaxonNameAlterer { /*.................................................................................................................*/ public boolean startJob(String arguments, Object condition, boolean hiredByName){ return true; } /*.................................................................................................................*/ /**Returns true if the module is to appear in menus and other places in which users can choose, and if can be selected in any way other than by direct request*/ public boolean getUserChooseable(){ return true; } /*.................................................................................................................*/ /** Called to alter the taxon name in a single cell. If you use the alterContentOfCells method of this class, then you must supply a real method for this, not just this stub. */ public boolean alterName(Taxa taxa, int it){ boolean nameChanged = false; String name = taxa.getTaxonName(it); if (name!=null){ String vc = getVoucherCode(taxa, it); if (vc != null){ if (!name.contains(vc)) taxa.setTaxonName(it, vc + "." + name, false); } nameChanged = true; } return nameChanged; } public String getVoucherCode(Taxa taxa, int ic){ if (taxa!=null) { Object n = ChromaseqUtil.getStringAssociated(taxa, VoucherInfoFromOTUIDDB.voucherCodeRef, ic); if (n !=null) return ((String)n); } return null; } /*.................................................................................................................*/ public Object doCommand(String commandName, String arguments, CommandChecker checker) { if (checker.compare(this.getClass(), "Appends numbers to taxon names", "[length]", commandName, "appendNumbers")) { if (taxa !=null){ alterTaxonNames(taxa,table); } } else return super.doCommand(commandName, arguments, checker); return null; } /*.................................................................................................................*/ public String getNameForMenuItem() { return "Prefix With OTU ID Code"; } /*.................................................................................................................*/ public String getName() { return "Prefix With OTU ID Code"; } /*.................................................................................................................*/ public String getExplanation() { return "Prefixes the taxon name with the OTU ID Code."; }}
/* Mesquite source code. Copyright 1997-2009 W. Maddison and D. Maddison.Version 2.72, December 2009.Disclaimer: The Mesquite source code is lengthy and we are few. There are no doubt inefficiencies and goofs in this code. The commenting leaves much to be desired. Please approach this source code with the spirit of helping out.Perhaps with your help we can be more than a few, and make Mesquite better.Mesquite is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.Mesquite's web site is http://mesquiteproject.orgThis source code and its compiled class files are free and modifiable under the terms of GNU Lesser General Public License. (http://www.gnu.org/copyleft/lesser.html)*/package mesquite.chromaseq.PrefixTaxNameWCode;import java.util.*;import java.awt.*;import mesquite.chromaseq.lib.ChromaseqUtil;import mesquite.lib.*;import mesquite.lib.duties.*;import mesquite.lib.table.*;/* ======================================================================== */public class PrefixTaxNameWCode extends TaxonNameAlterer { /*.................................................................................................................*/ public boolean startJob(String arguments, Object condition, boolean hiredByName){ return true; } /*.................................................................................................................*/ /**Returns true if the module is to appear in menus and other places in which users can choose, and if can be selected in any way other than by direct request*/ public boolean getUserChooseable(){ return true; } /*.................................................................................................................*/ /** Called to alter the taxon name in a single cell. If you use the alterContentOfCells method of this class, then you must supply a real method for this, not just this stub. */ public boolean alterName(Taxa taxa, int it){ boolean nameChanged = false; String name = taxa.getTaxonName(it); if (name!=null){ String vc = getVoucherCode(taxa, it); if (vc != null){ if (!name.contains(vc)) { taxa.setTaxonName(it, vc + "." + name, false); nameChanged = true; } } } return nameChanged; } public String getVoucherCode(Taxa taxa, int ic){ if (taxa!=null) { Object n = ChromaseqUtil.getStringAssociated(taxa, VoucherInfoFromOTUIDDB.voucherCodeRef, ic); if (n !=null) return ((String)n); } return null; } /*.................................................................................................................*/ public Object doCommand(String commandName, String arguments, CommandChecker checker) { if (checker.compare(this.getClass(), "Appends numbers to taxon names", "[length]", commandName, "appendNumbers")) { if (taxa !=null){ alterTaxonNames(taxa,table); } } else return super.doCommand(commandName, arguments, checker); return null; } /*.................................................................................................................*/ public String getNameForMenuItem() { return "Prefix With OTU ID Code"; } /*.................................................................................................................*/ public String getName() { return "Prefix With OTU ID Code"; } /*.................................................................................................................*/ public String getExplanation() { return "Prefixes the taxon name with the OTU ID Code."; }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ class ChooseNameParsingRuleDLOG extends ExtensibleListDialog {
boolean editLastItem = false;

public ChooseNameParsingRuleDLOG (SampleAndPrimerFileNameParser ownerModule, String nameParsingRulesName, MesquiteInteger buttonPressed){
super(ownerModule.containerOfModule(), "File Name Rules Manager", "File Name Rules", ownerModule.nameParsingRules);
super(ownerModule.containerOfModule(), "File Name Rules Manager", "File Name Rules", buttonPressed, ownerModule.nameParsingRules);
this.ownerModule = ownerModule;
/*
String message = "This dialog box allows you to create and edit snippets of code stored in the current file or project, to be inserted into batch files according to their names.";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
package mesquite.chromaseq.SequenceProfileForGenBank;

import java.awt.Button;
import java.awt.Choice;
import java.awt.GridBagConstraints;
import java.awt.Panel;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;

import mesquite.chromaseq.lib.ChromatogramFileNameParser;
import mesquite.chromaseq.lib.SequenceProfile;
import mesquite.lib.*;


public class SequenceProfileDialog extends ExtensibleDialog {

private SequenceProfileForGenBank sequenceProfileManager;
private SequenceProfile sequenceProfile;
private Choice sequenceProfileChoice;
private String sequenceProfileName="";

public SequenceProfileDialog(MesquiteWindow parent, String title, MesquiteInteger buttonPressed,
SequenceProfileForGenBank sequenceProfileManager, String defaultRuleName) {
super(parent, title, buttonPressed);
this.sequenceProfileManager = sequenceProfileManager;
this.sequenceProfileName = defaultRuleName;
addNameParsingComponents();
}


protected void addNameParsingComponents() {
addLabel(getTitle());

sequenceProfileChoice = addPopUpMenu("Sequence Profiles", sequenceProfileManager.sequenceProfileVector.getElementArray(), 0);
sequenceProfileManager.setChoice(sequenceProfileChoice);
sequenceProfileChoice.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
if (e.getItemSelectable() == sequenceProfileChoice){
getNameRuleFromChoice();
}
}
});
if (sequenceProfileChoice!=null) {
boolean noChoiceItems = (sequenceProfileChoice.getItemCount()<=0);
int sL = sequenceProfileManager.sequenceProfileVector.indexOfByName(sequenceProfileName);
if (sL <0) {
sL = 0;
}
if (!noChoiceItems) {
sequenceProfileChoice.select(sL);
sequenceProfile = (SequenceProfile)(sequenceProfileManager.sequenceProfileVector.elementAt(sL));
}
}
suppressNewPanel();
GridBagConstraints gridConstraints;
gridConstraints = getGridBagConstraints();
gridConstraints.fill = GridBagConstraints.NONE;
setGridBagConstraints(gridConstraints);
Panel panel = addNewDialogPanel(gridConstraints);
String editNameParserButtonString = "Edit Specifications...";
Button editNameParsersButton = addAButton(editNameParserButtonString, panel);
editNameParsersButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (sequenceProfileManager!=null) {
sequenceProfile = sequenceProfileManager.chooseSequenceSpecifiation(sequenceProfile);
}
}
});
}

public void getNameRuleFromChoice() {
sequenceProfile=null;
if (sequenceProfileChoice!=null) {
sequenceProfileName = sequenceProfileChoice.getSelectedItem();
boolean noChoiceItems = (sequenceProfileChoice.getItemCount()<=0);
int sL = sequenceProfileChoice.getSelectedIndex();
if (sL <0) {
sL = 0;
}
if (!noChoiceItems) {
sequenceProfile = (SequenceProfile)(sequenceProfileManager.sequenceProfileVector.elementAt(sL));
}
}
if (sequenceProfile==null)
sequenceProfile = new SequenceProfile(); //make default one }
}

public SequenceProfile getNameParsingRule() {
return sequenceProfile;
}
}
Loading

0 comments on commit e982c05

Please sign in to comment.