From 00ffcffb372b1dc7bc4dc75a2c263f2f35570e72 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 15 Oct 2014 10:09:17 +0100 Subject: [PATCH] JAL-674 make transferAnnotation method static --- src/MCview/PDBfile.java | 11 ++++++----- src/jalview/io/AlignFile.java | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) 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 -- 1.7.10.2