Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
25 | 3 | 2 | 0.979 | compound_stmt |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 43 | 219 | Bio/Seq.py |
2 | 25 | 294 | Bio/Seq.py |
3 | 25 | 320 | Bio/Seq.py |
| ||||
def count(self,sub,start = 0,end = sys.maxint): '''Non-overlapping count method, like that of a python string. This behaves like the python string method of the same name, which does a non-overlapping count! Returns an integer, the number of occurrences of substring argument sub in the (sub)sequence given by [start:end]. Optional arguments start and end are interpreted as in slice notation. Arguments: - sub - a string or another Seq object to look for - start - optional integer, slice start - end - optional integer, slice end e.g. >>> from Bio.Seq import Seq >>> my_seq = Seq("AAAATGA") >>> print my_seq.count("A") 5 >>> print my_seq.count("ATG") 1 >>> print my_seq.count(Seq("AT")) 1 >>> print my_seq.count("AT", 2, -1) 1 HOWEVER, please note because python strings and Seq objects (and MutableSeq objects) do a non-overlapping search, this may not give the answer you expect: >>> "AAAA".count("AA") 2 >>> print Seq("AAAA").count("AA") 2 A non-overlapping search would give the answer as three! ''' #If it has one, check the alphabet: sub_str = self._get_seq_str_and_check_alphabet(sub) return str(self).count(sub_str,start,end) |
| ||||
def find(self,sub,start = 0,end = sys.maxint): '''Find method, like that of a python string. This behaves like the python string method of the same name. Returns an integer, the index of the first occurrence of substring argument sub in the (sub)sequence given by [start:end]. Arguments: - sub - a string or another Seq object to look for - start - optional integer, slice start - end - optional integer, slice end Returns -1 if the subsequence is NOT found. e.g. Locating the first typical start codon, AUG, in an RNA sequence: >>> from Bio.Seq import Seq >>> my_rna = Seq("GUCAUGGCCAUUGUAAUGGGCCGCUGAAAGGGUGCCCGAUAGUUG") >>> my_rna.find("AUG") 3 ''' #If it has one, check the alphabet: sub_str = self._get_seq_str_and_check_alphabet(sub) return str(self).find(sub_str,start,end) |
| ||||
def rfind(self,sub,start = 0,end = sys.maxint): '''Find from right method, like that of a python string. This behaves like the python string method of the same name. Returns an integer, the index of the last (right most) occurrence of substring argument sub in the (sub)sequence given by [start:end]. Arguments: - sub - a string or another Seq object to look for - start - optional integer, slice start - end - optional integer, slice end Returns -1 if the subsequence is NOT found. e.g. Locating the last typical start codon, AUG, in an RNA sequence: >>> from Bio.Seq import Seq >>> my_rna = Seq("GUCAUGGCCAUUGUAAUGGGCCGCUGAAAGGGUGCCCGAUAGUUG") >>> my_rna.rfind("AUG") 15 ''' #If it has one, check the alphabet: sub_str = self._get_seq_str_and_check_alphabet(sub) return str(self).rfind(sub_str,start,end) |
| |||
def [[#variable19a4b100]](self,sub,start = 0,end = sys.maxint): [[#variable19a4b180]] #If it has one, check the alphabet: sub_str = self._get_seq_str_and_check_alphabet(sub) return str(self). [[#variable19a4b100]](sub_str,start,end) |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#19a4b100]] | rfind |
1 | 2 | [[#19a4b100]] | find |
1 | 3 | [[#19a4b100]] | count |
2 | 1 | [[#19a4b180]] | '''Find from right method, like that of a python string. This behaves like the python string method of the same name. Returns an integer, the index of the last (right most) occurrence of substring argument sub in the (sub)sequence given by [start:end]. Arguments: - sub - a string or another Seq object to look for - start - optional integer, slice start - end - optional integer, slice end Returns -1 if the subsequence is NOT found. e.g. Locating the last typical start codon, AUG, in an RNA sequence: >>> from Bio.Seq import Seq >>> my_rna = Seq("GUCAUGGCCAUUGUAAUGGGCCGCUGAAAGGGUGCCCGAUAGUUG") >>> my_rna.rfind("AUG") 15 ''' |
2 | 2 | [[#19a4b180]] | '''Find method, like that of a python string. This behaves like the python string method of the same name. Returns an integer, the index of the first occurrence of substring argument sub in the (sub)sequence given by [start:end]. Arguments: - sub - a string or another Seq object to look for - start - optional integer, slice start - end - optional integer, slice end Returns -1 if the subsequence is NOT found. e.g. Locating the first typical start codon, AUG, in an RNA sequence: >>> from Bio.Seq import Seq >>> my_rna = Seq("GUCAUGGCCAUUGUAAUGGGCCGCUGAAAGGGUGCCCGAUAGUUG") >>> my_rna.find("AUG") 3 ''' |
2 | 3 | [[#19a4b180]] | '''Non-overlapping count method, like that of a python string. This behaves like the python string method of the same name, which does a non-overlapping count! Returns an integer, the number of occurrences of substring argument sub in the (sub)sequence given by [start:end]. Optional arguments start and end are interpreted as in slice notation. Arguments: - sub - a string or another Seq object to look for - start - optional integer, slice start - end - optional integer, slice end e.g. >>> from Bio.Seq import Seq >>> my_seq = Seq("AAAATGA") >>> print my_seq.count("A") 5 >>> print my_seq.count("ATG") 1 >>> print my_seq.count(Seq("AT")) 1 >>> print my_seq.count("AT", 2, -1) 1 HOWEVER, please note because python strings and Seq objects (and MutableSeq objects) do a non-overlapping search, this may not give the answer you expect: >>> "AAAA".count("AA") 2 >>> print Seq("AAAA").count("AA") 2 A non-overlapping search would give the answer as three! ''' |