Hello,
Walking through this workflow I have encountered an exception using Rsamtools. When using the command BamFileList(), to create a list of Bam files, I find it does not recognize the arg as being bam format (see the object 'filenames' containing paths to these below). The traceback is included as well. I have looked this over for a while and I can't find the issue, which I am sure is obvious to the experienced user.
Thank you in advance for all help.
Using v3.3.1 1.68 build
> file.exists(filenames)
[1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
> filenames
[1] "/Library/Frameworks/R.framework/Versions/3.3/Resources/library/airway/extdata/SRR1039508_subset.bam"
[2] "/Library/Frameworks/R.framework/Versions/3.3/Resources/library/airway/extdata/SRR1039509_subset.bam"
[3] "/Library/Frameworks/R.framework/Versions/3.3/Resources/library/airway/extdata/SRR1039512_subset.bam"
[4] "/Library/Frameworks/R.framework/Versions/3.3/Resources/library/airway/extdata/SRR1039513_subset.bam"
[5] "/Library/Frameworks/R.framework/Versions/3.3/Resources/library/airway/extdata/SRR1039516_subset.bam"
[6] "/Library/Frameworks/R.framework/Versions/3.3/Resources/library/airway/extdata/SRR1039517_subset.bam"
[7] "/Library/Frameworks/R.framework/Versions/3.3/Resources/library/airway/extdata/SRR1039520_subset.bam"
[8] "/Library/Frameworks/R.framework/Versions/3.3/Resources/library/airway/extdata/SRR1039521_subset.bam"
> bamfiles=BamFileList(filenames, yeildSize=2000000)
Error in validObject(.Object) :
invalid class “BamFileList” object: the 'listData' slot must be a list containing BamFile objects
> traceback()
12: stop(msg, ": ", errors, domain = NA)
11: validObject(.Object)
10: initialize(value, ...)
9: initialize(value, ...)
8: new(paste0(class, "List"), listData = list)
7: .Method(..., yieldSize = yieldSize, class = class)
6: eval(expr, envir, enclos)
5: eval(.dotsCall, env)
4: eval(.dotsCall, env)
3: standardGeneric(".RsamtoolsFileList")
2: .RsamtoolsFileList(..., yieldSize = yieldSize, class = "BamFile")
1: BamFileList(filenames, yeildSize = 2e+06)