From: <gk...@us...> - 2010-11-01 18:49:26
|
Revision: 24072 http://gmod.svn.sourceforge.net/gmod/?rev=24072&view=rev Author: gk_fan Date: 2010-11-01 18:49:16 +0000 (Mon, 01 Nov 2010) Log Message: ----------- Added configurable option for allowing partial ORFs to be calculated. Modified Paths: -------------- apollo/trunk/src/java/apollo/config/Style.java apollo/trunk/src/java/apollo/datamodel/FeatureSet.java Modified: apollo/trunk/src/java/apollo/config/Style.java =================================================================== --- apollo/trunk/src/java/apollo/config/Style.java 2010-11-01 16:23:16 UTC (rev 24071) +++ apollo/trunk/src/java/apollo/config/Style.java 2010-11-01 18:49:16 UTC (rev 24072) @@ -203,6 +203,8 @@ protected Hashtable parameters = null; private String overlapDefinition; + + private boolean allowPartialORFs = true; public Style(String styleFileString) { logger.debug("Creating new style "+styleFileString); @@ -627,6 +629,8 @@ } geneticCodeNumber = num; } + } else if (key.equalsIgnoreCase("AllowPartialORFs")) { + this.allowPartialORFs = getBoolean(value); } else { // Stick it in as a generic parameter logger.debug("saved unknown parameter from " + styleFile + ": " + key + "=" + value); @@ -2104,5 +2108,13 @@ parameters = new Hashtable(1, 1.0F); return parameters; } + + /** Gets whether partial ORFs are allowed when calculating longest ORF + * + * @return whether partial ORFs are allowed + */ + public boolean isPartialORFsAllowed() { + return allowPartialORFs; + } } Modified: apollo/trunk/src/java/apollo/datamodel/FeatureSet.java =================================================================== --- apollo/trunk/src/java/apollo/datamodel/FeatureSet.java 2010-11-01 16:23:16 UTC (rev 24071) +++ apollo/trunk/src/java/apollo/datamodel/FeatureSet.java 2010-11-01 18:49:16 UTC (rev 24072) @@ -4,6 +4,7 @@ import java.util.*; import javax.swing.JOptionPane; +import apollo.config.Config; import apollo.util.SeqFeatureUtil; import apollo.util.FeatureList; import apollo.util.QuickSort; @@ -829,16 +830,19 @@ /* just in case the 5 prime end is missing see if a longer translation can be obtained without looking for the ATG */ - start_index = 0; - while (start_index < 3) { - String orf = get_ORF(the_mRNA, start_index, -1); - String aa = getTrimmedAA(orf, start_index); - if (aa.length() > longest_peptide.length()) { - setMissing5prime(true); - longest_peptide = aa; - best_start_index = start_index; + // only do this if Apollo is configured to allow partial ORFs + if (Config.getStyle().isPartialORFsAllowed()) { + start_index = 0; + while (start_index < 3) { + String orf = get_ORF(the_mRNA, start_index, -1); + String aa = getTrimmedAA(orf, start_index); + if (aa.length() > longest_peptide.length()) { + setMissing5prime(true); + longest_peptide = aa; + best_start_index = start_index; + } + start_index++; } - start_index++; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |