CloneSet117


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


Clone Instance
2
Line Count
36
Source Line
383
Source File
Bio/Seq.py

    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) 
         


Clone AbstractionParameter Count: 5Parameter Bindings

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 Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#76b86800]]
endswith 
12[[#76b86800]]
startswith 
21[[#76b86760]]
suffix 
22[[#76b86760]]
prefix 
31[[#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
        ''' 
32[[#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
        ''' 
41[[#76b866a0]]
suffix_strings 
42[[#76b866a0]]
prefix_strings 
51[[#76b86620]]
suffix_str 
52[[#76b86620]]
prefix_str