shifts_save: Save shifts for Ribo-seq

View source: R/shift_footprints_helpers.R

shifts_saveR Documentation

Save shifts for Ribo-seq

Description

Should be stored in pshifted folder relative to default files

Usage

shifts_save(shifts, folder)

Arguments

shifts

a list of data.table/data.frame objects. Must be named with the full path to ofst/bam files that defines the shifts.

folder

directory to save file, Usually: file.path(libFolder(df), "pshifted"), where df is the ORFik experiment / or your path of default file types. It will be named file.path(folder, "shifting_table.rds"). For ORFik to work optimally, the folder should be the /pshifted/ folder relative to default files.

Value

invisible(NULL), file saved to disc as "shifting_table.rds".

See Also

Other pshifting: changePointAnalysis(), detectRibosomeShifts(), shiftFootprints(), shiftFootprintsByExperiment(), shiftPlots(), shifts_load()

Examples

df <- ORFik.template.experiment.zf()
shifts <- shifts_load(df)
original_shifts <- file.path(libFolder(df), "pshifted", "shifting_table.rds")
# Move to temp
new_shifts_path <- file.path(tempdir(), "shifting_table.rds")
new_shifts <- c(shifts, shifts)
names(new_shifts)[2] <- file.path(tempdir(), "RiboSeqTemp.ofst")
saveRDS(new_shifts, new_shifts_path)
new_shifts[[1]][1,2] <- -10
# Now update the new shifts, here we input only first
shifts_save(new_shifts[1], tempdir())
readRDS(new_shifts_path) # You still get 2 outputs


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