import jalview.analysis.Conservation;
import jalview.api.AlignViewportI;
+import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.Annotation;
private String lastread = "";
/**
+ * default calcId string for new annotation
+ */
+ private String defaultCalcId = null;
+
+ /**
* Constructor
*/
public 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)
{
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)))
}
Alignment aln = new Alignment(seqs.toArray(new SequenceI[0]));
if (annotFile == null
- || !new AnnotationFile().readAnnotationFile(aln, annotFile.getContentUrl().toString(), DataSourceType.URL))
+ || !new AnnotationFile().readAnnotationFileWithCalcId(aln, service.getId(), annotFile.getContentUrl().toString(), DataSourceType.URL))
{
Cache.log.debug("No annotation from slivka job\n" + annotFile);
}