Import splice junction data from BED or SJ.out.tab file
Source:R/jambio-plot.R
import_juncs_from_bed.RdImport splice junction data from BED or SJ.out.tab file
Usage
import_juncs_from_bed(
iBed,
juncNames,
sample_id,
scale_factor = 1,
use_memoise = FALSE,
memoise_junction_path = "junctions_memoise",
gr = NULL,
verbose = FALSE,
...
)Arguments
- iBed
characterpath or URL to one BED, bigBed, or 'SJ.out.tab' file as produced by STAR during alignment.For 'SJ.out.tab' input, the countUnique value (column 7) is used, with no other filtering applied.
For BED and bigBed input, the score is preferred in the name column (column 3), primarily because UCSC tracks limit the score to maximum of 1000.
BED name can be numeric, or can be in the form
'JUNC000000_1234'with 'JUNC' prefix followed by integer digits, underscore, the integer values. In this example, the score is'1234'. When not all names can be converted to numeric values, the score column is used.If you see scores with maximum value "1000" the 'score' column could be the problem.
bigBed files are imported using the 'cpp11bigwig' package which also uses the appropriate index.
- juncNames
characterthe name of the junction source file- sample_id
characterstring representing the sample identifier.- scale_factor
numericdefault 1, adjusts the raw score, applied by multiplying the scale_factor by each score.- use_memoise
logicaldefault FALSE, whether to cache data using memoise.- memoise_junction_path
characterdefault 'junctions_memoise' with default subdirectory for memoise cache files, used only whenuse_memoise=TRUE.- gr
GRangesrepresenting the overall range for which junction data will be retrieved. Note that any junctions that span this range, but do not start or end inside this range, will be removed.- verbose
logicalindicating whether to print verbose output.- ...
additional arguments are ignored.
Details
This function is intended to be called internally by
prepareSashimi(), and is provided primarily to enable
use of memoise::memoise() to cache results.
This function was refactored in version 0.0.69.900 to
handle either BED format, or "SJ.out.tab" junction
format as produced by STAR alignment. The method uses
data.table::fread() then if there are 9 columns,
it assumes the format is "SJ.out.tab". Otherwise it
coerces the data.frame with as(bed, "GRanges").
The BED or "SJ.out.tab" file can be gzipped, provided
data.table() is able to recognieze and import the
compression format.
Note that bigBed format still cannot be used since the rtracklayer package does not support that format.
Also note that junctions with score=0 are dropped at
this step, to prevent propagation of junctions with
zero counts.
See also
Other Data import functions:
getGRcoverageFromBw(),
psl2df()