-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add mix and match functionality for mutation calling (resolves #265) #283
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. Minor edits needed. Also, Make sure you add an entry in MANUAL.md
.
job.fileStore.logToMaster('Aggregated mutations for %s successfully' % univ_options['patient']) | ||
return merged_snvs.rv() | ||
chroms = {} | ||
for caller in mutation_results: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document why you've done this
@@ -105,25 +121,27 @@ def merge_perchrom_mutations(job, chrom, mutations, univ_options): | |||
# For now, let's just say 2 out of n need to call it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove these redundant comments
if 'strelka' + mut_type in perchrom_mutations: | ||
perchrom_mutations['strelka'] = perchrom_mutations['strelka_' + mut_type] | ||
perchrom_mutations.pop('strelka_' + mut_type) | ||
if not perchrom_mutations: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition should occur before # process the strelka key
perchrom_mutations.pop('strelka_' + mut_type) | ||
if not perchrom_mutations: | ||
continue | ||
majority = 1 if len(perchrom_mutations) <= 2 else len(perchrom_mutations) / 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(len(perchrom_mutations) + 1) / 2
src/protect/pipeline/ProTECT.py
Outdated
@@ -353,7 +353,7 @@ def _parse_config_file(job, config_file, max_cores=None): | |||
input_config = _add_default_entries(input_config, protect_defaults) | |||
|
|||
# Flags to check for presence of encryption keys if required | |||
gdc_inputs = ssec_encrypted = False | |||
gdc_inputs = ssec_encrypted = sample_without_variants = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Flags to check for presence of encryption keys if required
gdc_inputs = ssec_encrypted = False
# Flag to check if a sample without an input vcf/bedpe was provided
sample_without_variants = False
src/protect/pipeline/ProTECT.py
Outdated
@@ -373,6 +373,8 @@ def _parse_config_file(job, config_file, max_cores=None): | |||
raise ParameterError('Cannot run ProTECT using GDC RNA bams. Please fix ' | |||
'sample %s' % sample_name) | |||
gdc_inputs = True | |||
if 'mutation_vcf' not in sample_set[sample_name] and 'fusion_bedpe' not in sample_set[sample_name]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long
f1e1f69
to
466c800
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you implement the requested change, then squash and rebase?
After that, in a separate commit in the same PR, implement #286?
# Process the strelka key | ||
perchrom_mutations['strelka'] = perchrom_mutations['strelka_' + mut_type] | ||
perchrom_mutations.pop('strelka_' + mut_type) | ||
if 'strelka' + mut_type in perchrom_mutations: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be if 'strelka_' + mut_type in perchrom_mutations:
466c800
to
f7266f6
Compare
MANUAL.md
Outdated
@@ -335,6 +335,11 @@ be substituted with S3 links. Descriptions for creating all files can be found i | |||
version: 1.2.0 | |||
|
|||
mutation_calling: | |||
consensus: | |||
indel_majority: None -> Number of callers required to accept an indel. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the 'None'. Say default is to compute it dynamically. Same for snv
src/protect/pipeline/defaults.yaml
Outdated
@@ -55,6 +55,9 @@ expression_estimation: | |||
version: 1.2.20 | |||
|
|||
mutation_calling: | |||
consensus: | |||
indel_majority: None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make this
consensus:
indel_majority:
snv_majority:
@@ -83,6 +83,9 @@ expression_estimation: | |||
# version: 1.2.0 | |||
|
|||
mutation_calling: | |||
consensus: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this
consensus:
# indel_majority: 1 # The number of callers required to accept an indel
# snv_majority: 2 # The number of callers required to accept an snv
src/protect/pipeline/ProTECT.py
Outdated
else: | ||
count = 1 if tool_options['strelka']['run'] is True else 0 | ||
if tool_options['consensus'][mut_type + '_majority'] > count: | ||
raise RuntimeError('Majority cannot be greater than the number of callers. Got number of %s callers ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is too long
f7266f6
to
85337d0
Compare
85337d0
to
b018a59
Compare
resolves #265
Added functionality so the user can select which mutation callers to execute. If no mutation callers are selected, the user must provide at least a mutation_vcf or a fusion_bedpe file.