def complement(self, clone=True): if clone: rval = self.clone() else: rval = self if rval.is_DNA(): rval.sequence = transform.DNA_complement(rval.sequence) else: rval.sequence = transform.RNA_complement(rval.sequence) return rval
def complement( self, clone = True ): #need to override how color space is complemented if clone: rval = self.clone() else: rval = self if rval.has_adapter_base(): #No adapter, color space stays the same adapter = rval.sequence[0] sequence = rval.sequence[1:] if adapter.lower() != 'u': adapter = transform.DNA_complement( adapter ) else: adapter = transform.RNA_complement( adapter ) rval.sequence = "%s%s" % ( adapter, sequence ) return rval
def complement(self, clone=True): """return a new object with a complemented self.sequence strand call using my_object.complement(clone=False) if you wish to complement and return the current object. """ if clone: rval = self.clone() else: rval = self if rval.is_DNA(): rval.sequence = transform.DNA_complement(rval.sequence) else: rval.sequence = transform.RNA_complement(rval.sequence) return rval