|
| 1 | +#!/usr/bin/env python3 |
| 2 | + |
| 3 | +""" |
| 4 | +{ |
| 5 | + "id": "fqr.01JJY7P1AVFGHGVMEDE8T4VWJG", |
| 6 | + "rgid": "ATCCACTG+ACGCACCT.2", |
| 7 | + "index": "ATCCACTG", |
| 8 | + "index2": "ACGCACCT", |
| 9 | + "lane": 2, |
| 10 | + "instrumentRunId": "230223_A00130_0244_AHN3W3DSX5", |
| 11 | + "library": { |
| 12 | + "orcabusId": "lib.01JBMVFP45C2EZRVK67P8JY1D2", |
| 13 | + "libraryId": "L2300223" |
| 14 | + }, |
| 15 | + "readSet": { |
| 16 | + "r1": { |
| 17 | + "s3IngestId": "019387bd-2494-7c00-9e41-03e8b6a73306", |
| 18 | + "gzipCompressionSizeInBytes": 49532847794, |
| 19 | + "rawMd5sum": "19e339fdb3c42f0133f5f3b1f9d188e0", // pragma: allowlist secret |
| 20 | + "s3Uri": "s3://archive-prod-fastq-503977275616-ap-southeast-2/v1/year=2023/month=02/230223_A00130_0244_AHN3W3DSX5/202411226f4f7af0/WGS_TsqNano/MDX230039_L2300223_S7_L002_R1_001.fastq.ora" |
| 21 | + }, |
| 22 | + "r2": { |
| 23 | + "s3IngestId": "019387bd-9177-79c1-a489-d940ecc11b11", |
| 24 | + "gzipCompressionSizeInBytes": 53189277581, |
| 25 | + "rawMd5sum": "e857de35a8ca008589d24b2e0f647cc7", // pragma: allowlist secret |
| 26 | + "s3Uri": "s3://archive-prod-fastq-503977275616-ap-southeast-2/v1/year=2023/month=02/230223_A00130_0244_AHN3W3DSX5/202411226f4f7af0/WGS_TsqNano/MDX230039_L2300223_S7_L002_R2_001.fastq.ora" |
| 27 | + }, |
| 28 | + "compressionFormat": "ORA" |
| 29 | + }, |
| 30 | + "qc": null, |
| 31 | + "readCount": null, |
| 32 | + "baseCountEst": null, |
| 33 | + "isValid": true, |
| 34 | + "ntsm": null |
| 35 | +} |
| 36 | +""" |
| 37 | + |
| 38 | +from typing import ( |
| 39 | + TypedDict, |
| 40 | + Optional, |
| 41 | + Dict, |
| 42 | + List |
| 43 | +) |
| 44 | + |
| 45 | + |
| 46 | +class FileStorageObject(TypedDict): |
| 47 | + s3IngestId: str |
| 48 | + s3Uri: str |
| 49 | + |
| 50 | + |
| 51 | +class FastqStorageObject(FileStorageObject): |
| 52 | + gzipCompressionSizeInBytes: int |
| 53 | + rawMd5sum: str |
| 54 | + |
| 55 | + |
| 56 | +class ReadSet(TypedDict): |
| 57 | + r1: FastqStorageObject |
| 58 | + r2: FastqStorageObject |
| 59 | + compressionFormat: str |
| 60 | + |
| 61 | + |
| 62 | +class Library(TypedDict): |
| 63 | + orcabusId: str |
| 64 | + libraryId: str |
| 65 | + |
| 66 | + |
| 67 | +class FastqListRow(TypedDict): |
| 68 | + id: str |
| 69 | + index: str |
| 70 | + lane: int |
| 71 | + instrumentRunId: str |
| 72 | + library: Library |
| 73 | + readSet: Optional[ReadSet] |
| 74 | + qc: Optional[Dict] |
| 75 | + readCount: Optional[int] |
| 76 | + baseCountEst: Optional[int] |
| 77 | + isValid: Optional[bool] |
| 78 | + ntsm: Optional[FileStorageObject] |
| 79 | + |
| 80 | + |
| 81 | +class FastqSet(TypedDict): |
| 82 | + id: str |
| 83 | + library: Library |
| 84 | + fastqSet: List[FastqListRow] |
| 85 | + allowAdditionalFastq: bool |
| 86 | + isCurrentFastqSet: bool |
| 87 | + |
| 88 | + |
| 89 | +class QcStats(TypedDict): |
| 90 | + insertSizeEstimate: int |
| 91 | + rawWgsCoverageEstimate: int |
| 92 | + r1Q20Fraction: float |
| 93 | + r2Q20Fraction: float |
| 94 | + r1GcFraction: float |
| 95 | + r2GcFraction: float |
| 96 | + |
| 97 | + |
| 98 | +class ReadCount(TypedDict): |
| 99 | + readCount: int |
| 100 | + baseCountEst: int |
| 101 | + |
| 102 | + |
| 103 | +class FileCompressionInformation(TypedDict): |
| 104 | + compressionFormat: str |
| 105 | + r1GzipCompressionSizeInBytes: Optional[int] |
| 106 | + r2GzipCompressionSizeInBytes: Optional[int] |
| 107 | + r1RawMd5sum: Optional[int] |
| 108 | + r2RawMd5sum: Optional[int] |
| 109 | + |
| 110 | + |
| 111 | +CWLFile = TypedDict('CWLFile', { |
| 112 | + 'class': str, |
| 113 | + 'location': str |
| 114 | +}) |
| 115 | + |
| 116 | + |
| 117 | +class CWLDict(TypedDict): |
| 118 | + rgid: str |
| 119 | + index: str |
| 120 | + index2: Optional[str] |
| 121 | + lane: int |
| 122 | + read_1: CWLFile |
| 123 | + read_2: CWLFile |
0 commit comments