Commit 58b7208c authored by kevin's avatar kevin

added container download

parent 6716f74d
......@@ -9,6 +9,7 @@ localrules: impute, clean, download_container, generate_samples_file
# containing all imputed expression values
rule impute:
input:
"container.sif",
expand("{output_dir}/gene_expression/{region}.expression.txt", region = config['brain_regions'], output_dir = config['output_dir'])
output:
expand("{output_dir}/gene_expressions_combined.rds", output_dir = config['output_dir'])
......@@ -30,14 +31,36 @@ rule clean:
# download the required singularity container from zenodo.org
rule download_container:
output:
"container_unchecked.sif"
shell:
"""
wget https://zenodo.org/record/{config[zenodo_record_id]}/files/container.sif -O container_unchecked.sif
"""
# check md5
rule check_container:
input:
"container_unchecked.sif"
output:
"container.sif"
singularity:
"container_unchecked.sif"
shell:
"""
echo 'not implemented'
set -e
checksum=($(md5sum container_unchecked.sif))
if [ $checksum != {config[container_mdf5]} ]; then
echo md5 mismatch for container, download corrupted!
exit 1
fi
mv container_unchecked.sif container.sif
"""
# extract dosages in custom PrediXcan format from vcf file
rule vcf_to_dosages:
input:
"container.sif",
config['input_vcf_gz_file']
output:
"{output_dir}/dosages/chr{i}.dosage.txt.gz"
......@@ -63,6 +86,7 @@ rule vcf_to_dosages:
# extract sample file for PrediXcan
rule generate_samples_file:
input:
"container.sif",
config['input_vcf_gz_file']
output:
"{output_dir}/dosages/samples.txt"
......@@ -83,6 +107,7 @@ rule generate_samples_file:
# run PrediXcan to impute gene expression for individual tissue type
rule impute_gene_expression:
input:
"container.sif",
samples_file = expand("{output_dir}/dosages/samples.txt", output_dir = config['output_dir']),
dosage_files = expand("{output_dir}/dosages/chr{i}.dosage.txt.gz", i = range(1, 24), output_dir = config['output_dir'])
output:
......
......@@ -23,3 +23,6 @@ brain_regions:
- 'Putamen_basal_ganglia'
- 'Spinal_cord_cervical_c-1'
- 'Substantia_nigra'
zenodo_record_id: '3376504'
container_mdf5: '1f5aada82c1aeb8e00b0328421ed009b'
Markdown is supported
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