summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLan Hui <lanhui@zjnu.edu.cn>2025-05-13 15:40:05 +0800
committerLan Hui <lanhui@zjnu.edu.cn>2025-05-13 15:40:05 +0800
commitf6fb6ee751fee3d2cfa58232fbaffa8f2b6cdf9d (patch)
treeb73cd077c9c90cd1f1ed3104e4303b2bae2dbf43
parent663921a828b9f419a1892edfec190f5e07c6d55a (diff)
Deal with the case where the quant file is empty (0 KB)
-rw-r--r--Code/make_parameter_rnaseq.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Code/make_parameter_rnaseq.py b/Code/make_parameter_rnaseq.py
index f9c7d26..e7b971e 100644
--- a/Code/make_parameter_rnaseq.py
+++ b/Code/make_parameter_rnaseq.py
@@ -84,6 +84,8 @@ def non_zero_ratio(fname):
if not tpm == '0' and not 'nan' in tpm:
non_zero_count += 1
total_count += 1
+ if total_count < 1:
+ return 0.0
return 1.0 * non_zero_count / total_count
def get_rna_word_count(s):