Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
36 | 2 | 5 | 0.960 | compound_stmt |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 36 | 346 | Bio/Seq.py |
2 | 36 | 383 | Bio/Seq.py |
| ||||
def startswith(self,prefix,start = 0,end = sys.maxint): '''Does the Seq start with the given prefix? Returns True/False. This behaves like the python string method of the same name. Return True if the sequence starts with the specified prefix (a string or another Seq object), False otherwise. With optional start, test sequence beginning at that position. With optional end, stop comparing sequence at that position. prefix can also be a tuple of strings to try. e.g. >>> from Bio.Seq import Seq >>> my_rna = Seq("GUCAUGGCCAUUGUAAUGGGCCGCUGAAAGGGUGCCCGAUAGUUG") >>> my_rna.startswith("GUC") True >>> my_rna.startswith("AUG") False >>> my_rna.startswith("AUG", 3) True >>> my_rna.startswith(("UCC","UCA","UCG"),1) True ''' #If it has one, check the alphabet: if isinstance(prefix,tuple): #TODO - Once we drop support for Python 2.4, instead of this #loop offload to the string method (requires Python 2.5+). #Check all the alphabets first... prefix_strings = [self._get_seq_str_and_check_alphabet(p) for p in prefix] for prefix_str in prefix_strings: if str(self).startswith(prefix_str,start,end): return True return False else: prefix_str = self._get_seq_str_and_check_alphabet(prefix) return str(self).startswith(prefix_str,start,end) |
| ||||
def endswith(self,suffix,start = 0,end = sys.maxint): '''Does the Seq end with the given suffix? Returns True/False. This behaves like the python string method of the same name. Return True if the sequence ends with the specified suffix (a string or another Seq object), False otherwise. With optional start, test sequence beginning at that position. With optional end, stop comparing sequence at that position. suffix can also be a tuple of strings to try. e.g. >>> from Bio.Seq import Seq >>> my_rna = Seq("GUCAUGGCCAUUGUAAUGGGCCGCUGAAAGGGUGCCCGAUAGUUG") >>> my_rna.endswith("UUG") True >>> my_rna.endswith("AUG") False >>> my_rna.endswith("AUG", 0, 18) True >>> my_rna.endswith(("UCC","UCA","UUG")) True ''' #If it has one, check the alphabet: if isinstance(suffix,tuple): #TODO - Once we drop support for Python 2.4, instead of this #loop offload to the string method (requires Python 2.5+). #Check all the alphabets first... suffix_strings = [self._get_seq_str_and_check_alphabet(p) for p in suffix] for suffix_str in suffix_strings: if str(self).endswith(suffix_str,start,end): return True return False else: suffix_str = self._get_seq_str_and_check_alphabet(suffix) return str(self).endswith(suffix_str,start,end) |
| |||
def [[#variable76b86800]](self, [[#variable76b86760]],start = 0,end = sys.maxint): [[#variable76b86700]] #If it has one, check the alphabet: if isinstance( [[#variable76b86760]],tuple): #TODO - Once we drop support for Python 2.4, instead of this #loop offload to the string method (requires Python 2.5+). #Check all the alphabets first... [[#variable76b866a0]]= [self._get_seq_str_and_check_alphabet(p) for p in [[#variable76b86760]]] for [[#variable76b86620]]in [[#variable76b866a0]]: if str(self). [[#variable76b86800]]( [[#variable76b86620]],start,end): return True return False else: [[#variable76b86620]]= self._get_seq_str_and_check_alphabet( [[#variable76b86760]]) return str(self). [[#variable76b86800]]( [[#variable76b86620]],start,end) |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#76b86800]] | endswith |
1 | 2 | [[#76b86800]] | startswith |
2 | 1 | [[#76b86760]] | suffix |
2 | 2 | [[#76b86760]] | prefix |
3 | 1 | [[#76b86700]] | '''Does the Seq end with the given suffix? Returns True/False. This behaves like the python string method of the same name. Return True if the sequence ends with the specified suffix (a string or another Seq object), False otherwise. With optional start, test sequence beginning at that position. With optional end, stop comparing sequence at that position. suffix can also be a tuple of strings to try. e.g. >>> from Bio.Seq import Seq >>> my_rna = Seq("GUCAUGGCCAUUGUAAUGGGCCGCUGAAAGGGUGCCCGAUAGUUG") >>> my_rna.endswith("UUG") True >>> my_rna.endswith("AUG") False >>> my_rna.endswith("AUG", 0, 18) True >>> my_rna.endswith(("UCC","UCA","UUG")) True ''' |
3 | 2 | [[#76b86700]] | '''Does the Seq start with the given prefix? Returns True/False. This behaves like the python string method of the same name. Return True if the sequence starts with the specified prefix (a string or another Seq object), False otherwise. With optional start, test sequence beginning at that position. With optional end, stop comparing sequence at that position. prefix can also be a tuple of strings to try. e.g. >>> from Bio.Seq import Seq >>> my_rna = Seq("GUCAUGGCCAUUGUAAUGGGCCGCUGAAAGGGUGCCCGAUAGUUG") >>> my_rna.startswith("GUC") True >>> my_rna.startswith("AUG") False >>> my_rna.startswith("AUG", 3) True >>> my_rna.startswith(("UCC","UCA","UCG"),1) True ''' |
4 | 1 | [[#76b866a0]] | suffix_strings |
4 | 2 | [[#76b866a0]] | prefix_strings |
5 | 1 | [[#76b86620]] | suffix_str |
5 | 2 | [[#76b86620]] | prefix_str |