From 7c4185626bbf584f578015e4c53ddeaa7832f2f3 Mon Sep 17 00:00:00 2001 From: Schultheis Date: Sat, 12 Jan 2019 14:02:27 +0100 Subject: [PATCH] cast start and end column to integer64 to prevent scientific notation --- bin/2.1_clustering/cdhit_wrapper.R | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/2.1_clustering/cdhit_wrapper.R b/bin/2.1_clustering/cdhit_wrapper.R index ebf7667..d0618b8 100644 --- a/bin/2.1_clustering/cdhit_wrapper.R +++ b/bin/2.1_clustering/cdhit_wrapper.R @@ -199,6 +199,11 @@ cdhitest <- function(input, identity = 0.8, coverage = 8, output = "cluster.bed" data.table::fwrite(x = cluster_table, file = summary, append = TRUE, sep = "\t", col.names = TRUE) } + + # cast start and end column to integer64 to prevent scientific notation e.g. 1e+10 + # start and end are assumed to be at position 2 and 3 + result[, c(2, 3) := lapply(.SD, bit64::as.integer64), SDcols = c(2, 3)] + data.table::fwrite(x = result, file = output, sep = "\t", col.names = keep_col_names) }