[Biopython-dev] 5/18 active questions tagged biopython - Stack Overflow

Feed My Inbox updates at feedmyinbox.com
Wed May 18 05:06:16 UTC 2011


// Writing out a list of strings to a file
// May 17, 2011 at 3:14 PM

http://stackoverflow.com/questions/6035904/writing-out-a-list-of-strings-to-a-file
I have a list of abbreviations  

Letters = ['Ala', 'Asx', 'Cys', ... 'Glx']

I want to output this to a text file that will look this like:

#Letters
Ala, Asx, Cys, ..... Glx

Noob programmer here! I always forget the simplest things! ah

please help and thanks!

import Bio
from Bio import Seq
from Bio.Seq import Alphabet

output = 'alphabetSoupOutput.txt'
fh = open(output, 'w')
ThreeLetterProtein = '#Three Letter Protein'
Letters = Bio.Alphabet.ThreeLetterProtein.letters
fh.write(ThreeLetterProtein + '\n')

  #Don't know what goes here

fh.close()


// BioPython Alphabet Soup
// May 17, 2011 at 2:28 AM

http://stackoverflow.com/questions/6027064/biopython-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://stackoverflow.com/questions/tagged/?tagnames=biopython&sort=active

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/630208/9a33fac9c8e89861715f609a2333362c8425e495/?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