alignment-flags: Creates a default set of flags for reading improperly paired...

improperAlignmentFlagsR Documentation

Creates a default set of flags for reading improperly paired alignments

Description

These functions are wrappers for scanBamFlag and ScanBamParam in the Rsamtools package.

Usage

improperAlignmentFlags()

properAlignmentFlags()

improperAlignmentParams(
  flag = improperAlignmentFlags(),
  what = c("flag", "mrnm", "mpos", "mapq", "qname"),
  ...
)

properAlignmentParams(
  flag = properAlignmentFlags(),
  what = c("flag", "mrnm", "mpos", "mapq"),
  ...
)

Arguments

flag

A length-two integer vector as provided by improperAlignmentFlags

what

A character vector (see ScanBamParam for details)

...

additional arguments to ScanBamParam such as mapqFilter

See Also

See scanBamFlag for complete details and improperAlignmentParams for a wrapper of this function that generates a ScanBamParam object using these flags.

See ScanBamParam and bamFlag in Rsamtools for full documentation. See improperAlignmentFlags for the default set of flags.

Examples

require(Rsamtools)

flags <- scanBamFlag(isDuplicate=FALSE,
                     isPaired=TRUE,
                     isUnmappedQuery=FALSE,
                     hasUnmappedMate=FALSE,
                     isProperPair=FALSE)
flags2 <- improperAlignmentFlags()
identical(flags, flags2) #TRUE
print(flags)
 
flags <- scanBamFlag(isDuplicate=FALSE,
                     isPaired=TRUE,
                     isUnmappedQuery=FALSE,
                     hasUnmappedMate=FALSE,
                     isProperPair=TRUE)
flags2 <- properAlignmentFlags()
identical(flags, flags2) #TRUE
print(flags)

flags <- improperAlignmentFlags()
print(flags)
params <- ScanBamParam(flag = flags, what=c("flag", "mrnm", "mpos", "mapq"))
params2 <- improperAlignmentParams()
print(params2)
identical(params, params2) #TRUE

flags <- properAlignmentFlags()
print(flags)
params <- ScanBamParam(flag = flags, what=c("flag", "mrnm", "mpos", "mapq"))
params2 <- properAlignmentParams()
identical(params, params2) #TRUE
print(params2)

cancer-genomics/trellis documentation built on Aug. 20, 2024, 5:48 p.m.