Skip to content

Conversation

@arostamianfar
Copy link
Contributor

@arostamianfar arostamianfar commented Oct 31, 2018

This option gracefully handles both excess and insufficient values. For now, the flag is set via allow_malformed_records in order to avoid having too many flags. We can consider adding a separate flag if users want to control this behavior separate from other malformed conditions.

Tested:
unit + integration tests

Fixes #129

@coveralls
Copy link

coveralls commented Oct 31, 2018

Pull Request Test Coverage Report for Build 1428

  • 42 of 42 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 87.722%

Totals Coverage Status
Change from base Build 1427: 0.1%
Covered Lines: 6330
Relevant Lines: 7216

💛 - Coveralls

Copy link
Contributor

@allieychen allieychen left a comment

Choose a reason for hiding this comment

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

It looks awesome! I only have some minor comments.

minimal_match=False, # type: bool
infer_annotation_types=False, # type: bool
counter_factory=None # type: metrics_util.CounterFactoryInterface
counter_factory=None, # type: metrics_util.CounterFactoryInterface,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: remove , at the end.

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I prefer to switch the order of counter_factory and allow_alternate_allele_info_mismatch, so that all bool flags can stay together to improve the readability.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great suggestion! I actually moved it all the way up to be close to split_alternate_allele_info_fields as they're related.

known_args.minimal_vep_alt_matching,
known_args.infer_annotation_types,
counter_factory)
counter_factory,
Copy link
Contributor

Choose a reason for hiding this comment

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

It may not related with this PR, but is there any reason why not create the counter inside ProcessedVariantFactory?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question. The main reason is to share the factory across all classes (currently only one classes uses counters, but we have some open issues to add counters to other classes too) and also that we want to override it in tests to use the NoOpCounterFactory (or any other custom metric factory).

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point! Thanks!

self._variant_counter = cfactory.create_counter(
_CounterEnum.VARIANT.value)
self._alternate_allele_info_mismatche_counter = cfactory.create_counter(
_CounterEnum.ALTERNATE_ALLELE_INFO_MISMATCH)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: s/ALTERNATE_ALLELE_INFO_MISMATCH/ALTERNATE_ALLELE_INFO_MISMATCH.value, as the above counter _variant_counter used VARIANT.value

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch! Done.

Copy link
Contributor Author

@arostamianfar arostamianfar left a comment

Choose a reason for hiding this comment

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

Thanks for the detailed review!!

self._variant_counter = cfactory.create_counter(
_CounterEnum.VARIANT.value)
self._alternate_allele_info_mismatche_counter = cfactory.create_counter(
_CounterEnum.ALTERNATE_ALLELE_INFO_MISMATCH)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch! Done.

minimal_match=False, # type: bool
infer_annotation_types=False, # type: bool
counter_factory=None # type: metrics_util.CounterFactoryInterface
counter_factory=None, # type: metrics_util.CounterFactoryInterface,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great suggestion! I actually moved it all the way up to be close to split_alternate_allele_info_fields as they're related.

known_args.minimal_vep_alt_matching,
known_args.infer_annotation_types,
counter_factory)
counter_factory,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question. The main reason is to share the factory across all classes (currently only one classes uses counters, but we have some open issues to add counters to other classes too) and also that we want to override it in tests to use the NoOpCounterFactory (or any other custom metric factory).

@arostamianfar arostamianfar merged commit a6973eb into googlegenomics:master Nov 1, 2018
@arostamianfar arostamianfar deleted the fnuma branch November 27, 2018 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants