Problem with scanBam functiuon in Rsamools
1
0
Entering edit mode
@owendonohoe-18047
Last seen 4.8 years ago

I'd like to use Rsamtools, I think it would be very ideal for generating coverage plots.

However, when I try to use the scaBam function to process a bam file, using the following code

> bam <- scanBam(C_Term_Flag_1)

I always get this error

Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘scanBam’ for signature ‘"spec_tbl_df"’

I cannot find any useful solutions on the web

Has anyone else encountered this issue ?

see session info below

R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)

Matrix products: default

locale:
[1] LC_COLLATE=English_Ireland.1252  LC_CTYPE=English_Ireland.1252   
[3] LC_MONETARY=English_Ireland.1252 LC_NUMERIC=C                    
[5] LC_TIME=English_Ireland.1252    

attached base packages:
[1] stats4    parallel  stats     graphics  grDevices utils     datasets 
[8] methods   base     

other attached packages:
[1] Rsamtools_2.0.3      Biostrings_2.52.0    XVector_0.24.0      
[4] GenomicRanges_1.36.0 GenomeInfoDb_1.20.0  IRanges_2.18.1      
[7] S4Vectors_0.22.0     BiocGenerics_0.30.0 

loaded via a namespace (and not attached):
[1] zlibbioc_1.30.0        compiler_3.6.1         tools_3.6.1           
[4] GenomeInfoDbData_1.2.1 RCurl_1.95-4.12        BiocParallel_1.17.18  
[7] bitops_1.0-6
Rsamtools scanBAM • 1.2k views
ADD COMMENT
0
Entering edit mode
@martin-morgan-1513
Last seen 4 months ago
United States

scanBam() is expecting either a character(1) path to the file that you want to read, or an object BamFile() created from the path to the file. You instead seem to be passing an object of type "spec_tbl_df", maybe a 'tibble'?

Likely you want to use the GenomicAlignments package, rather than Rsamtools directly.

ADD COMMENT
0
Entering edit mode

Thanks for your reply, it was very useful. I changed the object in question to a character(1) path to the file that I wanted to read, it worked perfectly. Previous to this the object was an imported dataset. Thanks again.

ADD REPLY

Login before adding your answer.

Traffic: 697 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6