convert_bam_to_ofst: Convert libraries to ofst

View source: R/utils_format_conversion.R

convert_bam_to_ofstR Documentation

Convert libraries to ofst

Description

Saved by default in folder "ofst" relative to default libraries of experiment. Speeds up loading of full files compared to bam by large margins.

Usage

convert_bam_to_ofst(
  df,
  in_files = filepath(df, "default"),
  out_dir = file.path(libFolder(df), "ofst"),
  verbose = TRUE,
  strandMode = rep(0, length(in_files))
)

Arguments

df

an ORFik experiment, or NULL is allowed if both in_files and out_dir is specified manually.

in_files

paths to input files, default: filepath(df, "default") with bam format files.

out_dir

paths to output files, default file.path(libFolder(df), "cov_RLE").

verbose

logical, default TRUE, message about library output status.

strandMode

numeric, default 0. Only used for paired end bam files. One of (0: strand = *, 1: first read of pair is +, 2: first read of pair is -). See ?strandMode. Note: Sets default to 0 instead of 1, as readGAlignmentPairs uses 1. This is to guarantee hits, but will also make mismatches of overlapping transcripts in opposite directions.

Details

If you want to keep bam files loaded or faster conversion if you already have them loaded, use ORFik::convertLibs instead

Value

invisible(NULL), files saved to disc

See Also

Other lib_converters: convertLibs(), convert_to_bigWig(), convert_to_covRle(), convert_to_covRleList()

Examples

df <- ORFik.template.experiment.zf()
## Usually do default folder, here we use tmpdir
folder_to_save <- file.path(tempdir(), "ofst")
convert_bam_to_ofst(df, out_dir = folder_to_save)
fimport(file.path(folder_to_save, "ribo-seq.ofst"))

Roleren/ORFik documentation built on Nov. 13, 2024, 10 p.m.