Search in sources :

Example 21 with Range

use of org.sbolstandard.core2.Range in project libSBOLj by SynBioDex.

the class SequenceAnnotation method addRange.

/**
 * Creates a range with the given arguments and then adds it to this sequence annotation's
 * list of locations.
 * <p>
 * This method first creates a compliant URI for the range to be created.
 * It starts with this sequence annotation's persistent identity URI,
 * followed by the given display ID, and ends an empty string for version.
 *
 * @param displayId the display ID for the range to be created
 * @param start the start index for the range to be created
 * @param end the end index for the range to be created
 * @param orientation the orientation type
 * @return the created range
 * @throws SBOLValidationException if any of the following SBOL validation rules was violated:
 * 10201, 10202, 10204, 10206, 11102, 11103, 11104.
 */
public Range addRange(String displayId, int start, int end, OrientationType orientation) throws SBOLValidationException {
    URI identity = createCompliantURI(this.getPersistentIdentity().toString(), displayId, this.getVersion());
    Range range = new Range(identity, start, end);
    range.setPersistentIdentity(createCompliantURI(this.getPersistentIdentity().toString(), displayId, ""));
    range.setDisplayId(displayId);
    range.setVersion(this.getVersion());
    range.setOrientation(orientation);
    addLocation(range);
    return range;
}
Also used : URI(java.net.URI) URIcompliance.createCompliantURI(org.sbolstandard.core2.URIcompliance.createCompliantURI)

Aggregations

Range (org.apache.commons.lang3.Range)11 Test (org.junit.Test)10 Date (java.util.Date)9 URI (java.net.URI)6 URIcompliance.createCompliantURI (org.sbolstandard.core2.URIcompliance.createCompliantURI)6 Range (controlP5.Range)3 Slider (controlP5.Slider)3 Toggle (controlP5.Toggle)3 SimpleDateFormat (java.text.SimpleDateFormat)2 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 QName (javax.xml.namespace.QName)2 Literal (org.sbolstandard.core.datatree.Literal)2 StringifyQName (org.sbolstandard.core.io.json.StringifyQName)2 ControllerStyle (controlP5.ControllerStyle)1 Group (controlP5.Group)1 Label (controlP5.Label)1 List (java.util.List)1 ItemStack (net.minecraft.item.ItemStack)1 ProfilePeriod (org.apache.metron.profiler.ProfilePeriod)1