示例#1
0
文件: sbol.py 项目: IsaacLuo/pySBOL
    def __init__(self, doc, uri, ptr=None):
        ## The SWIGPython-libSBOLc object wrapped by this SequenceAnnotation
        self.ptr = None
        if not ptr:
            # create the C object if it doesn't exist already
            self.ptr = libsbol.createSequenceAnnotation(doc.ptr, uri)
        else:
            # wrap a libSBOLc object if it already exists (most likely due to file import)
            self.ptr = ptr

        if self.ptr == None:
            raise URIError("Duplicate URI '%s'" % uri)

        # register the Python proxy
        ## the Document to which this annotation belongs
        self.doc = doc
        self.doc._annotations.append(self)

        # finish the Python proxy
        self.doc._annotations.append(self)
        fns = (None,
               libsbol.addPrecedesRelationship,
               libsbol.removePrecedesRelationship,
               libsbol.getNumPrecedes,
               libsbol.getNthPrecedes)
        # This SequenceAnnotation object precedes all the SequenceAnnotation objects
        # whose object references are included in this array property. Thus, the
        # precedes property specifies this annotation's position relative to others
        # that belong to the same parent DNAComponent.  This property can be operated
        # on with Python list operators and slice indexing.
        self.precedes = ExtendableSBOLObjectArray(self, *fns)
示例#2
0
文件: sbol.py 项目: tcmitchell/pySBOL
    def __init__(self, doc, uri, ptr=None):
        ## The SWIGPython-libSBOLc object wrapped by this SequenceAnnotation
        self.ptr = None
        if not ptr:
            # create the C object if it doesn't exist already
            self.ptr = libsbol.createSequenceAnnotation(doc.ptr, uri)
        else:
            # wrap a libSBOLc object if it already exists (most likely due to file import)
            self.ptr = ptr

        if self.ptr == None:
            raise URIError("Duplicate URI '%s'" % uri)

        # register the Python proxy
        ## the Document to which this annotation belongs
        self.doc = doc
        self.doc._annotations.append(self)

        # finish the Python proxy
        self.doc._annotations.append(self)
        fns = (libsbol.getSequenceAnnotationURI,
               libsbol.addPrecedesRelationship,
               libsbol.removePrecedesRelationship, libsbol.getNumPrecedes,
               libsbol.getNthPrecedes)
        # This SequenceAnnotation object precedes all the SequenceAnnotation objects
        # whose object references are included in this array property. Thus, the
        # precedes property specifies this annotation's position relative to others
        # that belong to the same parent DNAComponent.  This property can be operated
        # on with Python list operators and slice indexing.
        self.precedes = ExtendableSBOLObjectArray(self, *fns)
示例#3
0
    def __init__(self, doc, uri):
        # create the C object
        self.ptr = libsbol.createSequenceAnnotation(doc.ptr, uri)
        if self.ptr == None:
            raise URIError("Duplicate URI '%s'" % uri)

        # register the Python proxy
        self.doc = doc
        self.doc._annotations.append(self)

        # finish the Python proxy
        self.doc._annotations.append(self)
        fns = (libsbol.addPrecedesRelationship, libsbol.getNumPrecedes,
               libsbol.getNthPrecedes)
        self.precedes = ExtendableSBOLObjectArray(self, *fns)
示例#4
0
    def __init__(self, doc, uri):
        # create the C object
        self.ptr = libsbol.createSequenceAnnotation(doc.ptr, uri)
        if self.ptr == None:
            raise URIError("Duplicate URI '%s'" % uri)

        # register the Python proxy
        self.doc = doc
        self.doc._annotations.append(self)

        # finish the Python proxy
        self.doc._annotations.append(self)
        fns = (libsbol.addPrecedesRelationship,
               libsbol.getNumPrecedes,
               libsbol.getNthPrecedes)
        self.precedes = ExtendableSBOLObjectArray(self, *fns)