R/calKmerSkew.R

Defines functions calKmerSkew

Documented in calKmerSkew

#' Function calculates the skew of k-mers based on their occurrence in 
#' positive and negative strands.
#'
#' @param kmer.table data.table with columns: kmer, pos_strand, neg_strand.
#' @return data.table with the kmer_skew column.
#'
#' @export
calKmerSkew <- function(kmer.table) {
  
  # kmer.table  <data.table>  Table with 3 columns: kmer, pos_strand, neg_strand
  
  kmer.table[, kmer_skew := (pos_strand - neg_strand) /
               (pos_strand + neg_strand)]
  
  
  invisible(kmer.table)
}

Try the kmeRtone package in your browser

Any scripts or data that you put into this service are public.

kmeRtone documentation built on Sept. 11, 2024, 9:12 p.m.