Biopython Protparam
2
0
Entering edit mode
11.0 years ago
arronslacey ▴ 320

Hi - I have a fasta file with proteins that I wish to do some simple protein analysis on using the ProtParam package using the following:

from Bio import SeqIO
from Bio.SeqUtils import ProtParam

handle = open("examplefasta.fasta") 
for record in SeqIO.parse(handle, "fasta"): 
    seq = str(record.seq)
    X = ProtParam.ProteinAnalysis(seq)
    print X.count_amino_acids() 
    print X.get_amino_acids_percent() 
    print X.molecular_weight() 
    print X.aromaticity() 
    print X.instability_index() 
    print X.flexibility() 
    print X.isoelectric_point() 
    print X.secondary_structure_fraction()

however I am getting the following error:

from: can't read /var/mail/Bio
from: can't read /var/mail/Bio.SeqUtils
./protanalysis.py: line 4: syntax error near unexpected token `('
./protanalysis.py: line 4: `handle = open("examplefasta.fasta") '

I don't really understand why the program is looking in /var/mail/ . Using Linux by the way. anyone else come across this problem?

Thanks,

Arron.

protein analysis • 3.1k views
ADD COMMENT
0
Entering edit mode

in general always include the full traceback not just a small part of it

ADD REPLY
2
Entering edit mode
11.0 years ago
arronslacey ▴ 320

I wasn't calling python to run the program. that's the answer.

ADD COMMENT
1
Entering edit mode

You could add a hash-bang line, but I'm guessing without it the fact it started with "from" made the OS guess it was a email file? e.g.

#!/usr/bin/env python
ADD REPLY
0
Entering edit mode
11.0 years ago
arronslacey ▴ 320

I've also realised this problem isn't related to Biopython. I must have set some erroneous paths somewhere.

ADD COMMENT
0
Entering edit mode

Were you able to solve it? I am also facing the same problem now

ADD REPLY

Login before adding your answer.

Traffic: 2072 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6