Skip to content

Commit

Permalink
cast start and end column to integer64 to prevent scientific notation
Browse files Browse the repository at this point in the history
  • Loading branch information
HendrikSchultheis committed Jan 12, 2019
1 parent b15c203 commit b65dc90
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bin/2.1_clustering/reduce_sequence.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit b65dc90

Please sign in to comment.