X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2FAlignSeq.java;h=241eeebdd2cfc09bbc11a790468d7de98cf4846e;hb=17e77c3f2949a0729322b4a8d907f3f34b6a9914;hp=5612133cb95ef77c1b2aec9931d7c687b7b90870;hpb=d69ae82ef958ae5bd67481d0b018a1db3662d4ae;p=jalview.git diff --git a/src/jalview/analysis/AlignSeq.java b/src/jalview/analysis/AlignSeq.java index 5612133..241eeeb 100755 --- a/src/jalview/analysis/AlignSeq.java +++ b/src/jalview/analysis/AlignSeq.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9) + * Copyright (C) 2015 The Jalview Authors * * This file is part of Jalview. * @@ -20,13 +20,6 @@ */ package jalview.analysis; -import java.awt.Color; -import java.awt.Graphics; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.StringTokenizer; - import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; import jalview.datamodel.Mapping; @@ -39,6 +32,13 @@ import jalview.util.Format; import jalview.util.MapList; import jalview.util.MessageManager; +import java.awt.Color; +import java.awt.Graphics; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.StringTokenizer; + /** * * @@ -53,13 +53,11 @@ public class AlignSeq private static final String NEWLINE = System.lineSeparator(); - static String[] dna = - { "A", "C", "G", "T", "-" }; + static String[] dna = { "A", "C", "G", "T", "-" }; // "C", "T", "A", "G", "-"}; - static String[] pep = - { "A", "R", "N", "D", "C", "Q", "E", "G", "H", "I", "L", "K", "M", "F", - "P", "S", "T", "W", "Y", "V", "B", "Z", "X", "-" }; + static String[] pep = { "A", "R", "N", "D", "C", "Q", "E", "G", "H", "I", + "L", "K", "M", "F", "P", "S", "T", "W", "Y", "V", "B", "Z", "X", "-" }; int[][] score; @@ -451,7 +449,8 @@ public class AlignSeq else { output.append("Wrong type = dna or pep only"); - throw new Error(MessageManager.formatMessage("error.unknown_type_dna_or_pep", new String[]{type2})); + throw new Error(MessageManager.formatMessage( + "error.unknown_type_dna_or_pep", new String[] { type2 })); } } @@ -1097,8 +1096,8 @@ public class AlignSeq */ public static List> replaceMatchingSeqsWith( List seqs, List annotations, - List ochains, - AlignmentI al, String dnaOrProtein, boolean removeOldAnnots) + List ochains, AlignmentI al, String dnaOrProtein, + boolean removeOldAnnots) { List orig = new ArrayList(), repl = new ArrayList(); List aligs = new ArrayList(); @@ -1106,7 +1105,7 @@ public class AlignSeq { ArrayList matches = new ArrayList(); ArrayList aligns = new ArrayList(); - + for (SequenceI sq : ochains) { SequenceI bestm = null; @@ -1114,8 +1113,7 @@ public class AlignSeq int bestscore = 0; for (SequenceI msq : al.getSequences()) { - AlignSeq aseq = doGlobalNWAlignment(msq, sq, - dnaOrProtein); + AlignSeq aseq = doGlobalNWAlignment(msq, sq, dnaOrProtein); if (bestm == null || aseq.getMaxScore() > bestscore) { bestscore = aseq.getMaxScore(); @@ -1141,7 +1139,8 @@ public class AlignSeq sq.setName(sp.getName()); sq.setDescription(sp.getDescription()); Mapping sp2sq; - sq.transferAnnotation(sp, sp2sq = aligns.get(q).getMappingFromS1(false)); + sq.transferAnnotation(sp, + sp2sq = aligns.get(q).getMappingFromS1(false)); aligs.add(aligns.get(q)); int inspos = -1; for (int ap = 0; ap < annotations.size();) @@ -1152,9 +1151,12 @@ public class AlignSeq { inspos = ap; } - if (removeOldAnnots) { + if (removeOldAnnots) + { annotations.remove(ap); - } else { + } + else + { AlignmentAnnotation alan = annotations.remove(ap); alan.liftOver(sq, sp2sq); alan.setSequenceRef(sq);