From: Jim Procter Date: Thu, 30 Oct 2014 15:44:50 +0000 (+0000) Subject: JAL-674 return original and replacement sequences and the alignment to allow more... X-Git-Tag: Jalview_2_9~155^2~15^2~17 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=8fc03b5f923a6b80e2a7fc22f6fdd2c5c7ad9de9;p=jalview.git JAL-674 return original and replacement sequences and the alignment to allow more processing if needed --- diff --git a/src/jalview/analysis/AlignSeq.java b/src/jalview/analysis/AlignSeq.java index f5afa9c..c546310 100755 --- a/src/jalview/analysis/AlignSeq.java +++ b/src/jalview/analysis/AlignSeq.java @@ -1069,11 +1069,19 @@ public class AlignSeq * @param ochains * @param al * @param dnaOrProtein - * @param removeOldAnnots when true, old annotation is cleared before new annotation transferred + * @param removeOldAnnots + * when true, old annotation is cleared before new annotation + * transferred + * @return List originals, List replacement, + * List alignment between each> */ - public static void replaceMatchingSeqsWith(List seqs, List annotations, List ochains, + public static List> replaceMatchingSeqsWith( + List seqs, List annotations, + List ochains, AlignmentI al, String dnaOrProtein, boolean removeOldAnnots) { + List orig = new ArrayList(), repl = new ArrayList(); + List aligs = new ArrayList(); if (al != null && al.getHeight() > 0) { ArrayList matches = new ArrayList(); @@ -1108,10 +1116,13 @@ public class AlignSeq if ((q = ochains.indexOf(sp)) > -1) { seqs.set(p, sq = matches.get(q)); + orig.add(sp); + repl.add(sq); sq.setName(sp.getName()); sq.setDescription(sp.getDescription()); Mapping sp2sq; sq.transferAnnotation(sp, sp2sq = aligns.get(q).getMappingFromS1(false)); + aligs.add(aligns.get(q)); int inspos = -1; for (int ap = 0; ap < annotations.size();) { @@ -1142,6 +1153,7 @@ public class AlignSeq } } } + return Arrays.asList(orig, repl, aligs); } /**