insilichem / pychimera

Use UCSF Chimera Python API in a standard interpreter
http://pychimera.readthedocs.io
GNU Lesser General Public License v3.0
57 stars 10 forks source link

PyChimera executable consumes all CLI args #9

Closed jaimergp closed 6 years ago

jaimergp commented 6 years ago

If a user runs a custom script with its own CLI arguments pychimera ~/path/to/myscript.py -h, pychimera will greedily consume the full argument list, when it should only execute the script and pass the rest of the args along.

The fix probably has to do with argparse (here).

Originally reported by @jrjhealey

jaimergp commented 6 years ago

Hi @jrjhealey! Last commit should solve this issue. Can you check on that, please? As soon I have your confirmation, I will bump up the version.

jrjhealey commented 6 years ago

Sure, I'll take a look!

Is it committed directly to the master branch?

jaimergp commented 6 years ago

Yes, it is on master :)

jrjhealey commented 6 years ago

Yep, looks like that's fixed it! (Ignore the Chimera message, I haven't figured out how to shut it up yet ;) )

wms_joe@Esau:~/bin/pychimera$ ./scripts/pychimera ~/bin/bioinfo-tools/strucfit.py --help
You have used an unregistered copy of Chimera for 29 days.
You can either register now by visiting:
   http://www.cgl.ucsf.edu/cgi-bin/chimera_registration.py
or by choosing 'Registration...' from the 'Help' menu next
time you start Chimera with the gui enabled.

Registration is free.  By providing the information requested
you will be helping us document the impact this software is
having in the scientific community. The information you supply
will only be used for reporting summary statistics to NIH.
usage: strucfit.py [-h] [-d DATABASE] [-f FASTA] [-s SIMULATIONS] [-r RMSD]
                   [-t THREADS] [-o OUTDIR]

This script compares protein structural homologs as determined with HHpred, to
PDB models using UCSF CHIMERA, to gather metrics of structural similarity.

optional arguments:
  -h, --help            show this help message and exit
  -d DATABASE, --database DATABASE
                        You can specify a different HHpred database (filepath)
                        to use if you offer this parameter. Otherwise it
                        defaults to PDB.
  -f FASTA, --fasta FASTA
                        The fasta amino acid sequence that corresponds to the
                        simulated structure and the sequence you wish to
                        query.
  -s SIMULATIONS, --simulations SIMULATIONS
                        The directory where the protein structure simulations
                        are stored. They must be in PDB format and be named
                        logically.
  -r RMSD, --rmsd RMSD  The filename to store the RMSD values for each
                        matching.
  -t THREADS, --threads THREADS
                        The number of threads that HHsearch can execute on.
  -o OUTDIR, --outdir OUTDIR
                        Directory for files to be written to. Default is the
                        current working directory.
An exception occured with argument parsing. Check your provided options.
jaimergp commented 6 years ago

Perfect! Will close this one then.