I think that the argument "
refSeqName" in the function "
getReadCountsFromBAM" is a bit misleading. While looking at the source code in "getReadCountsFromBAM.R", I noticed the following code line:
for (i in 1:length(refSeqName))
It turned out that I am able to use the function with multiple reference sequence names like this, for example:
bamDataRanges <- getReadCountsFromBAM(BAMFiles, sampleNames=paste("Sample",1:2), refSeqName=c("1", "2"), WL=100, mode="paired", parallel=12)
which will give an output in the console as following:
Identified the following reference sequences: 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,X,Y,MT,GL000207.1,GL000226.1 [...] Using 1, 2 as reference. Using indexed BAM files.
Though, the documentation (quoted below) suggests that the function is only capable of handing a single reference sequence name. This is also the case with the examples that come with the cn.mops package.
"refSeqName: Name (Names?) of the reference sequence (sequences?) that should be analyzed. The name (names?) must appear in the header of the BAM file. If it is not given the function will select the first reference sequence that appears in the header of the BAM files."
Thanks for accepting my comment.