git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-2018 export graduated feature colours correctly
[jalview.git]
/
src
/
jalview
/
io
/
FeaturesFile.java
diff --git
a/src/jalview/io/FeaturesFile.java
b/src/jalview/io/FeaturesFile.java
index
2dd5f26
..
372d905
100755
(executable)
--- a/
src/jalview/io/FeaturesFile.java
+++ b/
src/jalview/io/FeaturesFile.java
@@
-842,12
+842,12
@@
public class FeaturesFile extends AlignFile implements FeaturesSourceI
features = sequences[i].getSequenceFeatures();
if (features != null)
{
features = sequences[i].getSequenceFeatures();
if (features != null)
{
- for (int j = 0; j < features.length; j++)
+ for (SequenceFeature sequenceFeature : features)
{
{
- isnonpos = features[j].begin == 0 && features[j].end == 0;
+ isnonpos = sequenceFeature.begin == 0 && sequenceFeature.end == 0;
if ((!nonpos && isnonpos)
|| (!isnonpos && visOnly && !visible
if ((!nonpos && isnonpos)
|| (!isnonpos && visOnly && !visible
- .containsKey(features[j].type)))
+ .containsKey(sequenceFeature.type)))
{
// skip if feature is nonpos and we ignore them or if we only
// output visible and it isn't non-pos and it's not visible
{
// skip if feature is nonpos and we ignore them or if we only
// output visible and it isn't non-pos and it's not visible
@@
-855,47
+855,48
@@
public class FeaturesFile extends AlignFile implements FeaturesSourceI
}
if (group != null
}
if (group != null
- && (features[j].featureGroup == null || !features[j].featureGroup
+ && (sequenceFeature.featureGroup == null || !sequenceFeature.featureGroup
.equals(group)))
{
continue;
}
.equals(group)))
{
continue;
}
- if (group == null && features[j].featureGroup != null)
+ if (group == null && sequenceFeature.featureGroup != null)
{
continue;
}
// we have features to output
featuresGen = true;
{
continue;
}
// we have features to output
featuresGen = true;
- if (features[j].description == null
- || features[j].description.equals(""))
+ if (sequenceFeature.description == null
+ || sequenceFeature.description.equals(""))
{
{
- out.append(features[j].type).append(TAB);
+ out.append(sequenceFeature.type).append(TAB);
}
else
{
}
else
{
- if (features[j].links != null
- && features[j].getDescription().indexOf("<html>") == -1)
+ if (sequenceFeature.links != null
+ && sequenceFeature.getDescription().indexOf("<html>") == -1)
{
out.append("<html>");
}
{
out.append("<html>");
}
- out.append(features[j].description + " ");
- if (features[j].links != null)
+ out.append(sequenceFeature.description);
+ if (sequenceFeature.links != null)
{
{
- for (int l = 0; l < features[j].links.size(); l++)
+ for (int l = 0; l < sequenceFeature.links.size(); l++)
{
{
- String label = features[j].links.elementAt(l).toString();
+ String label = sequenceFeature.links.elementAt(l);
String href = label.substring(label.indexOf("|") + 1);
label = label.substring(0, label.indexOf("|"));
String href = label.substring(label.indexOf("|") + 1);
label = label.substring(0, label.indexOf("|"));
- if (features[j].description.indexOf(href) == -1)
+ if (sequenceFeature.description.indexOf(href) == -1)
{
{
- out.append("<a href=\"" + href + "\">" + label + "</a>");
+ out.append(" <a href=\"" + href + "\">" + label
+ + "</a>");
}
}
}
}
- if (features[j].getDescription().indexOf("</html>") == -1)
+ if (sequenceFeature.getDescription().indexOf("</html>") == -1)
{
out.append("</html>");
}
{
out.append("</html>");
}
@@
-905,15
+906,15
@@
public class FeaturesFile extends AlignFile implements FeaturesSourceI
}
out.append(sequences[i].getName());
out.append("\t-1\t");
}
out.append(sequences[i].getName());
out.append("\t-1\t");
- out.append(features[j].begin);
+ out.append(sequenceFeature.begin);
out.append(TAB);
out.append(TAB);
- out.append(features[j].end);
+ out.append(sequenceFeature.end);
out.append(TAB);
out.append(TAB);
- out.append(features[j].type);
- if (!Float.isNaN(features[j].score))
+ out.append(sequenceFeature.type);
+ if (!Float.isNaN(sequenceFeature.score))
{
out.append(TAB);
{
out.append(TAB);
- out.append(features[j].score);
+ out.append(sequenceFeature.score);
}
out.append(newline);
}
}
out.append(newline);
}
@@
-1024,7
+1025,8
@@
public class FeaturesFile extends AlignFile implements FeaturesSourceI
boolean includeNonPositionalFeatures)
{
StringBuilder out = new StringBuilder(256);
boolean includeNonPositionalFeatures)
{
StringBuilder out = new StringBuilder(256);
- out.append(String.format("%s %d\n", GFF_VERSION, gffVersion));
+ int version = gffVersion == 0 ? 2 : gffVersion;
+ out.append(String.format("%s %d\n", GFF_VERSION, version));
String source;
boolean isnonpos;
for (SequenceI seq : sequences)
String source;
boolean isnonpos;
for (SequenceI seq : sequences)