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

All Samples(89)  |  Call(76)  |  Derive(0)  |  Import(13)

src/b/i/biopython-1.63/Scripts/xbbtools/xbb_translations.py   biopython(Download)
 
 
from Bio.Seq import reverse_complement, translate
from Bio.SeqUtils import GC
 
    def frame1(self, seq, translation_table=1):
        return translate(seq, table=translation_table)
 
    def complement(self, seq):
        #TODO - use Seq methods instead of this hack:?
            #the code the expected 1,2,3 for the forward
            #strands and -1,-2,-3 for the reverse.
        return translate(seq, table=translation_table)
 
    def header_nice(self, txt, seq):

src/b/i/biopython-HEAD/Scripts/xbbtools/xbb_translations.py   biopython(Download)
 
 
from Bio.Seq import reverse_complement, translate
from Bio.SeqUtils import GC
 
    def frame1(self, seq, translation_table=1):
        return translate(seq, table=translation_table)
 
    def complement(self, seq):
        #TODO - use Seq methods instead of this hack:?
            #the code the expected 1,2,3 for the forward
            #strands and -1,-2,-3 for the reverse.
        return translate(seq, table=translation_table)
 
    def header_nice(self, txt, seq):

src/b/i/biopython-HEAD/Bio/SeqUtils/__init__.py   biopython(Download)
 
    """
    from Bio.Seq import reverse_complement, translate
    anti = reverse_complement(seq)
    comp = anti[::-1]
    length = len(seq)
    frames = {}
    for i in range(0, 3):
        fragment_length = 3 * ((length-i) // 3)
        frames[i+1] = translate(seq[i:i+fragment_length], genetic_code)
        fragment_length = 3 * ((length-i) // 3)
        frames[i+1] = translate(seq[i:i+fragment_length], genetic_code)
        frames[-(i+1)] = translate(anti[i:i+fragment_length], genetic_code)[::-1]
 
    # create header

src/b/i/biopython-1.63/Bio/SeqUtils/__init__.py   biopython(Download)
 
    """
    from Bio.Seq import reverse_complement, translate
    anti = reverse_complement(seq)
    comp = anti[::-1]
    length = len(seq)
    frames = {}
    for i in range(0, 3):
        fragment_length = 3 * ((length-i) // 3)
        frames[i+1] = translate(seq[i:i+fragment_length], genetic_code)
        fragment_length = 3 * ((length-i) // 3)
        frames[i+1] = translate(seq[i:i+fragment_length], genetic_code)
        frames[-(i+1)] = translate(anti[i:i+fragment_length], genetic_code)[::-1]
 
    # create header

src/m/i/misc-genomics-tools-HEAD/mauve_xmfa_indexer/SeqUtils.py   misc-genomics-tools(Download)
from Bio.Seq import Seq, reverse_complement, translate
from Bio.SeqRecord import SeqRecord
from Bio import SeqIO
from Bio.Data import CodonTable
from Bio.Alphabet import IUPAC
        protein['sequence'] = feature.qualifiers['translation'].pop(0)
    else:
        protein['sequence'] = translate(get_seq_0_based(record.seq.data, feature.location.nofuzzy_start, feature.location.nofuzzy_end, feature.strand))
    if not len(protein['sequence']):
        print >>sys.stderr, "could not translate %s" % (protein['identifier'])
def translate_proteins(record):
    seqs = []
    for feature in record.features:
        seq = Seq(translate(get_seq_0_based(record.seq.data, feature.location.nofuzzy_start, feature.location.nofuzzy_end, feature.strand)), IUPAC.IUPACProtein)
        seqs.append(SeqRecord(seq, id=identifier(flatten(feature.qualifiers)), description=mygetattr(feature.qualifiers, 'product', '')))

src/b/i/bioext-0.9.5/lib/BioExt/_util.py   bioext(Download)
from scipy.stats import norm
 
from Bio.Seq import Seq, translate as _translate
from Bio.SeqRecord import SeqRecord
 
            for c in 'ACGT':
                cdn = a + b + c
                aa = _translate(cdn)
                if aa not in d:
                    d[aa] = []
        return seq.translate()
    elif isinstance(seq, str):
        return _translate(seq)
    else:
        raise ValueError('can only translate sequences of type SeqRecord, Seq, or str')
            else:
                nucs.append(nuc)
        aminos.append(set(_translate(''.join(p)) for p in product(*nucs)))
 
    return AmbigList(aminos)

src/h/y/hy454-0.4.4/lib/hy454/_divestimator.py   hy454(Download)
from textwrap import dedent
 
from Bio.Seq import translate
from Bio.Alphabet import generic_nucleotide
 
        amino_bins = Counter()
        for cdn, c in nuc_bins.items():
            amino_bins[translate(cdn)] += c
 
        numvariants = sum(nuc_bins.values())

src/b/i/biopython-1.63/Tests/test_seq.py   biopython(Download)
    nucleotide_seq = nucleotide_seq[:3 * (len(nucleotide_seq) // 3)]
    try:
        expected = Seq.translate(nucleotide_seq)
        print("%s\n-> %s" % (repr(nucleotide_seq), repr(expected)))
    except (ValueError, TranslationError) as e:
    #Now check translate(..., to_stop=True)
    try:
        short = Seq.translate(nucleotide_seq, to_stop=True)
    except (ValueError, TranslationError) as e:
        short = None
for s in protein_seqs:
    try:
        print(Seq.translate(s))
        assert False, "Translation shouldn't work on a protein!"
    except ValueError:
                       Seq.Seq(misc_stops, Alphabet.DNAAlphabet()),
                       Seq.Seq(misc_stops, IUPAC.unambiguous_dna)]:
    assert "***RR" == str(Seq.translate(nucleotide_seq))
    assert "***RR" == str(Seq.translate(nucleotide_seq, table=1))
    assert "***RR" == str(Seq.translate(nucleotide_seq, table="SGC0"))

src/b/i/biopython-HEAD/Tests/test_seq.py   biopython(Download)
    nucleotide_seq = nucleotide_seq[:3 * (len(nucleotide_seq) // 3)]
    try:
        expected = Seq.translate(nucleotide_seq)
        print("%s\n-> %s" % (repr(nucleotide_seq), repr(expected)))
    except (ValueError, TranslationError) as e:
    #Now check translate(..., to_stop=True)
    try:
        short = Seq.translate(nucleotide_seq, to_stop=True)
    except (ValueError, TranslationError) as e:
        short = None
for s in protein_seqs:
    try:
        print(Seq.translate(s))
        assert False, "Translation shouldn't work on a protein!"
    except ValueError:
                       Seq.Seq(misc_stops, Alphabet.DNAAlphabet()),
                       Seq.Seq(misc_stops, IUPAC.unambiguous_dna)]:
    assert "***RR" == str(Seq.translate(nucleotide_seq))
    assert "***RR" == str(Seq.translate(nucleotide_seq, table=1))
    assert "***RR" == str(Seq.translate(nucleotide_seq, table="SGC0"))

src/b/i/biopython-1.63/Scripts/SeqGui/SeqGui.py   biopython(Download)
from __future__ import print_function
 
from Bio.Seq import translate, transcribe, back_transcribe
import wx
 

  1 | 2  Next