From d527fc72744b5ff16c8e5df2a60ead9829926165 Mon Sep 17 00:00:00 2001 From: ploy-np Date: Thu, 4 Mar 2021 10:37:08 +0000 Subject: [PATCH] read_index nan --- xpore/scripts/dataprep.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xpore/scripts/dataprep.py b/xpore/scripts/dataprep.py index 4eaeffd..8c303ae 100644 --- a/xpore/scripts/dataprep.py +++ b/xpore/scripts/dataprep.py @@ -59,7 +59,11 @@ def index(eventalign_result,pos_start,out_paths,locks): for index in list(dict.fromkeys(eventalign_result.index)): transcript_id,read_index = index pos_end += eventalign_result.loc[index]['line_length'].sum() - f_index.write('%s,%d,%d,%d\n' %(transcript_id,read_index,pos_start,pos_end)) + + try: # sometimes read_index is nan + f_index.write('%s,%d,%d,%d\n' %(transcript_id,read_index,pos_start,pos_end)) + except: + pass pos_start = pos_end def parallel_index(eventalign_filepath,summary_filepath,chunk_size,out_dir,n_processes,resume):