convertLibs {ORFik} | R Documentation |
Export as either .ofst, .wig, .bigWig,.bedo (legacy format) or .bedoc (legacy format) files:
Export files as .ofst for fastest load speed into R.
Export files as .wig / bigWig for use in IGV or other genome browsers.
The input files are checked if they exist from: envExp(df)
.
convertLibs( df, out.dir = dirname(df$filepath[1]), addScoreColumn = TRUE, addSizeColumn = TRUE, must.overlap = NULL, method = "None", type = "ofst", reassign.when.saving = FALSE, envir = .GlobalEnv, BPPARAM = bpparam() )
df |
an ORFik |
out.dir |
optional output directory, default: dirname(df$filepath[1]), if it is NULL, it will just reassign R objects to simplified libraries. Will then create a final folder specfied as: paste0(out.dir, "/", type, "/"). Here the files will be saved in format given by the type argument. |
addScoreColumn |
logical, default TRUE, if FALSE will not add replicate numbers as score column, see ORFik::convertToOneBasedRanges. |
addSizeColumn |
logical, default TRUE, if FALSE will not add size (width) as size column, see ORFik::convertToOneBasedRanges. Does not apply for (GAlignment version of.ofst) or .bedoc. Since they contain the original cigar. |
must.overlap |
default (NULL), else a GRanges / GRangesList object, so only reads that overlap (must.overlap) are kept. This is useful when you only need the reads over transcript annotation or subset etc. |
method |
character, default "None", the method to reduce ranges,
for more info see |
type |
a character of format, default "ofst". Alternatives: "ofst", "bigWig", "wig","bedo" or "bedoc". Which format you want. Will make a folder within out.dir with this name containing the files. |
reassign.when.saving |
logical, default FALSE. If TRUE, will reassign library to converted form after saving. Ignored when out.dir = NULL. |
envir |
environment to save to, default
|
BPPARAM |
how many cores/threads to use? default: bpparam().
To see number of threads used, do |
See export.ofst
, export.wiggle
,
export.bedo
and export.bedoc
for information on file formats.
If libraries of the experiment are
already loaded into environment (default: .globalEnv) is will export
using those files as templates. If they are not in environment the
.ofst files from the bam files are loaded (unless you are converting
to .ofst then the .bam files are loaded).
NULL (saves files to disc or R .GlobalEnv)
df <- ORFik.template.experiment() #convertLibs(df) # Keep only 5' ends of reads #convertLibs(df, method = "5prime")