readWidths {ORFik}R Documentation

Get RiboSeq widths

Description

Input a ribo-seq object and get width of reads, this is to avoid confusion between width, qwidth and meta column containing original read width.

Usage

readWidths(reads, after.softclips = TRUE)

Arguments

reads

a GRanges or GAlignment object.

after.softclips

logical (FALSE), include softclips in width

Details

If input is p-shifted and GRanges, the "$score" or "$size" colum" must exist, and contain the original read widths. ORFik P-shifting creates a $size column, other softwares like shoelaces creates a score column

Value

an integer vector of widths

Examples

gr <- GRanges("chr1", 1)
readWidths(gr)

# GAlignment with hit (1M) and soft clipped base (1S)
ga <- GAlignments(seqnames = "1", pos = as.integer(1), cigar = "1M1S",
 strand = factor("+", levels = c("+", "-", "*")))
readWidths(ga) # Without soft-clip bases

readWidths(ga, after.softclips = FALSE) # With soft-clip bases


[Package ORFik version 1.4.0 Index]