hap.py icon indicating copy to clipboard operation
hap.py copied to clipboard

How to run Singularity

Open moldach opened this issue 4 years ago • 6 comments

I'm using an academic HPC so the use of docker is not allowed due to security concerns.

I would like to know how I can run hap.py using singularity:

I'm following the [deepvariant] tutorial and have tried the following without luck.

singularity pull docker://pkrusche/hap.py

singularity run -it \
  -v "${INPUT_DIR}":"/input" \
  -v "${OUTPUT_DIR}:/output" \
  pkrusche/hap.py /opt/hap.py/bin/hap.py \
  /input/test_nist.b37_chr20_100kbp_at_10mb.vcf.gz \
  /output/output.vcf.gz \
  -f "/input/test_nist.b37_chr20_100kbp_at_10mb.bed" \
  -r "/input/ucsc.hg19.chr20.unittest.fasta" \
  -o "/output/happy.output" \
  --engine=vcfeval \
  -l chr20:10000000-10010000

What should the code would look like to run?

moldach avatar Apr 24 '20 15:04 moldach

Hi @moldach,

the following lines of code should work for a singularity container

# fetch latest version
singularity pull docker://pkrusche/hap.py

# set number of threads, reference fasta file and bed file from exome capture kit
THREADS=$(nproc)
REF=/data/lied_sb_tumor_01/_genomes/somatic-b37_Homo_sapiens_assembly19.fasta
BEDFILE=/data/sb_service_01/128_TNAMSE_RalfWerner/data/ssHAEv7_2019_07_19_noChr.bed
 
# run singularity container
# haplotype caller as 'ground truth' and deepvariant calls as test
singularity exec hap.py_latest.sif /opt/hap.py/bin/hap.py \
  --false-positives $BEDFILE \
  --reference $REF \
  --report-prefix happy.output \
  --engine=vcfeval \
  --threads $THREADS \
  ../04_haplotypecaller/DX196319.left.vcf.gz \
  ../03_deepvariant/DX196319.dv.left.vcf.gz

Here, I used GATK haplotype caller output as ground truth and tested deepvariant calls.

Hope that helps.

Best, Axel

kunstner avatar Jun 25 '20 09:06 kunstner

i want to know where is /opt/hap.py/bin/hap.py

netwon123 avatar Sep 13 '23 02:09 netwon123

i want to know where is /opt/hap.py/bin/hap.py

It is inside the singularity container.

//axel

kunstner avatar Sep 13 '23 05:09 kunstner

Sorry sir, I just get the hap.py_latest.sif after using 'singularity pull docker://pkrusche/hap.py'. i don't get the hap.py under path '/opt'. could u tell me detailed explanation? thanks u very much.

netwon123 avatar Sep 13 '23 09:09 netwon123

It is a path inside the singularity container. Singularity executes this binary inside the container. You just need the sif file. Everyting else is inside the sif file. Nothing to worry about.

kunstner avatar Sep 13 '23 09:09 kunstner

It is a path inside the singularity container. Singularity executes this binary inside the container. You just need the sif file. Everyting else is inside the sif file. Nothing to worry about.

i got it. Thanks! Just use it directly.

netwon123 avatar Sep 13 '23 09:09 netwon123