git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
95d7489
)
skips any annotation that appears to be identical to existing autogenerated annotatio...
author
jprocter
<Jim Procter>
Fri, 23 Apr 2010 15:59:56 +0000
(15:59 +0000)
committer
jprocter
<Jim Procter>
Fri, 23 Apr 2010 15:59:56 +0000
(15:59 +0000)
src/jalview/io/AnnotationFile.java
patch
|
blob
|
history
diff --git
a/src/jalview/io/AnnotationFile.java
b/src/jalview/io/AnnotationFile.java
index
87b21d3
..
aac48eb
100755
(executable)
--- a/
src/jalview/io/AnnotationFile.java
+++ b/
src/jalview/io/AnnotationFile.java
@@
-433,6
+433,7
@@
public class AnnotationFile
public boolean readAnnotationFile(AlignmentI al, String file,
\r
String protocol)
\r
{
\r
public boolean readAnnotationFile(AlignmentI al, String file,
\r
String protocol)
\r
{
\r
+ Hashtable autoAnnots=new Hashtable();
\r
try
\r
{
\r
BufferedReader in = null;
\r
try
\r
{
\r
BufferedReader in = null;
\r
@@
-462,9
+463,24
@@
public class AnnotationFile
int graphStyle, index;
\r
int refSeqIndex = 1;
\r
int existingAnnotations = 0;
\r
int graphStyle, index;
\r
int refSeqIndex = 1;
\r
int existingAnnotations = 0;
\r
+ // when true - will add new rows regardless of whether they are duplicate auto-annotation like consensus or conservation graphs
\r
+ boolean overrideAutoAnnot=false;
\r
if (al.getAlignmentAnnotation() != null)
\r
{
\r
existingAnnotations = al.getAlignmentAnnotation().length;
\r
if (al.getAlignmentAnnotation() != null)
\r
{
\r
existingAnnotations = al.getAlignmentAnnotation().length;
\r
+ if (existingAnnotations>0)
\r
+ {
\r
+ AlignmentAnnotation[] aa = al.getAlignmentAnnotation();
\r
+ for (int aai=0;aai<aa.length;aai++)
\r
+ {
\r
+ if (aa[aai].autoCalculated)
\r
+ {
\r
+ // make a note of the name and description
\r
+ autoAnnots.put(aa[aai].graph+"\t"+aa[aai].label+"\t"+aa[aai].description+"\t"+(aa[aai].sequenceRef!=null ? aa[aai].sequenceRef.getDisplayId(true) : "")
\r
+ ,new Integer(1));
\r
+ }
\r
+ }
\r
+ }
\r
}
\r
\r
int alWidth = al.getWidth();
\r
}
\r
\r
int alWidth = al.getWidth();
\r
@@
-645,14
+661,20
@@
public class AnnotationFile
}
\r
\r
}
\r
}
\r
\r
}
\r
-
\r
+
\r
annotation = new AlignmentAnnotation(label, description,
\r
(index == 0) ? null : annotations, 0, 0, graphStyle);
\r
\r
annotation.score = score;
\r
annotation = new AlignmentAnnotation(label, description,
\r
(index == 0) ? null : annotations, 0, 0, graphStyle);
\r
\r
annotation.score = score;
\r
-
\r
+ if (!overrideAutoAnnot && autoAnnots.containsKey(annotation.graph+"\t"+annotation.label+"\t"+annotation.description+"\t"+(refSeq!=null ? refSeq.getDisplayId(true) : "")))
\r
+ {
\r
+ // skip - we've already got an automatic annotation of this type.
\r
+ continue;
\r
+ }
\r
+ // otherwise add it!
\r
if (refSeq != null)
\r
{
\r
if (refSeq != null)
\r
{
\r
+
\r
annotation.belowAlignment = false;
\r
// make a copy of refSeq so we can find other matches in the alignment
\r
SequenceI referedSeq = refSeq;
\r
annotation.belowAlignment = false;
\r
// make a copy of refSeq so we can find other matches in the alignment
\r
SequenceI referedSeq = refSeq;
\r