CloneSet200


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
52230.982stmt_list[2]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
152119
Bio/Align/Generic.py
251594
Bio/SeqRecord.py
Clone Instance
1
Line Count
52
Source Line
119
Source File
Bio/Align/Generic.py

    def format(self,format):  
        '''Returns the alignment as a string in the specified file format.

        The format should be a lower case string supported as an output
        format by Bio.AlignIO (such as "fasta", "clustal", "phylip",
        "stockholm", etc), which is used to turn the alignment into a
        string.

        e.g.
        >>> from Bio.Alphabet import IUPAC, Gapped
        >>> align = Alignment(Gapped(IUPAC.unambiguous_dna, "-"))
        >>> align.add_sequence("Alpha", "ACTGCTAGCTAG")
        >>> align.add_sequence("Beta",  "ACT-CTAGCTAG")
        >>> align.add_sequence("Gamma", "ACTGCTAGATAG")
        >>> print align.format("fasta")
        >Alpha
        ACTGCTAGCTAG
        >Beta
        ACT-CTAGCTAG
        >Gamma
        ACTGCTAGATAG
        <BLANKLINE>
        >>> print align.format("phylip")
         3 12
        Alpha      ACTGCTAGCT AG
        Beta       ACT-CTAGCT AG
        Gamma      ACTGCTAGAT AG
        <BLANKLINE>

        For Python 2.6, 3.0 or later see also the built in format() function.
        ''' 
        #See also the __format__ added for Python 2.6 / 3.0, PEP 3101
        #See also the SeqRecord class and its format() method using Bio.SeqIO
        return self.__format__(format) 


    def __format__(self,format_spec):  
        """Returns the alignment as a string in the specified file format.

        This method supports the python format() function added in
        Python 2.6/3.0.  The format_spec should be a lower case
        string supported by Bio.AlignIO as an output file format.
        See also the alignment's format() method.""" 
        if format_spec: 
             from StringIO import StringIO 
             from Bio import AlignIO 
             handle = StringIO( ) 
             AlignIO.write([self],handle,format_spec) 
             return handle.getvalue( ) 
        else: 
            #Follow python convention and default to using __str__
            return str(self) 
        


Clone Instance
2
Line Count
51
Source Line
594
Source File
Bio/SeqRecord.py

    def format(self,format):  
        """Returns the record as a string in the specified file format.

        The format should be a lower case string supported as an output
        format by Bio.SeqIO, which is used to turn the SeqRecord into a
        string.  e.g.

        >>> from Bio.Seq import Seq
        >>> from Bio.SeqRecord import SeqRecord
        >>> from Bio.Alphabet import IUPAC
        >>> record = SeqRecord(Seq("MKQHKAMIVALIVICITAVVAALVTRKDLCEVHIRTGQTEVAVF",
        ...                         IUPAC.protein),
        ...                    id="YP_025292.1", name="HokC",
        ...                    description="toxic membrane protein")
        >>> record.format("fasta")
        '>YP_025292.1 toxic membrane protein\\nMKQHKAMIVALIVICITAVVAALVTRKDLCEVHIRTGQTEVAVF\\n'
        >>> print record.format("fasta")
        >YP_025292.1 toxic membrane protein
        MKQHKAMIVALIVICITAVVAALVTRKDLCEVHIRTGQTEVAVF
        <BLANKLINE>

        The python print command automatically appends a new line, meaning
        in this example a blank line is shown.  If you look at the string
        representation you can see there is a trailing new line (shown as
        slash n) which is important when writing to a file or if
        concatenating mutliple sequence strings together.

        Note that this method will NOT work on every possible file format
        supported by Bio.SeqIO (e.g. some are for multiple sequences only).
        """ 
        #See also the __format__ added for Python 2.6 / 3.0, PEP 3101
        #See also the Bio.Align.Generic.Alignment class and its format()
        return self.__format__(format) 

    def __format__(self,format_spec):  
        """Returns the record as a string in the specified file format.

        This method supports the python format() function added in
        Python 2.6/3.0.  The format_spec should be a lower case string
        supported by Bio.SeqIO as an output file format. See also the
        SeqRecord's format() method.
        """ 
        if format_spec: 
             from StringIO import StringIO 
             from Bio import SeqIO 
             handle = StringIO( ) 
             SeqIO.write([self],handle,format_spec) 
             return handle.getvalue( ) 
        else: 
            #Follow python convention and default to using __str__
            return str(self) 
        


Clone AbstractionParameter Count: 3Parameter Bindings

def format(self,format):
   [[#variable19c2fe60]]
  #See also the __format__ added for Python 2.6 / 3.0, PEP 3101
  #See also the SeqRecord class and its format() method using Bio.SeqIO
  #See also the Bio.Align.Generic.Alignment class and its format()
  return self.__format__(format) 

def __format__(self,format_spec):
   [[#variable19c2fea0]]
  if format_spec:
  
    from StringIO import StringIO 
    from Bio import [[#variable19c2e420]]
    handle = StringIO( ) 
     [[#variable19c2e420]].write([self],handle,format_spec) 
    return handle.getvalue( ) 
  else:
  
    #Follow python convention and default to using __str__
    return str(self) 
  
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#19c2fe60]]
'''Returns the alignment as a string in the specified file format.

        The format should be a lower case string supported as an output
        format by Bio.AlignIO (such as "fasta", "clustal", "phylip",
        "stockholm", etc), which is used to turn the alignment into a
        string.

        e.g.
        >>> from Bio.Alphabet import IUPAC, Gapped
        >>> align = Alignment(Gapped(IUPAC.unambiguous_dna, "-"))
        >>> align.add_sequence("Alpha", "ACTGCTAGCTAG")
        >>> align.add_sequence("Beta",  "ACT-CTAGCTAG")
        >>> align.add_sequence("Gamma", "ACTGCTAGATAG")
        >>> print align.format("fasta")
        >Alpha
        ACTGCTAGCTAG
        >Beta
        ACT-CTAGCTAG
        >Gamma
        ACTGCTAGATAG
        <BLANKLINE>
        >>> print align.format("phylip")
         3 12
        Alpha      ACTGCTAGCT AG
        Beta       ACT-CTAGCT AG
        Gamma      ACTGCTAGAT AG
        <BLANKLINE>

        For Python 2.6, 3.0 or later see also the built in format() function.
        ''' 
12[[#19c2fe60]]
"""Returns the record as a string in the specified file format.

        The format should be a lower case string supported as an output
        format by Bio.SeqIO, which is used to turn the SeqRecord into a
        string.  e.g.

        >>> from Bio.Seq import Seq
        >>> from Bio.SeqRecord import SeqRecord
        >>> from Bio.Alphabet import IUPAC
        >>> record = SeqRecord(Seq("MKQHKAMIVALIVICITAVVAALVTRKDLCEVHIRTGQTEVAVF",
        ...                         IUPAC.protein),
        ...                    id="YP_025292.1", name="HokC",
        ...                    description="toxic membrane protein")
        >>> record.format("fasta")
        '>YP_025292.1 toxic membrane protein\\nMKQHKAMIVALIVICITAVVAALVTRKDLCEVHIRTGQTEVAVF\\n'
        >>> print record.format("fasta")
        >YP_025292.1 toxic membrane protein
        MKQHKAMIVALIVICITAVVAALVTRKDLCEVHIRTGQTEVAVF
        <BLANKLINE>

        The python print command automatically appends a new line, meaning
        in this example a blank line is shown.  If you look at the string
        representation you can see there is a trailing new line (shown as
        slash n) which is important when writing to a file or if
        concatenating mutliple sequence strings together.

        Note that this method will NOT work on every possible file format
        supported by Bio.SeqIO (e.g. some are for multiple sequences only).
        """ 
21[[#19c2fea0]]
"""Returns the alignment as a string in the specified file format.

        This method supports the python format() function added in
        Python 2.6/3.0.  The format_spec should be a lower case
        string supported by Bio.AlignIO as an output file format.
        See also the alignment's format() method.""" 
22[[#19c2fea0]]
"""Returns the record as a string in the specified file format.

        This method supports the python format() function added in
        Python 2.6/3.0.  The format_spec should be a lower case string
        supported by Bio.SeqIO as an output file format. See also the
        SeqRecord's format() method.
        """ 
31[[#19c2e420]]
AlignIO 
32[[#19c2e420]]
SeqIO