From b65dc90a8cf897045e8014154e94e87fdf35e0d9 Mon Sep 17 00:00:00 2001 From: Schultheis Date: Sat, 12 Jan 2019 14:00:42 +0100 Subject: [PATCH] cast start and end column to integer64 to prevent scientific notation --- bin/2.1_clustering/reduce_sequence.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/2.1_clustering/reduce_sequence.R b/bin/2.1_clustering/reduce_sequence.R index 15d99ae..2b1b64e 100644 --- a/bin/2.1_clustering/reduce_sequence.R +++ b/bin/2.1_clustering/reduce_sequence.R @@ -231,6 +231,10 @@ reduce_sequence <- function(input, kmer = 10, motif = 10, output = "reduced.bed" names(merged) <- col_names } + # 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 + merged[, c(2, 3) := lapply(.SD, bit64::as.integer64), SDcols = c(2, 3)] + data.table::fwrite(merged, file = output, sep = "\t", col.names = keep_col_names) }