Skip to content

Commit 75f1cb0

Browse files
committed
Add HTML warning flag for mapping rate
1 parent 741dcbc commit 75f1cb0

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/qcatch/convert_to_html.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,15 @@ def create_plotly_plots(
8888
mapping_rate = None
8989
if map_json_data:
9090
num_processed = map_json_data.get("num_processed") or map_json_data["num_reads"]
91-
mapping_rate = round(map_json_data["num_mapped"] / num_processed * 100, 2)
91+
if num_processed and map_json_data.get("num_mapped"):
92+
mapping_rate = round(map_json_data["num_mapped"] / num_processed * 100, 2)
93+
if mapping_rate < 60: # less than 60% mapping rate
94+
msg = "High-quality datasets typically exhibit a mapping rate of around 90%. In this dataset, the mapping rate is below 60%, which may indicate a mismatch between the sample and the reference -- often due to sample contamination or using an inappropriate reference transcriptome."
95+
logger.record_warning(msg)
96+
elif mapping_rate < 80: # less than 80% mapping rate
97+
msg = "High-quality datasets typically exhibit a mapping rate of around 90%. In this dataset, the mapping rate is below 80%, which may indicate low data quality."
98+
logger.record_warning(msg)
99+
92100
seq_saturation_value = generate_seq_saturation(retained_data)
93101

94102
export_summary_table = args.export_summary_table

src/qcatch/find_retained_cells/cell_calling.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
MAX_RECOVERED_CELLS = 2621448 # 2^18
2929
NP_SORT_KIND = "stable"
3030

31-
3231
# Number of partitions (max number of barcodes to consider for ambient estimation)1
3332
N_PARTITIONS = 90000
3433

0 commit comments

Comments
 (0)