Search in sources :

Example 1 with DnaComponent

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;
}
Also used : DNAFeatureLocation(org.jbei.ice.lib.dto.DNAFeatureLocation) DNAFeature(org.jbei.ice.lib.dto.DNAFeature) DnaComponent(org.sbolstandard.core.DnaComponent)

Aggregations

DNAFeature (org.jbei.ice.lib.dto.DNAFeature)1 DNAFeatureLocation (org.jbei.ice.lib.dto.DNAFeatureLocation)1 DnaComponent (org.sbolstandard.core.DnaComponent)1