In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to use biopython to translate cds sequence into protein sequence". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let the editor take you to learn "how to use biopython to translate cds sequences into protein sequences".
The cds sequence is translated into a protein sequence. Due to the differences in codons of different species or special organelles (mitochondria, etc.), we cannot translate casually by default. The biopython here can use different codons for protein translation according to our needs. Codons are as follows:
1. Ordinary codon translation, rna translation into protein
> from Bio.Seq import Seq > from Bio.Alphabet import IUPAC > messenger_rna = Seq ("AUGGCCAUUGUAAUGGGCCGCUGAAAGGGUGCCCGAUAG", IUPAC.unambiguous_rna) > messenger_rnaSeq ('AUGGCCAUUGUAAUGGGCCGCUGAAAGGGUGCCCGAUAG', IUPACUnambiguousRNA ()) > messenger_rna.translate () Seq (' MAIVMGR*KGAR*', HasStopCodon (IUPACProtein (),'*'))
2. Translation of cds sequence into protein sequence
> from Bio.Seq import Seq > from Bio.Alphabet import IUPAC > coding_dna = Seq ("ATGGCCATTGTAATGGGCCGCTGAAAGGGTGCCCGATAG", IUPAC.unambiguous_dna) > coding_dnaSeq ('ATGGCCATTGTAATGGGCCGCTGAAAGGGTGCCCGATAG', IUPACUnambiguousDNA ()) > coding_dna.translate () Seq (' MAIVMGR*KGAR*', HasStopCodon (IUPACProtein (),'*'))
3. Specify codon translation into protein sequence
> > coding_dna.translate (table= "Vertebrate Mitochondrial") Seq ('MAIVMGRWKGAR*', HasStopCodon (IUPACProtein (),' *'))
Or use serial numbers.
> coding_dna.translate (table=2) Seq ('MAIVMGRWKGAR*', HasStopCodon (IUPACProtein (),' *'))
Run the sample code in batches:
From Bio.Seq import Seqfrom Bio import SeqIOfrom Bio.Alphabet import IUPACfrom Bio.SeqRecord import SeqRecordimport sys, os, argparse, os.path,re,math,timeparser = argparse.ArgumentParser (description='This script is used to translate cds to pep') # parser.add_argument Help='Please input complete out_put directory path',default = os.getcwd (), required=False) parser.add_argument Pep') # args = parser.parse_args () dout=''if os.path.exists (args.out_dir): dout=os.path.abspath (args.out) _ dir) else: os.mkdir (args.out_dir) dout=os.path.abspath (args.out_dir) output_handle = open (dout+'/'+args.name+'.fa' "w") for rec in SeqIO.parse (args.fasta, "fasta"): rec.seq=rec.seq.translate (table=args.table) SeqIO.write (rec, output_handle, "fasta") output_handle.close () here I believe you have a deeper understanding of "how to use biopython to translate cds sequences into protein sequences". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.