From dcb3b8b59dbcac468ec0e7473eb31cf15085fd91 Mon Sep 17 00:00:00 2001 From: Harriet Dashnow Date: Mon, 1 Oct 2018 14:23:20 +1000 Subject: [PATCH] limit the number of decimal points reported in the final STRetch results --- scripts/estimateSTR.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/estimateSTR.py b/scripts/estimateSTR.py index ba6ee6e..f693463 100644 --- a/scripts/estimateSTR.py +++ b/scripts/estimateSTR.py @@ -397,6 +397,11 @@ def main(): #sort by outlier score then estimated size (bpInsertion), both descending write_data = write_data.sort_values(['outlier', 'bpInsertion'], ascending=[False, False]) #XXX check for duplicate rows? + # Convert outlier and p_adj to numeric type and do some rounding/formatting + write_data['outlier'] = pd.to_numeric(write_data['outlier']) + write_data['p_adj'] = [ format(x, '.2g') for x in pd.to_numeric(write_data['p_adj']) ] + write_data = write_data.round({'total_assigned': 1, 'outlier': 1, + 'bpInsertion': 1, 'repeatUnits': 1, 'repeatUnits_max': 1}) # Write individual files for each sample, remove rows where locuscoverage == 0 samples = set(write_data['sample'])