Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run Singularity #118

Open
moldach opened this issue Apr 24, 2020 · 6 comments
Open

How to run Singularity #118

moldach opened this issue Apr 24, 2020 · 6 comments

Comments

@moldach
Copy link

moldach commented Apr 24, 2020

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?

@kunstner
Copy link

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

nicholas-owen pushed a commit to nicholas-owen/hap.py that referenced this issue Mar 17, 2022
* Documentation updates for 0.3.12 release (Illumina#110)

* Update RELEASES.md (Illumina#87)

* Updated RELASES.md and normalization.md (Illumina#109)

* Merge doc changes from dev (Illumina#112)

* Update RELEASES.md (Illumina#87)

* Updated RELASES.md and normalization.md (Illumina#109)

* Update more docs (Illumina#111)

* Update happy.md

* Cleaned up normalisation.md

* Update happy.md

* Created a new section for working with genome VCFs
  * Added description of --filter-nonref
  * Updated description of --convert-gvcf-xxxx options
  * Added note toward beginning of document calling attention to genome VCF section
* Fixed broken links in TOC
* Fixed inconsistent case in headings

* Fix unmergable typo directly in master (Illumina#119)

This little space has caused no end of problems in getting these branches synced up. I'm hopeful that attacking it directly at the source may relieve the issues.
@netwon123
Copy link

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

@kunstner
Copy link

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

It is inside the singularity container.

//axel

@netwon123
Copy link

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.

@kunstner
Copy link

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.

@netwon123
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants