pierrepo / PBxplore

A suite of tools to explore protein structures with Protein Blocks :snake:
https://pbxplore.readthedocs.org/en/latest/
MIT License
28 stars 17 forks source link

The `--first-issue` option of `PBcount` only accept values greater or equal to 1 #47

Closed jbarnoud closed 9 years ago

jbarnoud commented 9 years ago

The --first-issue option of PBcount only accept values greater or equal to 1. Using a negative value raises an error:

../PBcount.py -f count_multi1.PB.fasta -o count_multi1_first-20 --first-residue -20
usage: PBcount.py [-h] -f F -o O [--first-residue FIRST_RESIDUE]
PBcount.py: error: first residue must be >= 1

This error is due to a test in PBcount.py (around line 64 to 67 in the current version):

#-------------------------------------------------------------------------------
# check options
#-------------------------------------------------------------------------------
if options.first_residue and options.first_residue < 1:
    parser.error("first residue must be >= 1")

The --first-residue option aims to shift the residue numbering from the PB sequence to synchronise the numbering of the count file with the PDB. While most PDB numbering start at 1 or should so, some start with negative values. These negative values happen when the residue numbering of a protein tries to correspond to the numbering of a homologous one.

Should PBcount really prevent the user from using negative values for --first-residue?