Skip to content
Snippets Groups Projects
Commit 1d18975c authored by tcarver's avatar tcarver
Browse files

use reserved attribute list in GFF3AttributeBuilder.reserved_a

parent f7420c9c
No related branches found
No related tags found
No related merge requests found
...@@ -713,12 +713,9 @@ public class GFFStreamFeature extends SimpleDocumentFeature implements ...@@ -713,12 +713,9 @@ public class GFFStreamFeature extends SimpleDocumentFeature implements
/** /**
* Return a String containing the qualifiers of this feature in a form * Return a String containing the qualifiers of this feature in a form
* suitable for using as the last field of a GFF line. The codon_start * suitable for using as the last field of a GFF line.
* attribute is not included since GFF has a frame field. gff_seqname,
* gff_source and score aren't included since they have corresponding fields.
**/ **/
private String unParseAttributes(final String myId) { private String unParseAttributes(final String myId) {
//final StringBuffer buffer = new StringBuffer();
final QualifierVector qualifiers = getQualifiers(); final QualifierVector qualifiers = getQualifiers();
GFF3AttributeBuilder abuf = new GFF3AttributeBuilder(); GFF3AttributeBuilder abuf = new GFF3AttributeBuilder();
prepareProcessors(abuf); prepareProcessors(abuf);
...@@ -727,10 +724,7 @@ public class GFFStreamFeature extends SimpleDocumentFeature implements ...@@ -727,10 +724,7 @@ public class GFFStreamFeature extends SimpleDocumentFeature implements
abuf.ignore(attr); abuf.ignore(attr);
} }
final String names[] = { "ID", "Name", "Alias", "Parent", "Derives_from", final int names_length = abuf.reserved_a.length;
"Target", "Gap", "Note", "Dbxref", "Ontology_term", "Start_range",
"End_range", "Is_circular" };
final int names_length = names.length;
// add ID attribute // add ID attribute
if (myId != null) { if (myId != null) {
...@@ -739,7 +733,7 @@ public class GFFStreamFeature extends SimpleDocumentFeature implements ...@@ -739,7 +733,7 @@ public class GFFStreamFeature extends SimpleDocumentFeature implements
// build reserved attributes // build reserved attributes
for (int i = 1; i < names_length; i++) { for (int i = 1; i < names_length; i++) {
Qualifier this_qualifier = qualifiers.getQualifierByName(names[i]); Qualifier this_qualifier = qualifiers.getQualifierByName(abuf.reserved_a[i]);
if (this_qualifier == null) if (this_qualifier == null)
continue; continue;
...@@ -754,7 +748,7 @@ public class GFFStreamFeature extends SimpleDocumentFeature implements ...@@ -754,7 +748,7 @@ public class GFFStreamFeature extends SimpleDocumentFeature implements
// skip reserved names // skip reserved names
for (int j = 0; j < names_length; j++) for (int j = 0; j < names_length; j++)
if (this_qualifier.getName().equals(names[j])) if (this_qualifier.getName().equals(abuf.reserved_a[j]))
lname = true; lname = true;
if (lname) if (lname)
continue; continue;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment