Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)
Makes a python string translation table (PRIVATE).

Arguments:
 - complement_mapping - a dictionary such as ambiguous_dna_complement
   and ambiguous_rna_complement from Data.IUPACData.

Returns a translation table (a string of length 256) for use with the
python string's translate method to use in a (reverse) complement.

Compatible with lower case and upper case sequences.(more...)

        def _maketrans(complement_mapping):
    """Makes a python string translation table (PRIVATE).

    Arguments:
     - complement_mapping - a dictionary such as ambiguous_dna_complement
       and ambiguous_rna_complement from Data.IUPACData.

    Returns a translation table (a string of length 256) for use with the
    python string's translate method to use in a (reverse) complement.

    Compatible with lower case and upper case sequences.

    For internal use only.
    """
    before = ''.join(complement_mapping.keys())
    after = ''.join(complement_mapping.values())
    before = before + before.lower()
    after = after + after.lower()
    if sys.version_info[0] == 3:
        return str.maketrans(before, after)
    else:
        return string.maketrans(before, after)
        


src/p/y/python-dna-0.1.2/pydna/dsdna.py   python-dna(Download)
from Bio.Alphabet.IUPAC     import IUPACAmbiguousDNA
from Bio.Seq                import Seq
from Bio.Seq                import _maketrans
from Bio.Data.IUPACData     import ambiguous_dna_complement as amb_compl
from Bio.SeqRecord          import SeqRecord
 
amb_compl.update({"U":"A"})
_complement_table = _maketrans(amb_compl)
 
def rc(sequence):

src/p/y/pydna-0.6.1/pydna/dsdna.py   pydna(Download)
from Bio.Alphabet.IUPAC     import IUPACAmbiguousDNA
from Bio.Seq                import Seq
from Bio.Seq                import _maketrans
from Bio.Data.IUPACData     import ambiguous_dna_complement as amb_compl
from Bio.SeqRecord          import SeqRecord
 
amb_compl.update({"U":"A"})
_complement_table = _maketrans(amb_compl)
 
def rc(sequence):