JAL-2663 flag and filter to exclude non-standard amino acids from submission
authorJim Procter <jprocter@issues.jalview.org>
Sun, 13 Aug 2017 14:34:58 +0000 (15:34 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Mon, 14 Aug 2017 09:32:38 +0000 (10:32 +0100)
src/jalview/ws/jws2/AbstractJabaCalcWorker.java

index f94d18c..c691fee 100644 (file)
@@ -30,6 +30,7 @@ import jalview.datamodel.AnnotatedCollectionI;
 import jalview.datamodel.SequenceI;
 import jalview.gui.AlignFrame;
 import jalview.gui.IProgressIndicator;
+import jalview.schemes.ResidueProperties;
 import jalview.workers.AlignCalcWorker;
 import jalview.ws.jws2.dm.AAConSettings;
 import jalview.ws.jws2.dm.JabaWsParamSet;
@@ -63,6 +64,11 @@ public abstract class AbstractJabaCalcWorker extends AlignCalcWorker
   protected boolean submitGaps = true;
 
   /**
+   * by default, we filter out non-standard residues before submission
+   */
+  private boolean filterNonStandardResidues = true;
+
+  /**
    * Recover any existing parameters for this service
    */
   protected void initViewportParams()
@@ -491,7 +497,12 @@ public abstract class AbstractJabaCalcWorker extends AlignCalcWorker
           }
           for (int apos : sq.gapMap())
           {
-            gapMap[apos] = true; // aligned.
+            if (!filterNonStandardResidues
+                    || ResidueProperties.aaIndex[sq.getCharAt(apos)] < 20)
+            {
+              gapMap[apos] = true; // aligned and real amino acid residue
+            }
+            ;
           }
         }
         else