-
Notifications
You must be signed in to change notification settings - Fork 2
Rsamtools workflow
The help manual pages can be invoked for any core/contributed function run within this workflow e.g.
library(Rsamtools) ## Display the help page for the scanBam() function help(scanBam)
The Rsamtools package provides an interface in R to BAM files produced by samtools and other software, and represent a flexible format for storing ‘short’ reads aligned to reference genomes.
This workflow covers importing BAM files into R. The two paradigms are to specify which references (and potentially their sequence ranges) are of specific interest to import, and what columns of the bam file are of interest. Once imported, specific attributes can be filtered further by subseting specific records of interest.
The first command clears out any existing R objects from your current workspace
# Clear working directory objects rm(list=ls())
Any contributed libraries need to be installed once, but loaded each time they are used with either require(), or library();
require(ShortRead) require(Rsamtools) require(chipseq)
Loading help documentation vignette;
# Getting vignette help
if(interactive()) vignette("Rsamtools-Overview")
The next commands source some global variables in the file ~/VISG-course-2012/supplementary_Rsamtools_usage/globals.R
# Globals
cat("[ Code to source() ]\n")
cat(readLines("globals.R"), sep="\n")
## source globals code
source("globals.R")
cat("[ path to bam:",fl, "]\n")
print(fl)