Skip to content

Commit

Permalink
Initial attempt at permtool --no-combine-permutations option
Browse files Browse the repository at this point in the history
  • Loading branch information
jluquette committed Aug 2, 2024
1 parent 81e80e3 commit c6a3cc2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
3 changes: 3 additions & 0 deletions bin/scan2
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ scan2_param_defaults = {
'resources': '/opt/anaconda1anaconda2anaconda3/lib/scan2/resources', # also a directory
'bam_map': {}, # maps sample name -> bam path
'amplification_map': {}, # map sample name -> bulk|MDA|PTA|other things in the future..
'no_combine_permutations': False,
'permtool_config_map': {},
'permtool_matrix_map': {},
'permtool_n_permutations': 10000,
Expand Down Expand Up @@ -1226,6 +1227,8 @@ if __name__ == "__main__":
help='Similar to --permtool-snv-generation-param but acts as a multiplier for a hard-coded base number of random indels to generate per iteration.')
permtool.add_argument('--permtool-bedtools-genome-file', type=readable_file, metavar='PATH',
help='Genome file formatted for the -g option of bedtools intersect.')
permtool.add_argument('--no-combine-permutations', default=False, action='store_true',
help='Do not combine all per-sample permutations into a single permutation object. When many arbitrary combinations of samples are of interest, it is better to only generate per-sample permutation objects without a final combine step. The per-sample results are stored in the output directory perms_by_sample/SAMPLE_NAME/*.rda, which can be combined in arbitrary groups using scripts/combine_permutations.R.')



Expand Down
22 changes: 16 additions & 6 deletions snakemake/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,19 @@ if config['analysis'] == 'rescue':

if config['analysis'] == 'permtool':
include: "snakefile.permtool"
rule permtool:
input:
expand("perms_{muttype}_{passtype}.rda",
muttype=[ 'snv', 'indel' ], passtype=[ 'pass', 'rescue' ]),
expand("seedinfo_{muttype}_{passtype}.rda",
muttype=[ 'snv', 'indel' ], passtype=[ 'pass', 'rescue' ])
# Allow user to skip the final combine stage. In this mode, the user just
# wants access to all of the individual permutation objects so they can
# combine them in arbitrary ways.
if config['no_combine_permutations']:
rule permtool:
input:
expand("perms_by_sample/{sample}/{muttype}_{passtype}.rda",
sample=config['permtool_config_map'].keys(),
muttype=[ 'snv', 'indel' ], passtype=[ 'pass', 'rescue' ])
else:
rule permtool:
input:
expand("perms_{muttype}_{passtype}.rda",
muttype=[ 'snv', 'indel' ], passtype=[ 'pass', 'rescue' ]),
expand("seedinfo_{muttype}_{passtype}.rda",
muttype=[ 'snv', 'indel' ], passtype=[ 'pass', 'rescue' ])

0 comments on commit c6a3cc2

Please sign in to comment.