From b0b77baaa6a1625ff34824120cdd9e0c5f9162ef Mon Sep 17 00:00:00 2001 From: Akazhiel Date: Mon, 22 Feb 2021 16:20:33 +0100 Subject: [PATCH] Fixed rpk calculation --- merge_results.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/merge_results.py b/merge_results.py index ebb1da6..11f6138 100644 --- a/merge_results.py +++ b/merge_results.py @@ -97,8 +97,8 @@ def main(dna_variants, counts = counts_table.iloc[:, 6].to_numpy() counts_filtered = list(filter(lambda x: x != 0, counts)) lengths = counts_table['Length'].to_numpy() - rpk = genes / lengths - counts_table['RPKM'] = (rpk / sum(genes)) * 1e9 + rpk = counts / lengths + counts_table['RPKM'] = (rpk / sum(counts)) * 1e9 counts_table['TPM'] = (rpk / sum(rpk)) * 1e6 gene_counts = counts_table.iloc[:, [0, 6]].values.tolist() for gene, expr in gene_counts: