.genome file not found for SnpEff
I'm running into the following error trying to run SnpEff from a container.
java.lang.RuntimeException: Property: 'variant_calling/varscan2/bwa-mem2/sambamba/picard/MTG324.vcf.genome' not found
The container comes with it's own config file so I'm trying to override the location using the -dataDir parameter like so:
rule snpeff_download:
output:
directory('resources/snpeff/WBcel235.86')
log:
'logs/snpeff/download/WBcel235.86.log'
params:
reference='WBcel235.86'
resources:
mem=1000,
time=30
container:
'docker://resolwebio/snpeff:2.0.0'
shell: """
java -jar /opt/snpeff/snpeff/snpEff.jar download {params.reference} -dataDir /scratch/moldach/COOVAR/resources/snpeff
"""
The first rule runs successfully; however, I get the error from the second rule:
if (config['ANNOT_TOOL']=='snpeff'):
rule snpeff:
input:
calls=lambda wildcards: getVCFs(wildcards.sample),
ref = os.path.join(dirs_dict['REF_DIR'],config['REF_GENOME']),
db='resources/snpeff/WBcel235.86'
output:
calls=os.path.join(dirs_dict['ANNOT_DIR'],config['ANNOT_TOOL'],config['CALLING_TOOL'],config['ALIGN_TOOL'],config['SORT_TOOL'],config['MARKDUP_TOOL'],'{sample}.annotated.vcf'),
stats=os.path.join(dirs_dict['ANNOT_DIR'],config['ANNOT_TOOL'],config['CALLING_TOOL'],config['ALIGN_TOOL'],config['SORT_TOOL'],config['MARKDUP_TOOL'],'{sample}.html'),
csvstats=os.path.join(dirs_dict['ANNOT_DIR'],config['ANNOT_TOOL'],config['CALLING_TOOL'],config['ALIGN_TOOL'],config['SORT_TOOL'],config['MARKDUP_TOOL'],'{sample}.csv')
log:
os.path.join(dirs_dict['LOG_DIR'],config['ANNOT_TOOL'],config['CALLING_TOOL'],config['ALIGN_TOOL'],config['SORT_TOOL'],config['MARKDUP_TOOL'],'{sample}.log')
params:
sample='{sample}',
resources:
mem=3000,
time=60
container:
'docker://resolwebio/snpeff:2.0.0'
shell: """
java -Xmx4g -jar /opt/snpeff/snpeff/snpEff.jar -dataDir /scratch/moldach/COOVAR/resources/snpeff {input.calls} > {output.calls}
"""
• 2,007 views
•
link
1 answer
There were multiple issues going on:
-dataDirneeds to be included in both of the rules in-order to over-ride the settings in the configuration file provided with theDockercontainer.- By default it's looking _inside_ the containers
PATHso I needed to addos.getcwd()to theparams:section and append that before theoutput:directory.
Working Solution
rule snpeff_download:
output:
directory('resources/snpeff/WBcel235.86')
log:
'logs/snpeff/download/WBcel235.86.log'
params:
reference='WBcel235.86',
dir='resources/snpeff',
pwd=os.getcwd()
resources:
mem=1000,
time=30
container:
'docker://resolwebio/snpeff:2.0.0'
shell: """
java -jar /opt/snpeff/snpeff/snpEff.jar download -dataDir {params.pwd}/{params.dir} {params.reference}
"""
if (config['ANNOT_TOOL']=='snpeff'):
rule snpeff:
input:
calls=lambda wildcards: getVCFs(wildcards.sample),
db='resources/snpeff/WBcel235.86'
output:
calls=os.path.join(dirs_dict['ANNOT_DIR'],config['ANNOT_TOOL'],config['CALLING_TOOL'],config['ALIGN_TOOL'],config['SORT_TOOL'],config['MARKDUP_TOOL'],'{sample}.annotated.vcf'),
stats=os.path.join(dirs_dict['ANNOT_DIR'],config['ANNOT_TOOL'],config['CALLING_TOOL'],config['ALIGN_TOOL'],config['SORT_TOOL'],config['MARKDUP_TOOL'],'{sample}.html'),
csvstats=os.path.join(dirs_dict['ANNOT_DIR'],config['ANNOT_TOOL'],config['CALLING_TOOL'],config['ALIGN_TOOL'],config['SORT_TOOL'],config['MARKDUP_TOOL'],'{sample}.csv')
log:
os.path.join(dirs_dict['LOG_DIR'],config['ANNOT_TOOL'],config['CALLING_TOOL'],config['ALIGN_TOOL'],config['SORT_TOOL'],config['MARKDUP_TOOL'],'{sample}.log')
params:
extra='-Xmx4g',
dir='resources/snpeff',
pwd=os.getcwd()
resources:
mem=3000,
time=60
container:
'docker://resolwebio/snpeff:2.0.0'
shell: """
java -jar /opt/snpeff/snpeff/snpEff.jar \
-dataDir {params.pwd}/{params.dir} \
-stats {output.stats} \
-csvStats {output.csvstats} \
WBcel235.86 \
{input.calls} > {output.calls}
"""
• 0 views
•
link
Log in to answer this question.