Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
22 | 2 | 2 | 0.984 | compound_stmt |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 37 | 421 | Bio/Seq.py |
2 | 22 | 459 | Bio/Seq.py |
| ||||
def split(self,sep = None,maxsplit = -1): '''Split method, like that of a python string. This behaves like the python string method of the same name. Return a list of the 'words' in the string (as Seq objects), using sep as the delimiter string. If maxsplit is given, at most maxsplit splits are done. If maxsplit is ommited, all splits are made. Following the python string method, sep will by default be any white space (tabs, spaces, newlines) but this is unlikely to apply to biological sequences. e.g. >>> from Bio.Seq import Seq >>> my_rna = Seq("GUCAUGGCCAUUGUAAUGGGCCGCUGAAAGGGUGCCCGAUAGUUG") >>> my_aa = my_rna.translate() >>> my_aa Seq('VMAIVMGR*KGAR*L', HasStopCodon(ExtendedIUPACProtein(), '*')) >>> my_aa.split("*") [Seq('VMAIVMGR', HasStopCodon(ExtendedIUPACProtein(), '*')), Seq('KGAR', HasStopCodon(ExtendedIUPACProtein(), '*')), Seq('L', HasStopCodon(ExtendedIUPACProtein(), '*'))] >>> my_aa.split("*",1) [Seq('VMAIVMGR', HasStopCodon(ExtendedIUPACProtein(), '*')), Seq('KGAR*L', HasStopCodon(ExtendedIUPACProtein(), '*'))] See also the rsplit method: >>> my_aa.rsplit("*",1) [Seq('VMAIVMGR*KGAR', HasStopCodon(ExtendedIUPACProtein(), '*')), Seq('L', HasStopCodon(ExtendedIUPACProtein(), '*'))] ''' #If it has one, check the alphabet: sep_str = self._get_seq_str_and_check_alphabet(sep) #TODO - If the sep is the defined stop symbol, or gap char, #should we adjust the alphabet? return [Seq(part,self.alphabet) for part in str(self).split(sep_str,maxsplit)] |
| ||||
def rsplit(self,sep = None,maxsplit = -1): '''Right split method, like that of a python string. This behaves like the python string method of the same name. Return a list of the 'words' in the string (as Seq objects), using sep as the delimiter string. If maxsplit is given, at most maxsplit splits are done COUNTING FROM THE RIGHT. If maxsplit is ommited, all splits are made. Following the python string method, sep will by default be any white space (tabs, spaces, newlines) but this is unlikely to apply to biological sequences. e.g. print my_seq.rsplit("*",1) See also the split method. ''' #If it has one, check the alphabet: sep_str = self._get_seq_str_and_check_alphabet(sep) return [Seq(part,self.alphabet) for part in str(self).rsplit(sep_str,maxsplit)] |
| |||
def [[#variable2e802240]](self,sep = None,maxsplit = -1): [[#variable2e8021c0]] #If it has one, check the alphabet: sep_str = self._get_seq_str_and_check_alphabet(sep) #TODO - If the sep is the defined stop symbol, or gap char, #should we adjust the alphabet? return [Seq(part,self.alphabet) for part in str(self). [[#variable2e802240]](sep_str,maxsplit)] |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#2e802240]] | rsplit |
1 | 2 | [[#2e802240]] | split |
2 | 1 | [[#2e8021c0]] | '''Right split method, like that of a python string. This behaves like the python string method of the same name. Return a list of the 'words' in the string (as Seq objects), using sep as the delimiter string. If maxsplit is given, at most maxsplit splits are done COUNTING FROM THE RIGHT. If maxsplit is ommited, all splits are made. Following the python string method, sep will by default be any white space (tabs, spaces, newlines) but this is unlikely to apply to biological sequences. e.g. print my_seq.rsplit("*",1) See also the split method. ''' |
2 | 2 | [[#2e8021c0]] | '''Split method, like that of a python string. This behaves like the python string method of the same name. Return a list of the 'words' in the string (as Seq objects), using sep as the delimiter string. If maxsplit is given, at most maxsplit splits are done. If maxsplit is ommited, all splits are made. Following the python string method, sep will by default be any white space (tabs, spaces, newlines) but this is unlikely to apply to biological sequences. e.g. >>> from Bio.Seq import Seq >>> my_rna = Seq("GUCAUGGCCAUUGUAAUGGGCCGCUGAAAGGGUGCCCGAUAGUUG") >>> my_aa = my_rna.translate() >>> my_aa Seq('VMAIVMGR*KGAR*L', HasStopCodon(ExtendedIUPACProtein(), '*')) >>> my_aa.split("*") [Seq('VMAIVMGR', HasStopCodon(ExtendedIUPACProtein(), '*')), Seq('KGAR', HasStopCodon(ExtendedIUPACProtein(), '*')), Seq('L', HasStopCodon(ExtendedIUPACProtein(), '*'))] >>> my_aa.split("*",1) [Seq('VMAIVMGR', HasStopCodon(ExtendedIUPACProtein(), '*')), Seq('KGAR*L', HasStopCodon(ExtendedIUPACProtein(), '*'))] See also the rsplit method: >>> my_aa.rsplit("*",1) [Seq('VMAIVMGR*KGAR', HasStopCodon(ExtendedIUPACProtein(), '*')), Seq('L', HasStopCodon(ExtendedIUPACProtein(), '*'))] ''' |