arq5x / lumpy-sv

lumpy: a general probabilistic framework for structural variant discovery
MIT License
309 stars 118 forks source link

Lumpy Express Issue #256

Open ramayyala opened 6 years ago

ramayyala commented 6 years ago

I keep getting this error when trying to run lumpy express what i ran: ./lumpyexpress -B /u/scratch/r/ramayyal/reference_genome/testdata/A_J.chr19.1.25p_sorted.bam what i get: Sourcing executables from ./lumpyexpress.config ...

Checking for required python modules (/u/local/apps/python/3.6.1/bin/python3.6)... ./lumpyexpress: line 15: -n: command not found ./lumpyexpress: line 16: [: ==: unary operator expected File "/u/home/r/ramayyal/Tools/lumpy//scripts/bamkit/bamlibs.py", line 61 print ','.join(lib_rg[lib]) ^ SyntaxError: invalid syntax

I am at a loss of what to do. Thanks in advance!

ryanlayer commented 6 years ago

Looks like you do not have the program "hexdump" and you are using python 3

On Mon, Jul 16, 2018 at 8:16 PM ramayyala notifications@github.com wrote:

I keep getting this error when trying to run lumpy express what i ran: ./lumpyexpress -B /u/scratch/r/ramayyal/reference_genome/testdata/A_J.chr19.1.25p_sorted.bam what i get: Sourcing executables from ./lumpyexpress.config ...

Checking for required python modules (/u/local/apps/python/3.6.1/bin/python3.6)... ./lumpyexpress: line 15: -n: command not found ./lumpyexpress: line 16: [: ==: unary operator expected File "/u/home/r/ramayyal/Tools/lumpy//scripts/bamkit/bamlibs.py", line 61 print ','.join(lib_rg[lib]) ^ SyntaxError: invalid syntax

I am at a loss of what to do. Thanks in advance!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/arq5x/lumpy-sv/issues/256, or mute the thread https://github.com/notifications/unsubscribe-auth/AAlDUXKembVx4E8nY9ftG-h0BoB2puQqks5uHUkJgaJpZM4VSEt8 .

chenatf commented 6 years ago

I have the same problem, My system is ubuntu 16.04, and I sure I use the python2 and have the hexdump. I install the lumpy-sv with the conda. I get the message:

./lumpyexpress: line 15: -n: command not found
./lumpyexpress: line 16: [: ==: unary operator expected

Then I look the lumpyexpress , the code in line 15 check the input is cram or not. The code in line 29 check the input is bam or not, but It do not throw error. Therefore, I can not find the solution.

ramayyala commented 6 years ago

I got mine working. Make sure hexdump is installed with the command "which hexdump" just to be sure. Should be in your usr/bin pathway so its accessible to everything on your system. I just installed it with pip install hexdump and then make sure you have numpy and pysam installed in your version of python2.

chenatf commented 6 years ago

Yes, I have the numpy and pysam installed in my version of python2 and the 'which hexdump' get /usr/bin/hexdump.

FriederikeHanssen commented 5 years ago

Did you ever get it too run? I have the same issue after installing it with conda

Alex-Nesta commented 5 years ago

same issue here also.

Anaconda 4.2.0 Python 2.7.14 venv hexdump in /usr/bin/hexdump did conda install numpy and pysam... and both were already installed

./lumpyexpress: line 15: -n: command not found ./lumpyexpress: line 16: [: ==: unary operator expected

davisem commented 5 years ago

Has anyone resolved this issue? I see the same error. I too have hexdump.

Alex-Nesta commented 5 years ago

The only way I was able to get lumpy to run at all and avoid this error was the following:

use bamaddrg and make sure you have readgroups added to your bams. make sure bams are sorted and indexed. generate splitters and discordants using samtools. Make sure they are sorted (again)

Then I ran lumpy express with the following command:

       lumpyexpress \
       -B ${YOURBAM}.bam \
       -S ${YOURBAM}.splitters.sorted.bam \
       -D ${YOURBAM}.discordants.sorted.bam \
       -o ${YOURBAM}.vcf

Here is my full script if you want to see all the steps I did. Warning, it's ugly and not commented.


islet_dir="XXXX/data/"
genome="XXXX/reference/hg19/hg19.fa"
out_dir="XXXX/lumpy/out"

for bam_file in ${islet_dir}/*.bam ; do
       echo "print current:$bam_file";
       echo "adding read groups to original bam..."
       echo ${bam_file}        
       filename=${bam_file%.bam}
       bamaddrg -b ${bam_file} > ${out_dir}/${filename##*/}.rg.bam 
done

for bam_file in ${out_dir}/*.rg.bam ; do
       echo "getting discordants and splitters"
       echo ${bam_file}
       filename=${bam_file%.bam}
       samtools view -b -F 1294 ${bam_file} > ${out_dir}/${filename##*/}.discordants.bam
       samtools view -h ${bam_file} | extractSplitReads_BwaMem -i stdin | samtools view -Sb - > {out_dir}/${filename##*/}.splitters.bam
       samtools sort ${out_dir}/${filename##*/}.splitters.bam -o ${out_dir}/${filename##*/}.splitters.sorted.bam
       samtools sort ${out_dir}/${filename##*/}.discordants.bam -o ${out_dir}/${filename##*/}.discordants.sorted.bam
       samtools sort ${bam_file} -o ${out_dir}/${filename##*/}.sorted.bam
done

for bam_file in ${out_dir}/*rg.bam ; do
        echo "Starting lumpy..." ;
        echo "working on $bam_file" ;   
        filename=${bam_file%.bam}
        echo $filename

        samtools index ${out_dir}/${filename##*/}.bam

       echo ${out_dir}/${filename##*/}.bam 
       echo ${out_dir}/${filename##*/}.splitters.sorted.bam 
       echo ${out_dir}/${filename##*/}.discordants.sorted.bam 
        echo ${out_dir}/${filename##*/}.vcf

       lumpyexpress -P \
       -B ${out_dir}/${filename##*/}.bam \
       -S ${out_dir}/${filename##*/}.splitters.sorted.bam \
       -D ${out_dir}/${filename##*/}.discordants.sorted.bam \
       -o ${out_dir}/${filename##*/}.vcf

        svtyper \
        -B ${out_dir}/${filename##*/}.bam \
        -S ${out_dir}/${filename##*/}.splitters.sorted.bam \
        -i ${out_dir}/${filename##*/}.vcf > ${out_dir}/${filename##*/}.gt.vcf

done

echo "Program complete!"
davisem commented 5 years ago

Actually, I was able to resolve this issue by rebuilding with python 2.7.5.

Alex-Nesta commented 5 years ago

Nice, I'll give that a try next time. Should save a lot of effort.