From 6adfed873713e8f9986d45eabeab787c0cb3791a Mon Sep 17 00:00:00 2001 From: Davide Albanese Date: Thu, 10 Nov 2022 13:07:11 +0100 Subject: [PATCH] kofamscan: TSV output; fix merge_kofamscan_hits.py --- bin/merge_kofamscan_hits.py | 10 ++++++++-- modules/kofamscan.nf | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/merge_kofamscan_hits.py b/bin/merge_kofamscan_hits.py index 28c0d30..7c31dcf 100755 --- a/bin/merge_kofamscan_hits.py +++ b/bin/merge_kofamscan_hits.py @@ -17,8 +17,7 @@ for input_fn in args.input: input_bn = os.path.basename(input_fn) input_id = input_bn.split(args.suffix)[0] - input_df = pd.read_fwf(input_fn, skiprows=[1], - colspecs = [(0, 1), (2, 22), (22, 29), (54, 1024)]) + input_df = pd.read_csv(input_fn, delimiter='\t', skiprows=[1]) input_df = input_df[input_df['#'] == '*'] input_df = input_df.groupby(["KO", "KO definition"]) \ [["gene name"]].nunique() @@ -27,3 +26,10 @@ compl_df.fillna(0, inplace=True) compl_df.to_csv('kofamscan_hits.tsv', sep='\t', float_format='%.d') +Footer +© 2022 GitHub, Inc. +Footer navigation +Terms +Privacy +Security + diff --git a/modules/kofamscan.nf b/modules/kofamscan.nf index 0946cb0..35d3d8e 100644 --- a/modules/kofamscan.nf +++ b/modules/kofamscan.nf @@ -15,7 +15,7 @@ process kofamscan { script: """ exec_annotation \ - -f detail \ + -f detail-tsv \ --cpu ${task.cpus} \ --tmp-dir tmp \ -o ${id}.hits.txt \