R/combineAlignGals.R

Defines functions combineAlignGals

Documented in combineAlignGals

# Function Name: 	combineAlignGals
# Description: 		Read each BAM/SAM/BED using getAlignGal.R and combine them 
#					(e.g. technical/biological replicates).					
# Input: 			a list or vector of bam file names in full path
# Output:			combined GAlignments objects
#
# Author: Yue Li
###############################################################################

combineAlignGals <- function(bamFiles, ...)
{	
	
	numBAM <- length(bamFiles)
		
	combinedGal <- getAlignGal(bamFiles[1], ...)
			
	if(numBAM == 1) {
	
		message(sprintf("%d BAM files are combined", numBAM))
		return(combinedGal)
	}
					
	for(i in 2:numBAM) {
		
		combinedGal <- 
				append(combinedGal, getAlignGal(bamFiles[i], ...))
	}
	
	message(sprintf("%d BAM files are combined", numBAM))
	return(combinedGal)
}

Try the RIPSeeker package in your browser

Any scripts or data that you put into this service are public.

RIPSeeker documentation built on Oct. 31, 2019, 7:29 a.m.