Skip to content
Snippets Groups Projects
Commit 6fcdb6d8 authored by Ticlla Ccenhua Monica Roxana's avatar Ticlla Ccenhua Monica Roxana
Browse files

sole issue with reading paths for RAW_DIR and OUT_DIR in configuration file....

sole issue with reading paths for RAW_DIR and OUT_DIR in configuration file. Avoids using PWD and asks for always providing absolute paths
parent b3b55e09
Branches
No related tags found
No related merge requests found
......@@ -68,22 +68,47 @@ except:
configfile: configfile_path
print("... Configuration file: {}".format(configfile_path), file=sys.stderr)
finally:
print("Configuration of MetaSnk:", file=sys.stderr)
print("Provided configuration for MetaSnk:", file=sys.stderr)
my_temp=[print(" {}:{}\n".format(key,value), file=sys.stderr) for key,value in config.items()]
##----------------------------------------------------------------------------##
## Define paths and local variables
##----------------------------------------------------------------------------##
PWD = os.environ["PWD"]
RAW_FASTQ_DIR = eval(config['RAW_DIR'])
OUT_DIR = eval(config['OUT_DIR'])
print("MetaSnk is setting local variables ...")
try:
print("Setting RAW_DIR")
if os.path.exists(config['RAW_DIR'])==False:
raise FileNotFoundError
else:
RAW_FASTQ_DIR = config['RAW_DIR']
print("RAW_DIR: {}".format(RAW_FASTQ_DIR), file=sys.stderr)
except FileNotFoundError:
print(" Provided path does not exist!\n"+\
" Please provide an absolute path for RAW_DIR in your configuration file!")
exit(1)
try:
print("Setting OUT_DIR")
if os.path.exists(config['OUT_DIR'])==False:
raise FileNotFoundError
else:
OUT_DIR = config['OUT_DIR']
print("OUT_DIR: {}".format(OUT_DIR), file=sys.stderr)
except FileNotFoundError:
print(" Provided path does not exist!\n"+\
" Please provide absolute path for OUT_DIR in your configuration file!")
exit(1)
OUT_DIR = config['OUT_DIR']
METASNK_DB_DIR = os.environ["METASNK_DBS"]
SHUB_PREQC_SIF = 'shub://mticlla/MetagenomicSnake:preqc_v0_1'
SHUB_METAPROF_SIF = 'shub://mticlla/OmicSingularities:metaprof'
PREQC_SIF = METASNK_DB_DIR+'/singularity/MetagenomicSnake_preqc_v0_1.sif'
METAPROF_SIF = METASNK_DB_DIR+'/singularity/OmicSingularities_metaprof.sif'
HUMAN_REF = eval(config['preprocess']['filter_human']['bbmap_reference'])
HUMAN_REF = eval(config['preprocess']['filter_human']['bbmap_reference'])
print("HUMAN_REF: {}".format(HUMAN_REF), file=sys.stderr)
##----------------------------------------------------------------------------##
## Fastq files to be processed
##----------------------------------------------------------------------------##
......
......@@ -10,10 +10,21 @@
# or a comma-delimited string of bind path specifications can be used.
#
# Absolute PATH to folder where to find fastq files
RAW_DIR: "PWD+'/data/raw'"
# Absolute PATH to folder where to place output files
OUT_DIR: "PWD+'/data/interim/MetaSnk'"
# Always provide an ABSOLUTE PATH to the folder where to find fastq files
# MetaSnk expects to find the raw fastq files in a directory where
# they are grouped into datasets (one or multiple).
# Inside the RAW_DIR folder, each dataset directory (named at the user's discretion)
# must contain a directory named 'fastq', where fastq files are placed,
# accompanied by a sample_metatada.tsv file:
# $RAW_DIR
# ├── dataset_test_1
# ├── fastq
# | ├── sampleID-RUN_LANE-R1.fastq.gz
# | ├── sampleID-RUN_LANE-R2.fastq.gz
# └── sample_metadata.tsv
RAW_DIR: ''
# Always provide ABSOLUTE PATH to folder where to place output files
OUT_DIR: ''
#
SAMPLE_UNITS:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment