Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

davidstew
Copy link
Collaborator

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.

@ghost ghost assigned davidstew May 14, 2018
@ghost ghost added the in progress label May 14, 2018
Copy link
Collaborator

@arkal arkal left a 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:
Copy link
Collaborator

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.
Copy link
Collaborator

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:
Copy link
Collaborator

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
Copy link
Collaborator

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

@@ -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
Copy link
Collaborator

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

@@ -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]:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long

@davidstew davidstew force-pushed the 265-mix-and-match-of-mutation-callers branch from f1e1f69 to 466c800 Compare May 15, 2018 23:23
Copy link
Collaborator

@arkal arkal left a 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:
Copy link
Collaborator

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:

@davidstew davidstew force-pushed the 265-mix-and-match-of-mutation-callers branch from 466c800 to f7266f6 Compare May 18, 2018 23:12
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.
Copy link
Collaborator

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

@@ -55,6 +55,9 @@ expression_estimation:
version: 1.2.20

mutation_calling:
consensus:
indel_majority: None
Copy link
Collaborator

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:
Copy link
Collaborator

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

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 '
Copy link
Collaborator

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

@davidstew davidstew force-pushed the 265-mix-and-match-of-mutation-callers branch from f7266f6 to 85337d0 Compare May 19, 2018 00:28
davidstew added 2 commits June 5, 2018 16:22
resolves #265

Each mutation caller now has a ‘run’ option that can be set to False
to skip using that caller.
resolves #286

Added snv_majority and indel_majority in a consensus tab under mutation_calling
in input_parameters.yaml. If values are not provided, the majority will be dynamically
figured out.
@davidstew davidstew force-pushed the 265-mix-and-match-of-mutation-callers branch from 85337d0 to b018a59 Compare June 5, 2018 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow mix and match of mutation callers
2 participants