From: Jim Procter Date: Wed, 15 Oct 2014 09:09:17 +0000 (+0100) Subject: JAL-674 make transferAnnotation method static X-Git-Tag: Jalview_2_9~169^2~26 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;ds=inline;h=00ffcffb372b1dc7bc4dc75a2c263f2f35570e72;p=jalview.git JAL-674 make transferAnnotation method static --- diff --git a/src/MCview/PDBfile.java b/src/MCview/PDBfile.java index d8ca9a7..bb01faf 100755 --- a/src/MCview/PDBfile.java +++ b/src/MCview/PDBfile.java @@ -22,7 +22,7 @@ package MCview; import java.io.*; import java.util.*; - +import java.util.List; import java.awt.*; import jalview.analysis.AlignSeq; @@ -279,7 +279,7 @@ public class PDBfile extends jalview.io.AlignFile {}).invoke(jmf)); cl.getMethod("addAnnotations", new Class[] { Alignment.class }).invoke(jmf, al); - replaceMatchingSeqsWith(prot, al, AlignSeq.PEP); + replaceMatchingSeqsWith(seqs, annotations, prot, al, AlignSeq.PEP, false); } } catch (ClassNotFoundException q) { @@ -307,7 +307,7 @@ public class PDBfile extends jalview.io.AlignFile new Class[] { FileParse.class }).invoke(annotate3d, new Object[] { new FileParse(getDataName(), type) })); - replaceMatchingSeqsWith(rna, al, AlignSeq.DNA); + replaceMatchingSeqsWith(seqs, annotations, rna, al, AlignSeq.DNA, false); } } catch (ClassNotFoundException x) { @@ -323,9 +323,10 @@ public class PDBfile extends jalview.io.AlignFile * @param ochains * @param al * @param dnaOrProtein + * @param removeOldAnnots when true, old annotation is cleared before new annotation transferred */ - private void replaceMatchingSeqsWith(ArrayList ochains, - AlignmentI al, String dnaOrProtein) + public static void replaceMatchingSeqsWith(List seqs, List annotations, List ochains, + AlignmentI al, String dnaOrProtein, boolean removeOldAnnots) { if (al != null && al.getHeight() > 0) { diff --git a/src/jalview/io/AlignFile.java b/src/jalview/io/AlignFile.java index 2962cb2..af835ca 100755 --- a/src/jalview/io/AlignFile.java +++ b/src/jalview/io/AlignFile.java @@ -51,7 +51,7 @@ public abstract class AlignFile extends FileParse /** * annotation to be added to generated alignment object */ - protected Vector annotations; + protected Vector annotations; /** * Properties to be added to generated alignment object