X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FAnnotationFile.java;h=e127e7397553ae151a49bfdb2e49e59e1d2cb242;hb=49db0dff1da16c3355b43a41498c1fc93ef47e91;hp=934be417c986d268a0055b1db2c1b2c689f5a2e9;hpb=304e64fb34b32659be1bbfd39fb4e15b2f79586e;p=jalview.git diff --git a/src/jalview/io/AnnotationFile.java b/src/jalview/io/AnnotationFile.java index 934be41..e127e73 100755 --- a/src/jalview/io/AnnotationFile.java +++ b/src/jalview/io/AnnotationFile.java @@ -34,6 +34,7 @@ import java.util.Vector; import jalview.analysis.Conservation; import jalview.api.AlignViewportI; +import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; import jalview.datamodel.Annotation; @@ -66,6 +67,11 @@ public class AnnotationFile private String lastread = ""; /** + * default calcId string for new annotation + */ + private String defaultCalcId = null; + + /** * Constructor */ public AnnotationFile() @@ -665,6 +671,21 @@ public class AnnotationFile return readAnnotationFile(al, null, file, sourceType); } + /** + * read an annotation file onto the alignment, but apply the given calcId + * @param aln + * @param calcId + * @param file + * @param url + * @return + */ + public boolean readAnnotationFileWithCalcId(Alignment aln, String calcId, String file, + DataSourceType url) + { + defaultCalcId=calcId; + return readAnnotationFile(aln, null, file, url); + } + public boolean readAnnotationFile(AlignmentI al, HiddenColumns hidden, Object file, DataSourceType sourceType) { @@ -1005,7 +1026,7 @@ public class AnnotationFile annotation = new AlignmentAnnotation(label, description, (index == 0) ? null : annotations, 0, 0, graphStyle); - + annotation.setCalcId(defaultCalcId); annotation.score = score; if (!overrideAutoAnnot && autoAnnots .containsKey(autoAnnotsKey(annotation, refSeq, groupRef)))