use of org.sbolstandard.core.DnaComponent in project ice by JBEI.
the class ICESBOLParserVisitor method createDNAFeature.
static DNAFeature createDNAFeature(SequenceAnnotation annotation, Pair pair) {
DNAFeature feature = new DNAFeature();
// set feature location
DNAFeatureLocation location = new DNAFeatureLocation();
location.setGenbankStart(pair.getFirst());
location.setEnd(pair.getSecond());
// get sequence strand type and uri
feature.setStrand(pair.getStrand());
feature.setUri(annotation.getURI().toString());
// get sequence annotation type and start and end sequence
DnaComponent subComponent = annotation.getSubComponent();
if (subComponent != null) {
location.setUri(subComponent.getURI().toString());
String name = subComponent.getName();
if (name == null || name.trim().isEmpty())
name = subComponent.getDisplayId();
feature.setName(name);
feature.setIdentifier(subComponent.getDisplayId());
String featureType = getFeatureType(subComponent.getTypes());
feature.setType(featureType);
}
feature.getLocations().add(location);
return feature;
}
Aggregations