R data.table::fread()
i tried reading 100 rows of ~288GB file. fread says i don't have enough memory. i think because it has to first load the entire file into memory before showing you a subset of the file. work around is to use bash commands directly in fread function
library(data.table)
f="/data/greenbaum/users/ahunos/TRI_EPI_DIVYA/mod_bases/D-A-2/D-A-2_CpG_5mC_5hmC_per_read_methyl.txt"
dt <- fread(f, nrows=100) #fails with small memory ~8GB
#this appraich worked with no complications
dt <- fread("head /data/greenbaum/users/ahunos/TRI_EPI_DIVYA/mod_bases/D-A-2/D-A-2_CpG_5mC_5hmC_per_read_methyl.txt")
head(dt)