Question: Parsing A Uniprot Flat File
1
gravatar for Deepu
3.2 years ago by
Deepu10
Deepu10 wrote:

Can anybody please let me know or help with parsing a uniprot flat file and access the information in the annotation (FT) line and produce an output file in python script. FT line is the one in a general uniprot flat file describing the nature of the proteins. Script written to this must produce an output file with the information in this line.

ADD COMMENTlink modified 3.2 years ago by Chris1.5k • written 3.2 years ago by Deepu10

homework ? what did you try so far ?

ADD REPLYlink written 3.2 years ago by Pierre Lindenbaum58k

Can you use Biopython?

ADD REPLYlink written 3.2 years ago by Jarretinha2.9k

I think we can use biopython. Its not homework but part of project.

ADD REPLYlink written 3.2 years ago by Deepu10

Please don't forget to accept one of the answers below, the problem appears to be solved.

ADD REPLYlink written 3.2 years ago by Michael Schubert5.9k
8
gravatar for Chris
3.2 years ago by
Chris1.5k
Munich
Chris1.5k wrote:

With BioPython, the task to access the featue information is very simple:

from Bio import SwissProt
for record in SwissProt.parse(open('/path/to/your/uniprot_sprot.dat')):
  for feature in record.features:
    print feature

How to save that into a file is also very simple.

Chris

ADD COMMENTlink written 3.2 years ago by Chris1.5k
7
gravatar for Neilfws
3.2 years ago by
Neilfws41k
Sydney, Australia
Neilfws41k wrote:

If you can use BioPython, see Chapter 9: Swiss-Prot and ExPASy in the tutorial.

Alternative quick and dirty approach:

grep ^FT myfile.dat

Although that will not deal well with feature descriptions that span several lines.

ADD COMMENTlink written 3.2 years ago by Neilfws41k
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: 619 users visited in the last hour