/*
- * 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.0b1)
+ * Copyright (C) 2015 The Jalview Authors
*
* This file is part of Jalview.
*
*/
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;
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;
+
/**
*
*
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;
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 }));
}
}
*/
public static List<List<? extends Object>> replaceMatchingSeqsWith(
List<SequenceI> seqs, List<AlignmentAnnotation> annotations,
- List<SequenceI> ochains,
- AlignmentI al, String dnaOrProtein, boolean removeOldAnnots)
+ List<SequenceI> ochains, AlignmentI al, String dnaOrProtein,
+ boolean removeOldAnnots)
{
List<SequenceI> orig = new ArrayList<SequenceI>(), repl = new ArrayList<SequenceI>();
List<AlignSeq> aligs = new ArrayList<AlignSeq>();
{
ArrayList<SequenceI> matches = new ArrayList<SequenceI>();
ArrayList<AlignSeq> aligns = new ArrayList<AlignSeq>();
-
+
for (SequenceI sq : ochains)
{
SequenceI bestm = null;
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();
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();)
{
inspos = ap;
}
- if (removeOldAnnots) {
+ if (removeOldAnnots)
+ {
annotations.remove(ap);
- } else {
+ }
+ else
+ {
AlignmentAnnotation alan = annotations.remove(ap);
alan.liftOver(sq, sp2sq);
alan.setSequenceRef(sq);