-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parse metrics from smrtlnk datasets file (#3436)(patch)
## Description Closes Clinical-Genomics/add-new-tech#63 Parses the final metrics for PacBio. This last metrics file has a structure different from the previous ones. The desired metrics are not inside an `attributes` section in the json, but in the only existing section. Parsing for the other metrics had to be modified to account for the parsing of this file and make it more DRY. ### Added - Metrics model - Function to parse specifically the smrtlink-datasets file in the metrics parser - Constants for metrics names - Fixture for parsed metrics and fixture file ### Changed - Merged `_parse_report` and `parse_attributes_to_model` methods of the metrics parser into one, called `parse_report_to_model`. - Updated tests of these functions ### Fixed - Implemented `TypeVar` from the `typing` module to better type-hint the different metrics classes, so just typing the parent class (BaseModel from Pydantic)
- Loading branch information
Showing
6 changed files
with
144 additions
and
60 deletions.
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
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
33 changes: 33 additions & 0 deletions
33
...s/devices/pacbio/SMRTcells/r84202_20240522_133539/1_A01/statistics/smrtlink-datasets.json
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,33 @@ | ||
[ | ||
{ | ||
"id": -1, | ||
"uuid": "a662e714-45f2-4cf3-b8d2-c138e1deebd0", | ||
"name": "1247014000119-Cell1", | ||
"path": "/srv/cg_data/pacbio/r84202_20240522_133539/1_A01/pb_formats/m84202_240522_135641_s1.hifi_reads.consensusreadset.xml", | ||
"createdAt": "2024-05-24T02:21:20.970Z", | ||
"updatedAt": "2024-05-24T02:21:20.970Z", | ||
"importedAt": "2024-05-24T02:21:20.970Z", | ||
"numRecords": 6580977, | ||
"totalLength": 106275091861, | ||
"version": "3.0.1", | ||
"comments": "Record generated by runqc-reports", | ||
"tags": "ccs", | ||
"md5": "b1e427a733653fddbad7c273996637f0", | ||
"instrumentName": "Wilma", | ||
"instrumentControlVersion": "13.0.0.212033", | ||
"metadataContextId": "m84202_240522_135641_s1", | ||
"wellSampleName": "1247014000119", | ||
"wellName": "A01", | ||
"bioSampleName": "1247014000119", | ||
"cellIndex": 0, | ||
"cellId": "EA094834", | ||
"runName": "Run 240515", | ||
"createdBy": "admin", | ||
"jobId": -99, | ||
"projectId": -99, | ||
"isActive": true, | ||
"numChildren": 0, | ||
"numResources": 1, | ||
"datasetType": "PacBio.DataSet.ConsensusReadSet" | ||
} | ||
] |
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