R/fixMetadata.R

Defines functions fixMetadata

Documented in fixMetadata

#' fix metadata for an MAlignmentsList or MVRangesList, if needed and possible.
#' 
#' This function is punishingly simple -- it just calls validMetadata() and
#' assigns attr('fixedMeta') from the result. If no fixing is required, the 
#' object's existing metadata is used. The object (with fixed metadata) is 
#' then returned. If automatic fixes are impossible, a message is generated.
#' 
#' @param x   an MAlignmentsList or MVRangesList
#'
#' @return    the object, with fixed metadata (if needed and possible) 
#' 
#' @examples
#' library(MTseekerData)
#' data(RONKSreads)
#' fixed <- fixMetadata(RONKSreads)
#' 
#' @export
fixMetadata <- function(x) {
  metadata(x) <- attr(validMetadata(x), "fixedMeta")
  return(x)
}

Try the MTseeker package in your browser

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

MTseeker documentation built on Oct. 31, 2019, 3:20 a.m.