Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added exception for configfiles depending on snakemake version
  • Loading branch information
msbentsen committed Jan 6, 2020
1 parent 4a7dde9 commit d789a13
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 45 deletions.
7 changes: 6 additions & 1 deletion Snakefile
Expand Up @@ -8,11 +8,16 @@ import itertools
import glob
import datetime

snakemake.utils.min_version("5.4") #for checkpoints functionality

#-------------------------------------------------------------------------------#
#---------------------- SETUP PROCESS-RELATED CONFIGURATION --------------------#
#-------------------------------------------------------------------------------#
try:
CONFIGFILE = str(workflow.overwrite_configfiles[0])
except:
CONFIGFILE = str(workflow.overwrite_configfile[0])

CONFIGFILE = str(workflow.overwrite_configfile)
wd = os.getcwd()
config["wd"] = wd

Expand Down
56 changes: 15 additions & 41 deletions environments/tobias.yaml
Expand Up @@ -5,49 +5,23 @@ channels:
- conda-forge

dependencies:
- python >= 3
- pysam
- pybigwig
- python=3
- snakemake>=5.4
- uropa=3
- samtools
- moods
- pybedtools
- cython
- matplotlib
- numpy
- scipy
- pypdf2
- scikit-learn
- snakemake
- bedtools
- uropa
- igvtools
- openjdk
- xlsxwriter
- cloudpickle = 0.5.6
- unzip
- r-base
- r-devtools
- r-shiny
- r-data.table
- r-ggplot2
- r-plotly
- r-knitr
- r-lme4
- r-htmltable
- tobias>=0.9
- r-hmisc
- r-pbkrtest
- r-openxlsx
- r-rio
- r-car
- bioconductor-deseq2
- r-plyr
- r-scales
- r-rjson
- r-shinydashboard
- r-reshape
- r-ggrepel >= 0.6.12
- r-heatmaply >= 0.14.1
- r-colorspace
- r-shinyjs
- r-viridis
- r-rje
- r-openssl
- r-shinycssloaders
- r-log4r
- r-shinythemes
- r-shinybs
- intervene
- pip:
- adjustText
- tobias
- igvtools
- icu
8 changes: 5 additions & 3 deletions snakefiles/preprocessing.snake
Expand Up @@ -94,7 +94,7 @@ rule process_peaks:
peaks = lambda wildcards: [os.path.join(OUTPUTDIR, "peak_calling", wildcards.condition, sample_id + "_raw.bed") for sample_id in id2bam[wildcards.condition].keys()],
blacklisted = BLACKLIST
output:
peaks = os.path.join(OUTPUTDIR, "peak_calling", "{condition}_union.bed"),
peaks = os.path.join(OUTPUTDIR, "peak_calling", "{condition}_union.bed")
message: "Processing peaks from condition {wildcards.condition}"
shell:
"cat {input.peaks} | cut -f1-3 | sort -k1,1 -k2,2n | bedtools merge -d 5 | bedtools subtract -a - -b {input.blacklisted} -A | "
Expand All @@ -103,8 +103,10 @@ rule process_peaks:

# Union peaks across all conditions
rule merge_condition_peaks:
input: expand(rules.process_peaks.output.peaks, condition=CONDITION_IDS) #expand(os.path.join(OUTPUTDIR, "peak_calling", "{condition}_union.bed"), condition=CONDITION_IDS)
output: temp(os.path.join(OUTPUTDIR, "peak_calling", "all_merged.tmp"))
input:
[os.path.join(OUTPUTDIR, "peak_calling", condition + "_union.bed") for condition in CONDITION_IDS]
output:
temp(os.path.join(OUTPUTDIR, "peak_calling", "all_merged.tmp"))
message: "Merging peaks across conditions"
shell:
"cat {input} | sort -k1,1 -k2,2n | bedtools merge -d 5 -c 4 -o distinct > {output}"
Expand Down

0 comments on commit d789a13

Please sign in to comment.