Skip to content

Commit

Permalink
Added a chr- function for readCounter
Browse files Browse the repository at this point in the history
  • Loading branch information
Jwong684 committed Apr 29, 2021
1 parent 874bb89 commit 0466b04
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
6 changes: 0 additions & 6 deletions modules/ichorcna/1.0/config/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ lcr-modules:

options:
readcounter:
chrs:
hg19: "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,X,Y"
grch37: "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,X,Y"
hs37d5: "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,X,Y"
hg38: "chr1,chr2,chr3,chr4,chr5,chr6,chr7,chr8,chr9,chr10,chr11,chr12,chr13,chr14,chr15,chr16,chr17,chr18,chr19,chr20,chr21,chr22,chrX,chrY"
grch38: "chr1,chr2,chr3,chr4,chr5,chr6,chr7,chr8,chr9,chr10,chr11,chr12,chr13,chr14,chr15,chr16,chr17,chr18,chr19,chr20,chr21,chr22,chrX,chrY"
qual: 20 # only includes reads with mapping quality greater than 20
binSize: 1000000 # set window size to compute coverage
# available binSizes are: 1000000, 500000, 50000, 10000
Expand Down
13 changes: 12 additions & 1 deletion modules/ichorcna/1.0/ichorcna.smk
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,17 @@ rule _ichorcna_input_bam:
op.absolute_symlink(input.bam, output.bam)
op.absolute_symlink(input.bai, output.bai)

# This function will return a comma-separated list of chromosomes to include in readCounter
def get_chromosomes(wildcards):
chromosomes=[]
for i in range(1,23):
chromosomes.append(str(i))
chromosomes.append("X")
chromosomes.append("Y")
if "38" in str(wildcards.genome_build):
chromosomes = ["chr" + x for x in chromosomes]
chromosomes= ",".join(chromosomes)
return chromosomes

rule _ichorcna_read_counter:
input:
Expand All @@ -194,7 +205,7 @@ rule _ichorcna_read_counter:
params:
binSize = CFG["options"]["readcounter"]["binSize"],
qual = CFG["options"]["readcounter"]["qual"],
chrs = op.switch_on_wildcard("genome_build", CFG["options"]["readcounter"]["chrs"])
chrs = get_chromosomes
conda: CFG["conda_envs"]["ichorcna"]
threads: CFG["threads"]["readcounter"]
resources:
Expand Down

0 comments on commit 0466b04

Please sign in to comment.