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

Replace hardcoded validation cases #2645

Merged
merged 9 commits into from
Oct 31, 2023
Merged

Conversation

seallard
Copy link
Contributor

@seallard seallard commented Oct 30, 2023

Description

This PR replaces the hard coded case id:s in cg that should be ignored with a database field. Closes #2607.

TODO:

  • Add revision with is_compressible
  • Update logic to check the is_compressible field
  • Write test to verify that cases marked as not compressible are ignored.
  • Write script to set is_compressible to false for all validation cases. Store comments on case.
  • Apply revision to stage and run script. Verify that it works.
  • Merge and do the same for prod

Changed

  • Use is_compressible field instead of hard coded cases to ignore

This version is a

  • PATCH - when you make backwards compatible bug fixes or documentation/instructions

@seallard seallard requested a review from a team as a code owner October 30, 2023 15:21
@seallard seallard changed the title Replace hardcoded validation case id:s Replace hardcoded validation cases Oct 30, 2023
@seallard
Copy link
Contributor Author

Script to mark validation cases in status db

from cg.store.api.core import Store
from cg.store.database import initialize_database

PROBLEMATIC_CASES = [
    ("causalmite", ""),
    ("deepcub", ""),
    ("expertalien", ""),
    ("fluenteagle", ""),
    ("grandkoi", ""),
    ("lovingmayfly", ""),
    ("loyalegret", ""),
    ("modernbee", ""),
    ("proudcollie", ""),
    ("richalien", ""),
    ("suremako", ""),
    ("wisestork", ""),
]

BALSAMIC_VALIDATION_CASES = [
    ("setamoeba", "BALSAMIC validation case tumor-only panel"),
    ("sweetelf", "BALSAMIC positive control tumor-only panel"),
    ("poeticghoul", "BALSAMIC positive control tumor-only panel"),
    ("equalbug", "UMI seracare validation case (AF 0.5%) tumor-normal panel"),
    ("stableraven", "UMI seracare validation case (AF 1%) tumor-normal panel"),
    ("uphippo", "UMI seracare validation case (AF 0.5%) tumor-only panel"),
    ("cleanfowl", "BALSAMIC validation case, HD829 reference for FLT3 Ascertation"),
    ("proudsquid", "BALSAMIC validation case, HD829 reference for FLT3 Ascertation"),
    ("modestjaguar", "BALSAMIC validation case, HD829 reference for FLT3 Ascertation"),
    ("dearmarmot", "BALSAMIC validation case, HD829 reference for FLT3 Ascertation"),
    ("holykid", "BALSAMIC validation case, HD829 reference for FLT3 Ascertation"),
    ("civilsole", "BALSAMIC validation case tumor-only wgs"),
    ("fleetjay", "BALSAMIC validation case tumor-normal wgs"),
    ("grandmarmot", "BALSAMIC validation case tumor-normal wgs"),
    ("unitedbeagle", "BALSAMIC validation case tumor-normal panel"),
    ("rightthrush", "BALSAMIC validation case tumor-only wes"),
    ("properpigeon", "BALSAMIC validation case tumor-normal wes"),
    ("eagerox", "BALSAMIC validation case from cust087, tumor-only panel"),
    ("casualweasel", "BALSAMIC validation case from cust087, tumor-only panel"),
    ("acetuna", "BALSAMIC validation case from cust087, tumor-only panel"),
    ("suitedsnake", "BALSAMIC validation case from cust087, tumor-only panel"),
    ("savinghorse", "BALSAMIC validation case from cust087, tumor-only panel"),
    ("rightpup", "BALSAMIC validation case from cust087, tumor-only panel"),
    ("sureroughy", "BALSAMIC validation case from cust087, tumor-only panel"),
    (
        "notedshark",
        "BALSAMIC validation case from cust127, tumor-normal WGS (SV inversion positive control)",
    ),
    (
        "wholewhale",
        "BALSAMIC validation case from cust143, tumor-normal WGS (SV translocation positive control)",
    ),
    (
        "largeturtle",
        "BALSAMIC validation case from cust143, tumor-normal WGS (SV translocation positive control)",
    ),
    (
        "lightkodiak",
        "BALSAMIC validation case from cust143, tumor-normal WGS (SV inversion positive control)",
    ),
    (
        "wholecivet",
        "BALSAMIC validation case from cust110, tumor-normal WGS (SV inversion positive control)",
    ),
    (
        "upwardstork",
        "BALSAMIC validation case from cust110, tumor-normal WGS (SV deletion positive control)",
    ),
    (
        "suitedgrub",
        "BALSAMIC validation case from cust110, tumor-normal WGS (SV deletion positive control)",
    ),
]

