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.
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.
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.