CloneSet219


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
25320.979compound_stmt
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
143219
Bio/Seq.py
225294
Bio/Seq.py
325320
Bio/Seq.py
Clone Instance
1
Line Count
43
Source Line
219
Source File
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) 


Clone Instance
2
Line Count
25
Source Line
294
Source File
Bio/Seq.py

    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) 


Clone Instance
3
Line Count
25
Source Line
320
Source File
Bio/Seq.py

    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) 


Clone AbstractionParameter Count: 2Parameter Bindings

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 Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#19a4b100]]
rfind 
12[[#19a4b100]]
find 
13[[#19a4b100]]
count 
21[[#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
        ''' 
22[[#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
        ''' 
23[[#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!
        '''