Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
Adjusting different rules in IniitialChIPseq.snakefile merge branch '…
Browse files Browse the repository at this point in the history
…activeDev' of https://github.com/tovahmarkowitz/Pipeliner into activeDev
  • Loading branch information
tovahmarkowitz committed Oct 9, 2018
2 parents 0b029e8 + fb15dd2 commit d3a1e5c
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions Rules/InitialChIPseqQC.snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ extensions = [ "sorted.normalized", "sorted.Q5DD.normalized"]
bwterm = ".normalized"
extensions2 = list(map(lambda x:re.sub(bwterm,"",x),extensions))

chip2input = config['project']['peaks']['inputs']
sampleswinput = []
for input in chip2input:
if chip2input[input] != '':
sampleswinput.append(input)

trim_dir='trim'
kraken_dir='kraken'
bam_dir='bam'
Expand Down Expand Up @@ -453,9 +459,9 @@ rule bam2bw:
genomelen+=int(l)
excludedchrs=list(set(chrs)-set(includedchrs))
commoncmd="module load {params.deeptoolsver};"
cmd1="bamCoverage --bam "+input.bam1+" -o "+output.outbw1+" --binSize 2 --smoothLength 5 --ignoreForNormalization "+" ".join(excludedchrs)+" --numberOfProcessors 32 --normalizeUsing RPGC --effectiveGenomeSize "+str(genomelen)
cmd1="bamCoverage --bam "+input.bam1+" -o "+output.outbw1+" --binSize 25 --smoothLength 75 --ignoreForNormalization "+" ".join(excludedchrs)+" --numberOfProcessors 32 --normalizeUsing RPGC --effectiveGenomeSize "+str(genomelen)
shell(commoncmd+cmd1)
cmd4="bamCoverage --bam "+input.bam4+" -o "+output.outbw4+" --binSize 2 --smoothLength 5 --ignoreForNormalization "+" ".join(excludedchrs)+" --numberOfProcessors 32 --normalizeUsing RPGC --effectiveGenomeSize "+str(genomelen)
cmd4="bamCoverage --bam "+input.bam4+" -o "+output.outbw4+" --binSize 25 --smoothLength 75 --ignoreForNormalization "+" ".join(excludedchrs)+" --numberOfProcessors 32 --normalizeUsing RPGC --effectiveGenomeSize "+str(genomelen)
if pe=="yes":
cmd4+=" --centerReads"
shell(commoncmd+cmd4)
Expand Down Expand Up @@ -575,6 +581,20 @@ rule deeptools_genes:
shell(commoncmd+cmd6)
shell(commoncmd+cmd7)

rule inputnorm:
input:
join(workpath,bw_dir,"{name}.sorted.Q5DD.normalized.bw")
output:
join(workpath,bw_dir,"{name}.sorted.Q5DD.normalized.inputnorm.bw")
params:
ctrl = lambda w : join(workpath,bw_dir,chip2input[w.name] + ".sorted.Q5DD.normalized.bw"),
rname="pl:inputnorm",
deeptoolsver=config['bin'][pfamily]['tool_versions']['DEEPTOOLSVER'],
shell: """
module load {params.deeptoolsver};
bigwigCompare --binSize 25 --outFileName {output} --outFileFormat 'bigwig' --bigwig1 {input} --bigwig2 {params.ctrl} --operation 'subtract' --skipNonCoveredRegions -p $SLURM_CPUS_PER_TASK;
"""

rule preseq:
params:
rname = "pl:preseq",
Expand Down

0 comments on commit d3a1e5c

Please sign in to comment.