diff options
author | Hui Lan <lanhui@zjnu.edu.cn> | 2020-10-27 16:51:28 +0800 |
---|---|---|
committer | Hui Lan <lanhui@zjnu.edu.cn> | 2020-10-27 16:51:28 +0800 |
commit | b0623e73c689e8ceb321cc374deb05df693c734f (patch) | |
tree | f15121e25ef0586a31965daa9f680e69130ad756 /Code/buildRmatrix.py | |
parent | 2c291bc68270c0f4046715ed15cec80827c58840 (diff) |
buildRmatrix.py: use a string to store the max expression level from isoforms.
Diffstat (limited to 'Code/buildRmatrix.py')
-rw-r--r-- | Code/buildRmatrix.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Code/buildRmatrix.py b/Code/buildRmatrix.py index c671f2a..4557993 100644 --- a/Code/buildRmatrix.py +++ b/Code/buildRmatrix.py @@ -74,16 +74,17 @@ def make_expression_dict(fname, myid): # make the dictionary smaller by using a string instead of a double-precision float number, so it requires less memory. Cut from 7.44G to 6.5G for 1003 TPM files.
for g in d['isoform']:
- d['isoform'][g] = '%4.2f' % get_max_expressed_isoform(g, d)
+ d['isoform'][g] = '%s' % get_max_expressed_isoform_save_space(g, d)
return d
def get_max_expressed_isoform_save_space(g, d):
- ''' Evloved from get_max_expressed_isoform(g, d) '''
+ ''' Evolved from get_max_expressed_isoform(g, d) '''
if not g in d['isoform']:
return '-9'
- return d['isoform'][g]
+ lst = d['isoform'][g]
+ return '%4.2f' % max(lst)
def save_TPM_table(gene_lst, dict_lst, fname):
|