Commit 2b90b7d0 authored by Sander Bollen's avatar Sander Bollen
Browse files

more sanity checks

parent 53705872
......@@ -5,7 +5,7 @@ from pathlib import Path
from pyfaidx import Fasta
OUT_DIR = config.get("OUTPUT_DIR")
OUT_DIR = config.get("OUTPUT_DIR") # TODO: use regular snakemake option?
if OUT_DIR is None:
raise ValueError("You must set --config OUT_DIR=<path>")
......@@ -13,27 +13,38 @@ REFERENCE = config.get("REFERENCE")
if REFERENCE is None:
raise ValueError("You must set --config REFERENCE=<path>")
if not Path(REFERENCE).exists():
raise FileNotFoundError("Reference file does not exist.")
raise FileNotFoundError("Reference file {0} "
"does not exist.".format(REFERENCE))
JAVA = config.get("JAVA") # TODO: should be handled by conda?!
if JAVA is None:
raise ValueError("You must set --config JAVA=<path>")
if not Path(JAVA).exists():
raise FileNotFoundError("{0} does not exist".format(JAVA))
GATK = config.get("GATK")
if GATK is None:
raise ValueError("You must set --config GATK=<path>")
if not Path(GATK).exists():
raise FileNotFoundError("{0} does not exist.".format(GATK))
DBSNP = config.get("DBSNP")
if DBSNP is None:
raise ValueError("You must set --config DBSNP=<path>")
if not Path(DBSNP).exists():
raise FileNotFoundError("{0} does not exist".format(DBSNP))
ONETHOUSAND = config.get("ONETHOUSAND")
if ONETHOUSAND is None:
raise ValueError("You must set --config ONETHOUSAND=<path>")
if not Path(ONETHOUSAND).exists():
raise FileNotFoundError("{0} does not exist".format(ONETHOUSAND))
HAPMAP = config.get("HAPMAP")
if HAPMAP is None:
raise ValueError("You must set --config HAPMAP")
raise ValueError("You must set --config HAPMAP=<path>")
if not Path(HAPMAP).exists():
raise FileNotFoundError("{0} does not exist".format(HAPMAP))
# these are all optional
BED = config.get("BED", "") # comma-separated list of BED files
......
......@@ -15,4 +15,64 @@
exit_code: 1
stdout:
contains:
- "Reference file does not exist"
\ No newline at end of file
- "Reference file /very/unlikely/to/exist does not exist"
- name: test-no-java
command: snakemake -n -r -p -s Snakefile --config OUTPUT_DIR=/test/ REFERENCE=Snakefile
exit_code: 1
stdout:
contains:
- "You must set --config JAVA=<path>"
- name: test-java-does-not-exist
command: snakemake -n -r -p -s Snakefile --config OUTPUT_DIR=/test/ REFERENCE=Snakefile JAVA=/very/unlikely/to/exist
exit_code: 1
stdout:
contains:
- "/very/unlikely/to/exist does not exist"
- name: test-no-gatk
command: snakemake -n -r -p -s Snakefile --config OUTPUT_DIR=/test/ REFERENCE=Snakefile JAVA=Snakefile
exit_code: 1
stdout:
contains:
- "You must set --config GATK=<path>"
- name: test-gatk-does-not-exist
command: snakemake -n -r -p -s Snakefile --config OUTPUT_DIR=/test/ REFERENCE=Snakefile JAVA=Snakefile GATK=/very/unlikely/to/exist
exit_code: 1
stdout:
contains:
- "/very/unlikely/to/exist does not exist"
- name: test-no-dbsnp
command: snakemake -n -r -p -s Snakefile --config OUTPUT_DIR=/test/ REFERENCE=Snakefile JAVA=Snakefile GATK=Snakefile
exit_code: 1
stdout:
contains:
- "You must set --config DBSNP=<path>"
- name: test-dbsnp-does-not-exist
command: snakemake -n -r -p -s Snakefile --config OUTPUT_DIR=/test/ REFERENCE=Snakefile JAVA=Snakefile GATK=Snakefile DBSNP=/very/unlikely/to/exist
exit_code: 1
stdout:
contains:
- "/very/unlikely/to/exist does not exist"
- name: test-no-onethousand
command: snakemake -n -r -p -s Snakefile --config OUTPUT_DIR=/test/ REFERENCE=Snakefile JAVA=Snakefile GATK=Snakefile DBSNP=Snakefile
exit_code: 1
stdout:
contains:
- "You must set --config ONETHOUSAND=<path>"
- name: test-onethousand-does-not-exist
command: snakemake -n -r -p -s Snakefile --config OUTPUT_DIR=/test/ REFERENCE=Snakefile JAVA=Snakefile GATK=Snakefile DBSNP=Snakefile ONETHOUSAND=/very/unlikely/to/exist
exit_code: 1
stdout:
contains:
- "/very/unlikely/to/exist does not exist"
- name: test-no-hapmap
command: snakemake -n -r -p -s Snakefile --config OUTPUT_DIR=/test/ REFERENCE=Snakefile JAVA=Snakefile GATK=Snakefile DBSNP=Snakefile ONETHOUSAND=Snakefile
exit_code: 1
stdout:
contains:
- "You must set --config HAPMAP=<path>"
- name: test-hapmap-does-not-exist
command: snakemake -n -r -p -s Snakefile --config OUTPUT_DIR=/test/ REFERENCE=Snakefile JAVA=Snakefile GATK=Snakefile DBSNP=Snakefile ONETHOUSAND=Snakefile HAPMAP=/very/unlikely/to/exist
exit_code: 1
stdout:
contains:
- "/very/unlikely/to/exist does not exist"
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment