Question: Working With Alphabet Soup
1
gravatar for Francis
2.9 years ago by
Francis50
Francis50 wrote:

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

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?

ADD COMMENTlink modified 4 weeks ago by Biostar ♦♦ 0 • written 2.9 years ago by Francis50

lul. a hint at least? how exactly do I call the 'letters' from each class?

ADD REPLYlink written 2.9 years ago by Francis50

Can you clarify the question? Perhaps with a small example: What is the input? What is the desired output?

ADD REPLYlink written 2.9 years ago by brentp17k

Im trying to use the Alphabet package and IUPAC module to write out the letters of each class. Im not sure how to call the letters?

ADD REPLYlink written 2.9 years ago by Francis50
4
gravatar for Istvan Albert
2.9 years ago by
Istvan Albert ♦♦ 39k
University Park, USA
Istvan Albert ♦♦ 39k wrote:

The data that you are looking for are stored as attributes of the various modules:

http://biopython.org/DIST/docs/api/Bio.Alphabet.IUPAC-module.html

or:

http://biopython.org/DIST/docs/api/Bio.Alphabet.ThreeLetterProtein-class.html

All you need is to access that attribute string or list and print out what you need like so:

from Bio.Alphabet import ThreeLetterProtein

print ",".join(ThreeLetterProtein.letters)

will produce:

Ala,Asx,Cys,Asp,Glu,Phe,Gly,His,Ile,Lys,Leu,Met,Asn,Pro,Gln,Arg,Ser,Thr,Sec,Val,Trp,Xaa,Tyr,Glx
ADD COMMENTlink written 2.9 years ago by Istvan Albert ♦♦ 39k
Please log in to add an answer.

Help
Access
  • RSS
  • Stats
  • API

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.0.0
Traffic: 690 users visited in the last hour