[Biopython] Shell permission denied

Peter Cock p.j.a.cock at googlemail.com
Tue Jul 30 12:15:37 UTC 2013


On Tue, Jul 30, 2013 at 1:04 PM, Abel Valenzuela García
<avalgar at hotmail.com> wrote:
> Dear all,
>
>
> I'm using Python 2.7.3 under Ubuntu 12.04 (precise pangolin). My best guess is that this has to do with the linux system, or its relationship with Python; it's very unlikely that the code is faulty.
>
> At some point of my script execution, there is a system call to run a program from the linux shell that looks like this:
>
> os.system("%s %s > %s" % (DSSP, in_file, out_file.name))
>  This should basically run the command line
>
> DSSP in_file > out_file
>
> Here is the source code
>
>
>
> The ERROR message I get (excerpt from my session):
>
> In [8]: p = PDBParser()
> In [9]: structure = p.get_structure("4E4Z", "4E4Z.pdb")
> In [10]: model = structure[0]
> In [11]: dssp = DSSP(model, "4E4Z.pdb")
> sh: 1: dssp: Permission denied
>
> I followed the class documentation for that example, have
>  a sane pdb file, a dssp package that works nicely and produces correct
> output from the command line, all permissions to execute, and I'm the only user.
>
>
> Any ideas why this might not be working?
>
>
> Thank you very much for you patience and help!
>
>
> Abel Valenzuela

Hi Abel,

In this kind of situation the first thing I do is work out what
the command line that Python is trying to run is (maybe
you can add some print statements to the DSSP code?),
and then try to run that exact same command by hand
at the terminal.

Another thing to watch out for is spaces in filenames -
the can be dealt with using quotes or escaping, but
sometimes this defensive coding hasn't been done.

Perhaps we need some more unit tests for this part
of Biopython?

Peter




More information about the Biopython mailing list