FLUFFY_VALIDATION_CASES = [("simplesalmon", "Chromosome 13, 18, 21 Suspected")]

MIP_VALIDATION_CASES = [
    ("brightcaiman", "DNA rare disease positive control"),
    ("casualgannet", "DNA rare disease positive control"),
    ("civilkoala", "RNA rare disease positive control"),
    ("cleanshrimp", "DNA rare disease positive control"),
    ("drivenmolly", "RNA rare disease positive control"),
    ("easybeetle", "DNA rare disease positive control"),
    ("epicasp", "DNA rare disease positive control"),
    ("expertmole", "RNA rare disease positive control"),
    ("finequagga", "RNA rare disease positive control"),
    ("firstfawn", "DNA rare disease positive control"),
    ("gladthrush", "DNA rare disease positive control"),
    ("helpedfilly", "DNA rare disease positive control"),
    ("hotskink", "DNA rare disease positive control"),
    ("inferret", "DNA rare disease positive control"),
    ("intentcorgi", "DNA rare disease positive control"),
    ("intentmayfly", "DNA rare disease positive control"),
    ("justhusky", "DNA rare disease positive control"),
    ("kindcaiman", "DNA rare disease positive control"),
    ("lightprawn", "DNA rare disease positive control"),
    ("livingox", "DNA rare disease positive control"),
    ("newaphid", "RNA rare disease positive control"),
    ("nextjackal", "DNA rare disease positive control"),
    ("modernmule", "DNA rare disease positive control"),
    ("moralcattle", "RNA rare disease positive control"),
    ("onemite", "DNA rare disease positive control"),
    ("opencow", "DNA rare disease positive control"),
    ("proudcougar", "DNA rare disease positive control"),
    ("rightmacaw", "DNA rare disease positive control"),
    ("safeguinea", "DNA rare disease positive control"),
    ("sharpparrot", "RNA rare disease positive control"),
    ("sharppigeon", "DNA rare disease positive control"),
    ("sharpwhale", "DNA rare disease positive control"),
    ("stillant", "DNA rare disease positive control"),
    ("smoothboa", "RNA rare disease positive control"),
    ("strongbison", "DNA rare disease positive control"),
    ("tenderoriole", "DNA rare disease positive control"),
    ("topsrhino", "DNA rare disease positive control"),
    ("usablemarten", "DNA rare disease positive control"),
    ("vitalmouse", "DNA rare disease positive control"),
]

RNAFUSION_VALIDATION_CASES = [
    ("ableheron", ""),
    ("acecoyote", ""),
    ("ampleray", ""),
    ("bossmink", ""),
    ("cuddlyhen", ""),
    ("daringowl", ""),
    ("expertboar", ""),
    ("finerracer", ""),
    ("growndoe", ""),
    ("guidedfeline", ""),
    ("handyturtle", ""),
    ("hardygrouse", ""),
    ("holyrodent", ""),
    ("honestswine", ""),
    ("inlab", ""),
    ("justburro", ""),
    ("movedmule", ""),
    ("nearbyjoey", ""),
    ("oncrab", ""),
    ("politeglider", ""),
    ("rareosprey", ""),
    ("rightmoray", ""),
    ("stablemoray", ""),
    ("starnewt", ""),
    ("tendergoose", ""),
    ("truemole", ""),
    ("truepigeon", ""),
    ("valuedfowl", ""),
    ("vocallocust", ""),
    ("wantedsawfly", ""),
]

TAXPROFILER_VALIDATION_CASES = [("richurchin", "")]

OTHER_VALIDATION_CASES = [
    ("bigdrum", ""),
    ("busycolt", ""),
    ("daringpony", ""),
    ("frankhusky", ""),
    ("gamedeer", ""),
    ("hotviper", ""),
    ("keencalf", ""),
    ("keenviper", ""),
    ("luckyhog", ""),
    ("maturejay", "sars-cov-2 case"),
    ("meetpossum", ""),
    ("mintbaboon", ""),
    ("mintyeti", ""),
    ("proeagle", ""),
    ("propercoral", ""),
    ("pumpedcat", ""),
    ("strongman", ""),
    ("truecoyote", ""),
]


