Skip to content

Commit

Permalink
Merge and upload reports
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmeaton committed Oct 28, 2020
2 parents dfb3f0e + 7a99b75 commit e1aa63b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 16 deletions.
13 changes: 7 additions & 6 deletions profiles/compute-canada/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,24 @@ latency-wait: 5
keep-going: True
rerun-incomplete: True
printshellcmds: False
use-singularity: True
singularity-prefix: /scratch/keaton/singularity
singularity-args: "-B /home -B /project -B /scratch -B /localscratch"
#use-singularity: True
#singularity-prefix: /scratch/keaton/singularity
#singularity-args: "-B /home -B /project -B /scratch -B /localscratch"
#log-handler-script: "workflow/scripts/slack_log.py"

#------------------------------------------------------------------------------#
# System config
#------------------------------------------------------------------------------#
# Total resources for the entire workflow
# ex. 4 cpus, 4GB each (total 16GB), on one node
resources: [cpus=4, mem_mb=16000, load=100]
resources: [cpus=10, mem_mb=40000, load=100]
# Default resources for a job
default-resources: [cpus=1, mem_mb=2000, time_min=30, account="def-briang"]
default-resources: [cpus=1, mem_mb=4000, time_min=60, account="def-briang"]
# Maximum number of jobs to run
jobs : "4"
jobs : "10"
# Where to put the .snakemake directory
shadow-prefix: "/scratch/keaton/plague-phylogeography"
# slurm execution
cluster: "sbatch --parsable -t {resources.time_min} -A {resources.account} --cpus-per-task {resources.cpus} --mem-per-cpu={resources.mem_mb} -o workflow/logs_slurm/{rule}_%j.out -e workflow/logs_slurm/{rule}_%j.err --job-name {rule}"
cluster-status: "workflow/scripts/slurm_status.py"
scheduler: "greedy"
2 changes: 1 addition & 1 deletion workflow/envs/main/environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies:
# Snakemake Execution
- python=3.7.3
- sqlite=3.31.1
- snakemake=5.25.0
- snakemake=5.26.1
- flask=1.1.2
- python-dotenv=0.14.0
- slackclient=2.9.1
Expand Down
2 changes: 1 addition & 1 deletion workflow/envs/merge/environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ dependencies:
- samtools=1.10
- singularity=3.6.3
- slackclient=2.9.1
- snakemake=5.25.0
- snakemake=5.26.1
- sqlite=3.31.1
- vcftools=0.1.16
- pip:
Expand Down
2 changes: 1 addition & 1 deletion workflow/rules/download.smk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rule download_sra:
"""
Download SRA fastq files.
"""
message: "Downloading and dumping fastq files for BioSample {wildcards.sample}."
message: "Downloading and dumping {wildcards.file_acc} fastq for BioSample {wildcards.sample}."
output:
fastq = results_dir + "/data/sra/{sample}/{file_acc}_1.fastq.gz"
log:
Expand Down
15 changes: 8 additions & 7 deletions workflow/scripts/download_sra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ SRA_ACC=$4
#fi

# Set cache enabled if not set
if [[ -z `grep "/cache-enabled" $HOME/.ncbi/user-settings.mkfg` ]]; then
echo '/cache-enabled = "true"' >> $HOME/.ncbi/user-settings.mkfg
if [[ -z `grep "cache-enabled" $HOME/.ncbi/user-settings.mkfg` ]]; then
vdb-config -s "cache-enabled=true";
fi;

# Set the cache path

if [[ -z `grep "/repository/user/main/public/root" $HOME/.ncbi/user-settings.mkfg` ]]; then\
# Set SRA Cache Path
echo "/repository/user/main/public/root = "\"${CACHE_PATH}\" >> $HOME/.ncbi/user-settings.mkfg
vdb-config -s "/repository/user/main/public/root=${CACHE_PATH}";
else
# Retrieve SRA Cache Path
CACHE_PATH=`grep "/repository/user/main/public/root" $HOME/.ncbi/user-settings.mkfg | \
Expand All @@ -38,12 +39,12 @@ fi;

# Set the timeout
if [[ -z `grep "/http/timeout/read" $HOME/.ncbi/user-settings.mkfg` ]]; then
echo '/http/timeout/read = "10000"' >> $HOME/.ncbi/user-settings.mkfg
vdb-config -s "/http/timeout/read=10000";
fi;

# Echo for debugging
#echo "SRA Cache:" ${CACHE_PATH}
#echo "NCBI settings:" `cat $HOME/.ncbi/user-settings.mkfg`
echo "SRA Cache:" ${CACHE_PATH}
echo "NCBI settings:" `cat $HOME/.ncbi/user-settings.mkfg`

#------------------------------------------------------------------------------#
# SRA Download #
Expand All @@ -66,7 +67,7 @@ if [[ ${validate_str} != *"corrupt"* ]]; then
--outdir ${OUTDIR} \
--skip-technical \
--gzip \
--split-files ${SRA_ACC};
--split-files ${SRA_ACC};
echo "SRA accession ${SRA_ACC} download completed for Biosample ${BIOSAMPLE_ACC}."
mv ${OUTDIR}/${SRA_ACC}*.fastq.gz ${OUTDIR}/${BIOSAMPLE_ACC};
else
Expand Down

0 comments on commit e1aa63b

Please sign in to comment.