R/read_cmap.R

Defines functions read_cmap

Documented in read_cmap

#' Read .cmap file
#'
#' Read BioNano consensus map.
#'
read_cmap <- function(file, sort = FALSE) {

	a <- tbl_df(read.table(file, stringsAsFactors = FALSE))

	colnames(a) <- c("cmapID", "contigLength", "numSites", "siteID",
			"labelChannel", "position", "stddev", "coverage",
			"occurance", "gmeanSNR", "lnSNRsd", "SNRcount")[1:ncol(a)]
	if (sort) {
		a <- a %>% arrange(cmapID, position)
	}

	return(a)
}
yanlinlin82/Rbionano documentation built on Dec. 26, 2019, 7:37 a.m.