No BAM option in readAligned from the ShortRead package
2
1
Entering edit mode
jfgout ▴ 10
@jfgout-15029
Last seen 6.7 years ago

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:

aln <- readAligned(".", "mini.bam", type="BAM")

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

Thanks for your help!

 

jf

bioconductor shortread bam file nucler • 2.0k views
ADD COMMENT
2
Entering edit mode
Dario Strbenac ★ 1.5k
@dario-strbenac-5916
Last seen 16 hours ago
Australia

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.

ADD COMMENT
0
Entering edit mode

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

 

jf

ADD REPLY
0
Entering edit mode

I don't have a recommendation.

ADD REPLY
1
Entering edit mode
Mike Smith ★ 6.6k
@mike-smith
Last seen 2 hours ago
EMBL Heidelberg

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

ADD COMMENT
0
Entering edit mode

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.

Thanks again for your help.

ADD REPLY

Login before adding your answer.

Traffic: 687 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