X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FAnnotationFile.java;fp=src%2Fjalview%2Fio%2FAnnotationFile.java;h=9daae63057f8d5d2e82f6e96d18171d9ae181e29;hb=871ad3a9474c5f4fbbe896a8a0551d0a6250cb77;hp=2182b24b9b7bb6154102bf0cdbf3b0582f47cf1f;hpb=eb6d7c560434c986f1dc76f6243d1493688f397e;p=jalview.git diff --git a/src/jalview/io/AnnotationFile.java b/src/jalview/io/AnnotationFile.java index 2182b24..9daae63 100755 --- a/src/jalview/io/AnnotationFile.java +++ b/src/jalview/io/AnnotationFile.java @@ -33,6 +33,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; @@ -65,6 +66,11 @@ public class AnnotationFile private String lastread = ""; /** + * default calcId string for new annotation + */ + private String defaultCalcId = null; + + /** * Constructor */ public AnnotationFile() @@ -664,6 +670,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) { @@ -1004,7 +1025,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)))