From 740d2eff8777933a75d3fa474cef9daa70e14857 Mon Sep 17 00:00:00 2001 From: "Gervaise H. Henry" <gervaise.henry@utsouthwestern.edu> Date: Tue, 4 Aug 2020 09:12:47 -0500 Subject: [PATCH] Round median TIN to 2 dp --- workflow/conf/multiqc_config.yaml | 8 +++++--- workflow/scripts/tinHist.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/workflow/conf/multiqc_config.yaml b/workflow/conf/multiqc_config.yaml index 1f3c650..5a6d3d6 100644 --- a/workflow/conf/multiqc_config.yaml +++ b/workflow/conf/multiqc_config.yaml @@ -80,9 +80,11 @@ custom_data: Ends Stranded Spike-in - Read Length - TIN - tin: + Read Length: + format: '{:,.0f}' + TIN: + format: '{:+.1f}' + file_format: 'tsv' section_name: 'TIN' description: 'This is the distribution of TIN values calculated by the tool RSeQC' diff --git a/workflow/scripts/tinHist.py b/workflow/scripts/tinHist.py index e97b120..3d292c2 100644 --- a/workflow/scripts/tinHist.py +++ b/workflow/scripts/tinHist.py @@ -36,7 +36,7 @@ def main(): #hist = hist.apply(lambda x: x/x.sum()*100, axis=1) hist.to_csv(args.repRID + '.tin.hist.tsv',sep='\t') medFile = open(args.repRID + '.tin.med.csv',"w") - medFile.write(str(round(tin['TIN'][(tin['TIN']!=0)].median()))) + medFile.write(str(round(tin['TIN'][(tin['TIN']!=0)].median(),2))) medFile.close() if __name__ == '__main__': -- GitLab