-
Notifications
You must be signed in to change notification settings - Fork 7
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
#13, #14: Quality Checking Module & Technician's Output #17
Merged
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
3800a5c
1) Added new column for CONFIDENT_IS_SUBTYPE to determine if the subt…
mgopez dfd873b
Merge branch 'master' into new_output_feature_requests
mgopez a4e13a1
Changed the min tiles threshold to be >5% of expected tiles.
mgopez 8c25ea6
Changed the way mixed subtypes and min tiles are checked and stored.
mgopez 8e5ccf5
#13: Created new simple output file. Added new argument for the path …
mgopez 7c4b2e3
Merge remote-tracking branch 'origin/new_output_feature_requests' int…
mgopez 6768fb7
Adding checking for null input.
mgopez 46c5194
Fixing test data.
mgopez 1e00b97
Refactoring the quality check module.
mgopez 21083f2
Changing warning messages, fixed dead code.
mgopez 8dc2535
Refactoring structure of quality checking.
mgopez f6ff944
Re-re-factoring quality check functions, and added new method
mgopez d7a601b
Adding intuitive messages, fixing bug with no inconsistent subtypes b…
mgopez acaf53b
Minor text fixes
mgopez d2adee9
Adding return type.
mgopez 2d79c64
Adding simplier method for checking if the subtype is there.
mgopez 1aa20ce
Skeleton for re-factored QC methods.
mgopez 76937f4
Skeleton for re-factored QC methods.
mgopez c76bfca
Adding genome coverage for check_missing_tiles.
mgopez 7482582
Created Quality Check module as per Genevieve's requirements.
mgopez bdd55c5
Adding git ignore.
mgopez 5d58710
Corrected quality checking methods.
mgopez 9639236
text fixes
mgopez 285f868
editing git file
mgopez e6af08d
Fixed git ignore.
mgopez 2029087
Changing variable names, adding constants for error types.
mgopez 94d616c
Adding Inconsistent Results Error 3B
mgopez 05ed00d
Adding none checking.
mgopez 3991c0b
WIP: Changing doc strings
mgopez 0b40987
Removing record.txt
mgopez a80bf9b
Changed argument for simple summary to -S
mgopez 9ca4353
Removing nesting within the quality checking methods.
mgopez 43e1914
Change negating.
mgopez 839320f
Added --force, to overwrite existing output files.
mgopez f7a50db
Added SubtypingParams.
mgopez 671e3db
Fixing formatting, created new tests.
mgopez 746989d
Added new arguments.
mgopez 36a7542
Readding test files.
mgopez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -140,3 +140,8 @@ ENV/ | |
# Rope project settings | ||
.ropeproject | ||
|
||
# Output files | ||
match_results.tab | ||
results.tab | ||
test.tab | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
from typing import List, Callable, Tuple | ||
|
||
from pandas import DataFrame | ||
|
||
from ..subtyping_params import SubtypingParams | ||
from ..quality_check.quality_check_functions import check_missing_tiles, does_subtype_result_exist, \ | ||
check_mixed_subtype, check_intermediate_subtype, is_missing_target_sites, is_missing_downstream_targets | ||
from ..quality_check.const import FAIL_MESSAGE, WARNING_MESSAGE | ||
from ..subtype import Subtype | ||
import logging | ||
|
||
|
||
QC_FUNCS = \ | ||
[ | ||
check_missing_tiles, | ||
check_mixed_subtype, | ||
is_missing_target_sites, | ||
is_missing_downstream_targets, | ||
check_intermediate_subtype, | ||
] # type: List[Callable[[Subtype, DataFrame, SubtypingParams], Tuple[str, str]]] | ||
|
||
|
||
def perform_quality_check(st: Subtype, df: DataFrame, subtyping_params: SubtypingParams): | ||
""" Driver method to call all quality checking functions and handle their responses. | ||
Note: | ||
This is the driver method for the quality check module. Every method within the QC_FUNCS list will be run | ||
with parameters ( SUBTYPE, DATAFRAME ). If a quality check module returns something other than None, then | ||
an Error, or Warning has occured. | ||
|
||
Args: | ||
:param st: Subtyping results. | ||
:param df: DataFrame containing subtyping results. | ||
|
||
Returns: | ||
None, modifies the subtype with the result. | ||
""" | ||
logging.debug("Performing Quality Checking") | ||
overall_qc_status = 'PASS' | ||
messages = [] | ||
|
||
if does_subtype_result_exist(st) is False: | ||
logging.warning("QC: Quality checking not run, subtype result did not exist.") | ||
st.qc_status = 'FAIL' | ||
st.qc_message = 'FAIL: Subtype does not exist, quality checking was not run.' | ||
return None | ||
|
||
for func in QC_FUNCS: | ||
# Calls run_method to check that the qc function takes a Subtype, returns Tuple[Optional[str], Optional[str]] | ||
status, message = func(st, df, subtyping_params) | ||
if status is None: | ||
# If quality check function passes, move on to the next. | ||
continue | ||
messages.append('{}: {}'.format(status, message)) | ||
if status is FAIL_MESSAGE: | ||
overall_qc_status = FAIL_MESSAGE | ||
elif overall_qc_status != FAIL_MESSAGE and status == WARNING_MESSAGE: | ||
overall_qc_status = WARNING_MESSAGE | ||
|
||
st.qc_status = overall_qc_status | ||
st.qc_message = ' | '.join(messages) | ||
logging.debug("QC: Finished!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FAIL_MESSAGE = "FAIL" | ||
WARNING_MESSAGE = "WARNING" | ||
# Errors for Hansel | ||
MISSING_TILES_ERROR_1 = "Missing Tiles Error 1" | ||
MIXED_SAMPLE_ERROR_2 = "Mixed Sample Error 2" | ||
AMBIGUOUS_RESULTS_ERROR_3 = "Ambiguous Results Error 3" | ||
NON_CONFIDENT_RESULTS_ERROR_4 = "Non Confident Results Error 4" | ||
INTERMEDIATE_SUBTYPE_WARNING = "Intermediate Subtype Warning" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Please change all imports to
from . import ...
format.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.
It seems when I leave it at
..
instead ofbio_hansel.
PyCharm won't let me run the program. Perhaps this is an error with my setup?