[Biopython-dev] 5/18 biopython Questions - BioStar

Feed My Inbox updates at feedmyinbox.com
Wed May 18 10:54:24 UTC 2011


// Converting GenBank  to FASTA in protein form
// May 18, 2011 at 12:31 AM

http://biostar.stackexchange.com/questions/8377/converting-genbank-to-fasta-in-protein-form
So i have a sequence that is a .gb file. What I want to do is parse and change the format of the file. I've figured out how to parse it to FASTA format, although the sequence that is in the FASTA format is nucleic and i want it to be PROTEIN.

kind of stuck here...

any ideas?

import Bio
from Bio import SeqUtils
from Bio import Seq
from Bio import SeqIO

handle = 'sequence.gb' 
output = 'sequence.fasta'
data = Bio.SeqIO.parse(handle, 'gb')

fh = open(output, 'w')

for record in data:
    convert = Bio.SeqIO.write(record, output, 'fasta')
    dna = record.seq
    mrna = dna.transcribe()
    protein = mrna.translate()


// Extracting data from classes in Python
// May 17, 2011 at 2:31 PM

http://biostar.stackexchange.com/questions/8371/extracting-data-from-classes-in-python
How can I extract data from a class in Python?

>>>Bio.Alphabet.RNAAlphabet  
<class Bio.Alphabet.RNAAlphabet at 0x01EBF420>


How can I extract, say for example, the letters of that Alphabet from that object in Byophthon?


// Working with Alphabet Soup
// May 17, 2011 at 1:23 PM

http://biostar.stackexchange.com/questions/8370/working-with-alphabet-soup
Biopython noob here, I'm trying to create a program that uses the Biopython package Alphabet and alphabet module IUPAC to write out the letters of the classes listed to a file called alphabetSoupOuput.txt.

ThreeLetterProtein
IUPACProtein
unambiguous_dna
ambiguous_dna
ExtendedIUPACProtein
ExtendedIUPACDNA
Each group of letters should be written to its single line in the output file and the letters should be separated by commas. The line before each group of letters should contain a label that describes the letters and has a # in the first position of that line, e.g.

Three Letter Protein
Ala, Asx, Cys, ..., Glx

Protein Letters
A, C, D, E, ..., Y  

How can I do this?


--
Website: http://biostar.stackexchange.com/questions/tagged/biopython

Account Login: 
https://www.feedmyinbox.com/members/login/?utm_source=fmi&utm_medium=email&utm_campaign=feed-email

Unsubscribe here: 
http://www.feedmyinbox.com/feeds/unsubscribe/687953/851dd4cd10a2537cf271a85dfd1566976527e0cd/?utm_source=fmi&utm_medium=email&utm_campaign=feed-email

--
This email was carefully delivered by FeedMyInbox.com. 
PO Box 682532 Franklin, TN 37068




More information about the Biopython-dev mailing list