1
20 months ago by
jfgout10
jfgout10 wrote:

Hi everyone,

I'm trying to load a BAM file into R for further analysis with NucleR. Following the recommendations from the NucleR package documentation, I tried using the 'readAligned' function from package 'ShortRead' to read my BAM file. Only problem is, this function does not seem to be capable of reading BAM files.

If I try:

I end up with this error:

Error: UserArgumentMismatch
arugment 'type' had value 'BAM' allowable values: 'SolexaExport'
'SolexaAlign' 'SolexaPrealign' 'SolexaRealign' 'SolexaResult'
'MAQMap' 'MAQMapShort' 'MAQMapview' 'Bowtie' 'SOAP'

What surprises me, is that I see many example online of people using type="BAM" with this function. Including people positing about some other problems on this site (see for example: https://support.bioconductor.org/p/40789/)

It's almost as if I was using an old version of the function or something like that. However, I'm using version 1.36 of the 'ShortRead' package, which seems to be the most recent one (R version is 3.4.3, I'm on a Linux station). What I don't understand is that there is no mention of a "BAM" option in the documentation for ShortRead 1.36. So, what is this function that other people use with the type="BAM" option? I'm completely lost...

Note that I have the same problem with ShortRead v 1.32.1 and R 3.3.1

jf

modified 20 months ago by Dario Strbenac1.5k • written 20 months ago by jfgout10
2
20 months ago by
Dario Strbenac1.5k
Australia
Dario Strbenac1.5k wrote:

You should avoid using nucleR for your data analysis. The package depends on RangedData which has been "... has been discouraged in favour of GRanges or GRangesList objects since BioC 2.12, that is, since 2014.". Moreover, RangedData will be deprecated in April and probably removed entirely from IRanges in October. If the developers haven't found time in the past four years to make their package compatible with Bioconductor, then I doubt that nucleR will remain in Bioconductor for much longer, making it hard for journal readers to reproduce your results.

Thank you for this information. Any recommendation on which package I should use to (easily) call nucleosome scores from aligned reads (bam files)?

jf

I don't have a recommendation.

1
20 months ago by
Mike Smith4.0k
EMBL Heidelberg / de.NBI
Mike Smith4.0k wrote:

The readAligned function for BAM files was deprecated quite a while ago.  You should take a look at the GenomicAlignments package - there's a vignette on reading BAM files at An Introduction to the GenomicAlignments Package

Thanks a lot for your answer. The problem is that I need to get an object of class "AlignedRead" (or "RangedData" with a strand attribute) to feed to the functions from the nucleR package.

I'll try to find a way to convert the 'GAlignments' object returned by readGAlignments into AlignedRead or RangedData. Or maybe I'll just try to install an old version of ShortRead.