Clinical-Genomics / loqusdbapi

A simple REST api for loqusdb
2 stars 0 forks source link

Extend API to handle load #23

Closed Mropat closed 2 years ago

Mropat commented 2 years ago

This PR adds | fixes:

How to prepare for test:

How to test:

-

Expected outcome:

Review:

This version is a:

Mropat commented 2 years ago

When loading same vcf with different petname


{
  "detail": "Exception : Profile of sample ACC9119A3 matches existing profile ACC9119A3"
}
Mropat commented 2 years ago

Successful load

{
  "_id": "61cc51dff7d3c50003afc952",
  "case_id": "rulingking",
  "profile_path": "/home/proj/production/housekeeper-bundles/rulingmite/2021-12-27/rulingmite_gatkcomb.bcf",
  "vcf_path": "/home/proj/production/housekeeper-bundles/rulingmite/2021-12-27/rulingmite_glnex.vcf.gz",
  "vcf_sv_path": "/home/proj/production/housekeeper-bundles/rulingmite/2021-12-27/rulingmite_comb_ann_vep_parsed_ranked.vcf.gz",
  "nr_variants": 4748764,
  "nr_sv_variants": 5594,
  "individuals": [
    {
      "ind_id": "ACC9119A3",
      "case_id": "rulingking",
      "mother": null,
      "father": null,
      "sex": 0,
      "phenotype": null,
      "ind_index": 0,
      "profile": [
        "TT",
        "TT",
        "TT",
        "CC",
        "TT",
        "AG",
        "CT",
        "AA",
        "GA",
        "GA",
        "TC",
        "AA",
        "CT",
        "AG",
        "GG",
        "GA",
        "GA",
        "AG",
        "CA",
        "CC",
        "TT",
        "AA",
        "CC",
        "CC",
        "GG",
        "CC",
        "GG",
        "GA",
        "TT",
        "AG",
        "AC",
        "GT",
        "TT",
        "AA",
        "AA",
        "AG",
        "GG",
        "AA",
        "GG",
        "TT",
        "GA",
        "GG",
        "TT",
        "AA",
        "AA",
        "GG",
        "CT",
        "AG",
        "TC",
        "TT"
      ],
      "similar_samples": []
    }
  ],
  "sv_individuals": [
    {
      "ind_id": "ACC9119A3",
      "case_id": "rulingking",
      "mother": null,
      "father": null,
      "sex": 0,
      "phenotype": null,
      "ind_index": 0,
      "profile": [
        "TT",
        "TT",
        "TT",
        "CC",
        "TT",
        "AG",
        "CT",
        "AA",
        "GA",
        "GA",
        "TC",
        "AA",
        "CT",
        "AG",
        "GG",
        "GA",
        "GA",
        "AG",
        "CA",
        "CC",
        "TT",
        "AA",
        "CC",
        "CC",
        "GG",
        "CC",
        "GG",
        "GA",
        "TT",
        "AG",
        "AC",
        "GT",
        "TT",
        "AA",
        "AA",
        "AG",
        "GG",
        "AA",
        "GG",
        "TT",
        "GA",
        "GG",
        "TT",
        "AA",
        "AA",
        "GG",
        "CT",
        "AG",
        "TC",
        "TT"
      ],
      "similar_samples": []
    }
  ],
  "_inds": {
    "ACC9119A3": {
      "ind_id": "ACC9119A3",
      "case_id": "rulingking",
      "mother": null,
      "father": null,
      "sex": 0,
      "phenotype": null,
      "ind_index": 0,
      "profile": [
        "TT",
        "TT",
        "TT",
        "CC",
        "TT",
        "AG",
        "CT",
        "AA",
        "GA",
        "GA",
        "TC",
        "AA",
        "CT",
        "AG",
        "GG",
        "GA",
        "GA",
        "AG",
        "CA",
        "CC",
        "TT",
        "AA",
        "CC",
        "CC",
        "GG",
        "CC",
        "GG",
        "GA",
        "TT",
        "AG",
        "AC",
        "GT",
        "TT",
        "AA",
        "AA",
        "AG",
        "GG",
        "AA",
        "GG",
        "TT",
        "GA",
        "GG",
        "TT",
        "AA",
        "AA",
        "GG",
        "CT",
        "AG",
        "TC",
        "TT"
      ],
      "similar_samples": []
    }
  },
  "_sv_inds": {
    "ACC9119A3": {
      "ind_id": "ACC9119A3",
      "case_id": "rulingking",
      "mother": null,
      "father": null,
      "sex": 0,
      "phenotype": null,
      "ind_index": 0,
      "profile": [
        "TT",
        "TT",
        "TT",
        "CC",
        "TT",
        "AG",
        "CT",
        "AA",
        "GA",
        "GA",
        "TC",
        "AA",
        "CT",
        "AG",
        "GG",
        "GA",
        "GA",
        "AG",
        "CA",
        "CC",
        "TT",
        "AA",
        "CC",
        "CC",
        "GG",
        "CC",
        "GG",
        "GA",
        "TT",
        "AG",
        "AC",
        "GT",
        "TT",
        "AA",
        "AA",
        "AG",
        "GG",
        "AA",
        "GG",
        "TT",
        "GA",
        "GG",
        "TT",
        "AA",
        "AA",
        "GG",
        "CT",
        "AG",
        "TC",
        "TT"
      ],
      "similar_samples": []
    }
  }
}
Mropat commented 2 years ago

When deleting case where file no longer on disk:

{
  "detail": "Error OSError: No such file:/home/proj/production/housekeeper-bundles/tidykid/2019-06-17/tidykid_sorted_md_brecal_haptc_vrecal_comb_rhocall_vt_frqf_vep_parsed_snpeff_ranked_BOTH.vcf.gz; Case may be partially deleted"
}

Case will be deleted Variants will remain in the db