本文整理汇总了Python中Bio.Seq.transcribe方法的典型用法代码示例。如果您正苦于以下问题:Python Seq.transcribe方法的具体用法?Python Seq.transcribe怎么用?Python Seq.transcribe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bio.Seq
的用法示例。
在下文中一共展示了Seq.transcribe方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_transcription_of_proteins
# 需要导入模块: from Bio import Seq [as 别名]
# 或者: from Bio.Seq import transcribe [as 别名]
def test_transcription_of_proteins(self):
"""Test transcription shouldn't work on a protein!"""
for s in protein_seqs:
with self.assertRaises(ValueError):
Seq.transcribe(s)
if isinstance(s, Seq.Seq):
with self.assertRaises(ValueError):
s.transcribe()
示例2: dna_aa
# 需要导入模块: from Bio import Seq [as 别名]
# 或者: from Bio.Seq import transcribe [as 别名]
def dna_aa():
if session.username == None:
redirect(URL(r=request, c='account', f='log_in'))
form = FORM(TABLE(TR('Sequence (raw format): ',
TEXTAREA(_type='text', _name='sequence',
requires=IS_NOT_EMPTY())),
#TR("Sequence Type: ",
# SELECT("Raw Format", "FASTA",
# _name="seq_type")),
TR('Action: ',
SELECT('Complementation', 'Transcribe', 'Translate',
'Back Transcribe', 'Back Translate',
_name='action'),
INPUT(_type='submit', _value='SUBMIT'))))
if form.accepts(request.vars,session):
#if form.vars.seq_type == "FASTA":
# session['sequence'] = \
# seqClean(fasta_to_raw(form.vars.sequence.upper()))
#else:
session['sequence'] = seqClean(form.vars.sequence.upper())
if form.vars.action == "Complementation":
session['action'] = "Complementation"
session['Complement'] = Seq.reverse_complement(session['sequence'])
if form.vars.action == "Transcribe":
session['action'] = 'Transcribe'
session['Transcribed RNA'] = Seq.transcribe(session['sequence'])
if form.vars.action == "Back Transcribe":
session['action'] = 'Back Transcribe'
session['DNA'] = Seq.back_transcribe(session['sequence'])
if form.vars.action == "Translate":
session['action'] = 'Translate'
session.update(translate(session['sequence']))
if form.vars.action == "Back Translate":
session['action'] = 'Back Translate'
session.update(back_translate(session['sequence']))
redirect(URL(r=request, f='dna_aa_output'))
return dict(form=form)
示例3: alphabets
# 需要导入模块: from Bio import Seq [as 别名]
# 或者: from Bio.Seq import transcribe [as 别名]
#Sanity test on the test sequence alphabets (see also enhancement bug 2597)
for nucleotide_seq in test_seqs :
if hasattr(nucleotide_seq, "alphabet") :
if "U" in str(nucleotide_seq).upper() :
assert not isinstance(nucleotide_seq.alphabet, Alphabet.DNAAlphabet)
if "T" in str(nucleotide_seq).upper() :
assert not isinstance(nucleotide_seq.alphabet, Alphabet.RNAAlphabet)
print
print "Transcribe DNA into RNA"
print "======================="
for nucleotide_seq in test_seqs:
try :
expected = Seq.transcribe(nucleotide_seq)
assert str(nucleotide_seq).replace("t","u").replace("T","U") == str(expected)
print "%s -> %s" \
% (repr(nucleotide_seq) , repr(expected))
except ValueError, e :
expected = None
print "%s -> %s" \
% (repr(nucleotide_seq) , str(e))
#Now test the Seq object's method
if isinstance(nucleotide_seq, Seq.Seq) :
try :
assert repr(expected) == repr(nucleotide_seq.transcribe())
except ValueError :
assert expected is None
for s in protein_seqs :
示例4: test_seq_object_transcription_method
# 需要导入模块: from Bio import Seq [as 别名]
# 或者: from Bio.Seq import transcribe [as 别名]
def test_seq_object_transcription_method(self):
for nucleotide_seq in test_seqs:
if isinstance(nucleotide_seq.alphabet, Alphabet.DNAAlphabet) and \
isinstance(nucleotide_seq, Seq.Seq):
self.assertEqual(repr(Seq.transcribe(nucleotide_seq)),
repr(nucleotide_seq.transcribe()))
示例5: test_transcription_dna_string_into_rna
# 需要导入模块: from Bio import Seq [as 别名]
# 或者: from Bio.Seq import transcribe [as 别名]
def test_transcription_dna_string_into_rna(self):
seq = "ATGAAACTG"
self.assertEqual("AUGAAACUG", Seq.transcribe(seq))
示例6: test_transcription_dna_into_rna
# 需要导入模块: from Bio import Seq [as 别名]
# 或者: from Bio.Seq import transcribe [as 别名]
def test_transcription_dna_into_rna(self):
for nucleotide_seq in test_seqs:
if isinstance(nucleotide_seq.alphabet, Alphabet.DNAAlphabet):
expected = Seq.transcribe(nucleotide_seq)
self.assertEqual(str(nucleotide_seq).replace("t", "u").replace("T", "U"),
str(expected))