I have a big
fasta.dataset file containing half a million proteins (1.0 GB). I have four lines for each protein code:
- line 1:the protein code
- line 2: protein length in amino acids
- line 3: amino acid sequence
- line 4: secondary structure
Now, I am trying to open and read it in python (Biopython), and it does not work:
filename = 'pdb.fasta_qual.dataset' sequences = SeqIO.parse ( filename,'fasta') for record in sequences: example = record break print(example)
How can I read it in python and loop through the file to look at line 3 for each protein to count the sequence length and distribution?
here is the first 5 lines of my file: which my file contains 500,000 proteins for each one has a 4 lines (name ,len of protein in amino acid,the seq represents by letters which what I would to calculate,the secondary structure)
4LGTD 247 M S E K L Q K V L A R A G H G T . . E E H H H H H H H T T S S .
I want to open and read the file and loop through line 3 for each protein to calculate the length of the sequences and plot a histogram ! to check the distribution. ,,,
The output i am expecting is :
The len for the first seq is =
The len for the second seq is =
the len of the last sequence which is number (500.000)=
And then i can plot a histogram for the len of the sequences ,,,
NOTE: I have opened and read the file's info by Linux, but I could not by python.