CASES_TO_IGNORE = (
    PROBLEMATIC_CASES
    + OTHER_VALIDATION_CASES
    + BALSAMIC_VALIDATION_CASES
    + FLUFFY_VALIDATION_CASES
    + MIP_VALIDATION_CASES
    + RNAFUSION_VALIDATION_CASES
    + TAXPROFILER_VALIDATION_CASES
)

def mark_validation_case(case_id: str, case_description: str, store: Store):
    """Update validation case in database."""

    case = store.get_case_by_internal_id(case_id)
    
    if case:
        case.is_compressible = False

        if case.comment and case_description:
            case.comment += f" {case_description}"
        else:
            case.comment = case_description
    else:
        print(f"Case {case_id} not found.")


if __name__ == "__main__":
    initialize_database("status_db_uri_here")
    store = Store()

    for case in CASES_TO_IGNORE:
        case_id, case_description = case
        mark_validation_case(case_id, case_description, store)

    store.session.commit()

Copy link
Contributor

@diitaz93 diitaz93 left a comment

Choose a reason for hiding this comment

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

Amazing 🔥

Copy link
Contributor

@islean islean 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 remove the validation ids in this PR? Would we not want "alembic migration -> set not compressible -> remove validation ids"?

Copy link
Contributor

@islean islean left a comment

Choose a reason for hiding this comment

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

Looks nice 🤩

Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@seallard
Copy link
Contributor Author

seallard commented Oct 31, 2023

Tested in stage and verified that the cases were updated as expected with

SELECT * FROM family WHERE internal_id IN (
  'causalmite', 'deepcub', 'expertalien', 'fluenteagle', 'grandkoi', 'lovingmayfly', 'loyalegret',
  'modernbee', 'proudcollie', 'richalien', 'suremako', 'wisestork',
  'setamoeba', 'sweetelf', 'poeticghoul', 'equalbug', 'stableraven', 'uphippo', 'cleanfowl',
  'proudsquid', 'modestjaguar', 'dearmarmot', 'holykid', 'civilsole', 'fleetjay', 'grandmarmot',
  'unitedbeagle', 'rightthrush', 'properpigeon', 'eagerox', 'casualweasel', 'acetuna', 'suitedsnake',
  'savinghorse', 'rightpup', 'sureroughy', 'notedshark', 'wholewhale', 'largeturtle', 'lightkodiak',
  'wholecivet', 'upwardstork', 'suitedgrub', 'simplesalmon', 'brightcaiman', 'casualgannet', 'civilkoala',
  'cleanshrimp', 'drivenmolly', 'easybeetle', 'epicasp', 'expertmole', 'finequagga', 'firstfawn',
  'gladthrush', 'helpedfilly', 'hotskink', 'inferret', 'intentcorgi', 'intentmayfly', 'justhusky',
  'kindcaiman', 'lightprawn', 'livingox', 'newaphid', 'nextjackal', 'modernmule', 'moralcattle',
  'onemite', 'opencow', 'proudcougar', 'rightmacaw', 'safeguinea', 'sharpparrot', 'sharppigeon',
  'sharpwhale', 'stillant', 'smoothboa', 'strongbison', 'tenderoriole', 'topsrhino', 'usablemarten',
  'vitalmouse', 'ableheron', 'acecoyote', 'ampleray', 'bossmink', 'cuddlyhen', 'daringowl', 'expertboar',
  'finerracer', 'growndoe', 'guidedfeline', 'handyturtle', 'hardygrouse', 'holyrodent', 'honestswine',
  'inlab', 'justburro', 'movedmule', 'nearbyjoey', 'oncrab', 'politeglider', 'rareosprey', 'rightmoray',
  'stablemoray', 'starnewt', 'tendergoose', 'truemole', 'truepigeon', 'valuedfowl', 'vocallocust',
  'wantedsawfly', 'richurchin', 'bigdrum', 'busycolt', 'daringpony', 'frankhusky', 'gamedeer',
  'hotviper', 'keencalf', 'keenviper', 'luckyhog', 'maturejay', 'meetpossum', 'mintbaboon',
  'mintyeti', 'proeagle', 'propercoral', 'pumpedcat', 'strongman', 'truecoyote'
);

Same in prod, looks fine. Deployed to Hasta prod.

@seallard seallard merged commit e9b0108 into master Oct 31, 2023
@seallard seallard deleted the remove-hard-coded-validation-cases branch October 31, 2023 14:35
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.

Remove hard coded validation cases
3 participants