diff --git a/modules/ichorcna/1.0/config/default.yaml b/modules/ichorcna/1.0/config/default.yaml index 5be9c5b7..c0202f03 100644 --- a/modules/ichorcna/1.0/config/default.yaml +++ b/modules/ichorcna/1.0/config/default.yaml @@ -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 diff --git a/modules/ichorcna/1.0/ichorcna.smk b/modules/ichorcna/1.0/ichorcna.smk index 46115522..93992303 100644 --- a/modules/ichorcna/1.0/ichorcna.smk +++ b/modules/ichorcna/1.0/ichorcna.smk @@ -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: @@ -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: