import-bam {AllelicImbalance} | R Documentation |
Imports a specified genomic region from a bam file using a GRanges object as search area.
impBamGAL(UserDir, ...) ## S4 method for signature 'character' impBamGAL( UserDir, searchArea, files = NULL, XStag = FALSE, verbose = TRUE, ... )
UserDir |
The relative or full path of folder containing bam files. |
... |
arguments to pass on |
searchArea |
A |
files |
use character vector to specify one or more files to import. The default imports all bam files from the directory. |
XStag |
Setting |
verbose |
makes the function more talkative. |
If the sequence data is strand-specific you may want to set XStag=TRUE. The strand specific information has then to be stored in the meta columns with column name 'XS'. If the aligner did not set the XS-tag and the data is strand- specific it is still be possible to infer the strand from the bit flags after importing the reads to R. Depending on the strand-specific protocol different combinations of the flags will have to be used. For illumina fr-secondstrand, 83 and 163 are minus strand reads and 99 and 147 are plus strand reads.
Jesper R. Gadin, Lasse Folkersen
#Declare searchArea searchArea <- GRanges(seqnames=c('17'), ranges=IRanges(79478301,79478361)) #Relative or full path pathToFiles <- system.file('extdata/ERP000101_subset', package='AllelicImbalance') #all files in directory reads <- impBamGAL(pathToFiles,searchArea,verbose=FALSE) #specified files in directory reads <- impBamGAL(pathToFiles,searchArea, files=c("ERR009160.bam", "ERR009167.bam"),verbose=FALSE)