|
| 1 | +import numpy as np |
| 2 | +from checkQC.parsers.illumina import _read_interop_summary |
| 3 | + |
| 4 | + |
| 5 | +def bclconvert_test_runfolder(qc_data, runfolder_path): |
| 6 | + _, _, run_info = _read_interop_summary(runfolder_path) |
| 7 | + flowcell_id = run_info.flowcell_id() |
| 8 | + if "HMTFYDRXX" in flowcell_id: |
| 9 | + return { |
| 10 | + "qc_data": qc_data, |
| 11 | + "expected_instrument": "novaseq_SP", |
| 12 | + "expected_read_length": 36, |
| 13 | + "expected_samplesheet": { |
| 14 | + "len": 4, |
| 15 | + "head": [ |
| 16 | + { |
| 17 | + "lane": 1, |
| 18 | + "sample_id": "Sample_14574-Qiagen-IndexSet1-SP-Lane1", |
| 19 | + "index": "GAACTGAGCG", |
| 20 | + "index2": "TCGTGGAGCG", |
| 21 | + "sample_project": "AB-1234", |
| 22 | + "overridecycles": "Y36;I10;I10", |
| 23 | + "custom_description": "LIBRARY_NAME:test", |
| 24 | + }, |
| 25 | + { |
| 26 | + "lane": 1, |
| 27 | + "sample_id": "Sample_14575-Qiagen-IndexSet1-SP-Lane1", |
| 28 | + "index": "AGGTCAGATA", |
| 29 | + "index2": "CTACAAGATA", |
| 30 | + "sample_project": "CD-5678", |
| 31 | + "overridecycles": "Y36;I10;I10", |
| 32 | + "custom_description": "LIBRARY_NAME:test", |
| 33 | + }, |
| 34 | + { |
| 35 | + "lane": 2, |
| 36 | + "sample_id": "Sample_14574-Qiagen-IndexSet1-SP-Lane2", |
| 37 | + "index": "GAACTGAGCG", |
| 38 | + "index2": "TCGTGGAGCG", |
| 39 | + "sample_project": "AB-1234", |
| 40 | + "overridecycles": "Y36;I10;I10", |
| 41 | + "custom_description": "LIBRARY_NAME:test", |
| 42 | + }, |
| 43 | + { |
| 44 | + "lane": 2, |
| 45 | + "sample_id": "Sample_14575-Qiagen-IndexSet1-SP-Lane2", |
| 46 | + "index": "AGGTCAGATA", |
| 47 | + "index2": "CTACAAGATA", |
| 48 | + "sample_project": "CD-5678", |
| 49 | + "overridecycles": "Y36;I10;I10", |
| 50 | + "custom_description": "LIBRARY_NAME:test", |
| 51 | + }, |
| 52 | + ], |
| 53 | + }, |
| 54 | + "expected_sequencing_metrics": { |
| 55 | + 1: { |
| 56 | + "total_reads_pf": 532_464_327, |
| 57 | + "total_reads": 638_337_024, |
| 58 | + "raw_density": 2_961_270.5, |
| 59 | + "pf_density": 2_470_118.25, |
| 60 | + "yield": 122_605_416, |
| 61 | + "yield_undetermined": 121_940_136, |
| 62 | + "top_unknown_barcodes": { |
| 63 | + "len": 1029, |
| 64 | + "head": [ |
| 65 | + { |
| 66 | + 'index': 'ATATCTGCTT', 'index2': 'TAGACAATCT', |
| 67 | + 'count': 12857, |
| 68 | + }, |
| 69 | + { |
| 70 | + 'index': 'CACCTCTCTT', 'index2': 'CTCGACTCCT', |
| 71 | + 'count': 12406, |
| 72 | + }, |
| 73 | + { |
| 74 | + 'index': 'ATGTAACGTT', 'index2': 'ACGATTGCTG', |
| 75 | + 'count': 12177, |
| 76 | + }, |
| 77 | + { |
| 78 | + 'index': 'TTCGGTGTGA', 'index2': 'GAACAAGTAT', |
| 79 | + 'count': 11590, |
| 80 | + }, |
| 81 | + { |
| 82 | + 'index': 'GGTCCGCTTC', 'index2': 'CTCACACAAG', |
| 83 | + 'count': 11509, |
| 84 | + }, |
| 85 | + ], |
| 86 | + }, |
| 87 | + "reads": { |
| 88 | + 1: { |
| 89 | + "mean_error_rate": np.nan, |
| 90 | + "percent_q30": 95.70932006835938, |
| 91 | + "is_index": False, |
| 92 | + "mean_percent_phix_aligned": 0., |
| 93 | + }, |
| 94 | + 2: { |
| 95 | + "mean_error_rate": np.nan, |
| 96 | + "percent_q30": 92.57965850830078, |
| 97 | + "is_index": True, |
| 98 | + "mean_percent_phix_aligned": np.nan, |
| 99 | + }, |
| 100 | + 3: { |
| 101 | + "mean_error_rate": np.nan, |
| 102 | + "percent_q30": 90.3790283203125, |
| 103 | + "is_index": True, |
| 104 | + "mean_percent_phix_aligned": np.nan, |
| 105 | + }, |
| 106 | + }, |
| 107 | + "reads_per_sample": [ |
| 108 | + { |
| 109 | + "sample_id": "Sample_14574-Qiagen-IndexSet1-SP-Lane1", |
| 110 | + "cluster_count": 9920, |
| 111 | + "percent_of_lane": 0.29, |
| 112 | + "percent_perfect_index_reads": 97.96, |
| 113 | + "mean_q30": 36.37, |
| 114 | + "percent_q30": 96, |
| 115 | + }, |
| 116 | + { |
| 117 | + "sample_id": "Sample_14575-Qiagen-IndexSet1-SP-Lane1", |
| 118 | + "cluster_count": 8560, |
| 119 | + "percent_of_lane": 0.25, |
| 120 | + "percent_perfect_index_reads": 98.15, |
| 121 | + "mean_q30": 36.43, |
| 122 | + "percent_q30": 96, |
| 123 | + }, |
| 124 | + ], |
| 125 | + }, |
| 126 | + 2: { |
| 127 | + "total_reads_pf": 530_917_565, |
| 128 | + "total_reads": 638_337_024, |
| 129 | + "raw_density": 2_961_270.5, |
| 130 | + "pf_density": 2_462_942.5, |
| 131 | + "yield": 124_497_108, |
| 132 | + "yield_undetermined": 123_817_428, |
| 133 | + "top_unknown_barcodes": { |
| 134 | + "len": 1055, |
| 135 | + "head": [ |
| 136 | + { |
| 137 | + 'index': 'ATATCTGCTT', 'index2': 'TAGACAATCT', |
| 138 | + 'count': 13176, |
| 139 | + }, |
| 140 | + { |
| 141 | + 'index': 'ATGTAACGTT', 'index2': 'ACGATTGCTG', |
| 142 | + 'count': 12395, |
| 143 | + }, |
| 144 | + { |
| 145 | + 'index': 'CACCTCTCTT', 'index2': 'CTCGACTCCT', |
| 146 | + 'count': 12247, |
| 147 | + }, |
| 148 | + { |
| 149 | + 'index': 'TTCGGTGTGA', 'index2': 'GAACAAGTAT', |
| 150 | + 'count': 11909, |
| 151 | + }, |
| 152 | + { |
| 153 | + 'index': 'TAATTAGCGT', 'index2': 'TGGTTAAGAA', |
| 154 | + 'count': 11330, |
| 155 | + }, |
| 156 | + ], |
| 157 | + }, |
| 158 | + "reads": { |
| 159 | + 1: { |
| 160 | + "mean_error_rate": np.nan, |
| 161 | + "percent_q30": 95.75276184082031, |
| 162 | + "is_index": False, |
| 163 | + "mean_percent_phix_aligned": 0., |
| 164 | + }, |
| 165 | + 2: { |
| 166 | + "mean_error_rate": np.nan, |
| 167 | + "percent_q30": 92.60448455810547, |
| 168 | + "is_index": True, |
| 169 | + "mean_percent_phix_aligned": np.nan, |
| 170 | + }, |
| 171 | + 3: { |
| 172 | + "mean_error_rate": np.nan, |
| 173 | + "percent_q30": 90.2811050415039, |
| 174 | + "is_index": True, |
| 175 | + "mean_percent_phix_aligned": np.nan, |
| 176 | + }, |
| 177 | + }, |
| 178 | + "reads_per_sample": [ |
| 179 | + { |
| 180 | + "sample_id": "Sample_14574-Qiagen-IndexSet1-SP-Lane2", |
| 181 | + "cluster_count": 10208, |
| 182 | + "percent_of_lane": 0.3, |
| 183 | + "percent_perfect_index_reads": 98.2, |
| 184 | + "mean_q30": 36.4, |
| 185 | + "percent_q30": 96, |
| 186 | + }, |
| 187 | + { |
| 188 | + "sample_id": "Sample_14575-Qiagen-IndexSet1-SP-Lane2", |
| 189 | + "cluster_count": 8672, |
| 190 | + "percent_of_lane": 0.25, |
| 191 | + "percent_perfect_index_reads": 98.29, |
| 192 | + "mean_q30": 36.48, |
| 193 | + "percent_q30": 97, |
| 194 | + }, |
| 195 | + ], |
| 196 | + }, |
| 197 | + }, |
| 198 | + } |
| 199 | + else: |
| 200 | + raise Exception( |
| 201 | + "This function is only compatible with the run with flowcell_id: 'HMTFYDRXX', " |
| 202 | + f"the supplied runfolder has flowcell_id: {flowcell_id}" |
| 203 | + ) |
| 204 | + |
0 commit comments