This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Platypus variant caller error

Dear all,

I am trying to run Platypus variant caller but it continues to give me the following error:

print "\n\n%s command is not yet implemented\n\n" %(x) ^ SyntaxError: invalid syntax

Could you, please, suggest is there a way to solve this?

snp variant calling

Hi, Seems like you are passing an argument to Platypus which it is unable to execute/ implement. If you can post the run set-up, then a better guess can be taken. The error message alone is not enough.

Thanks for the reply. This is the Platypus.py code. Could it be useful?

#!/usr/bin/env python

"""
Top-level interface to the Platypus tool-set
"""
from __future__ import division

import sys
import runner

###################################################################################################

def notImplemented(x):
    """
    Print an error message and raise an exception for commands that are not yet
    implemented.
    """
    print "\n\n%s command is not yet implemented\n\n" %(x)
    sys.exit(0)

###################################################################################################

if __name__ == "__main__":

    possCommands = {}
    possCommands["callVariants"] = runner.callVariants
    possCommands["continueCalling"] = runner.continueCalling

    if len(sys.argv) == 1 or sys.argv[1] not in possCommands.keys():
        print "\n\n"
        print "Invalid usage: use Platypus as follows:"
        print "\n"
        for k in possCommands.keys():
            print "python Platypus.py", k, "[Options]"
        print "\n"
        print "For a list of possible options for a specific command, type 'python Platypus.py Command -h'"
        print "\n"
        sys.exit(0)
    if sys.version_info[0] != 2 or sys.version_info[1] < 6:
        print "\n\n"
        print "Platypus works only with Python versions 2.6 and greater. Python 3.X is not yet supported."
        print "\n\n"
        sys.exit(0)
    else:
        command = sys.argv[1]
        possCommands[command](sys.argv[2:])

I am running it as python Platypus.py

Hi, I am sorry, no clue with the setup you are using for Platypus. I had followed the instructions here and was able to run it successfully (ver. 0.8.1).

After installation as specified, I used this setup -

##
## HTSLib path needed
export C_INCLUDE_PATH=/software/packages/htslib/1.4/include
export LIBRARY_PATH=/software/packages/htslib/1.4/lib
export LD_LIBRARY_PATH=/software/packages/htslib/1.4/lib

###
### Python 2.7.15 via module load
python \
/path/to/Platypus_0.8.1/Platypus.py \
callVariants \
--nCPU=4 \
--bamFiles=\
/path/to/Samp1.bam,\
/path/to/Samp2.bam \
--regions=/path/to/Capture_targets.txt \
--refFile=/path/to/human_g1k_v37.fasta \
--output=Platy_varCalls.vcf

The capture regions if provided, are to be in this format -

9:21970899-21971206
17:7577499-7577608

btw, the python code snippet you posted above, seems to be the Platypus.py file under src/python directory of the Platypus-master.zip file downloadable from the Github repo. If so, that is not the way to run Platypus. Please follow the instructions on the Github page. Btw, I realise that now this is available via Conda, which would be much easier way to go by.

Hi Amitm, thanks! I was albe to run it with Python2 as well now. It is not working eith python 3 and give me the error above.... also i could be able to download with conda but only with python2...

0 answers

No answers yet.

Log in to answer this question.