tidyomics / plyranges

A grammar of genomic data transformation
https://tidyomics.github.io/plyranges/
137 stars 19 forks source link

Issues loading a BAM file resulted from featurecounts #78

Closed ConYel closed 4 years ago

ConYel commented 4 years ago

Hello Stuart, thank you for this great package. It simplifies a lot of stuff for people who are used to the "tidy" way. I experience an issue with read_bam() function. In Rsubread::featureCounts() function there is the possibility to report the assignment result for each read in CORE, SAM and BAM format. I tried to read the BAM format and I get : Error in value[[3L]](cond) : failed to open BamFile: failed to open SAM/BAM file file: './feature_counts_res_new/rRNA/esc_EB3_S1_R1_001_trimmed_fq.bam'. I was checking also these functions: Rsamtools::indexBam() , GenomicAlignments::readGAlignments() and I always get something:

Error in value[[3L]](cond) : 
  failed to open BamFile: failed to open SAM/BAM file
  file: './feature_counts_res_new/rRNA/esc_EB3_S1_R1_001_trimmed.fq.gz_sorted.featureCounts.BAM'
Rsamtools::indexBam(the_bam)
Error in FUN(X[[i]], ...) : 'filename' is not a BAM file
  file: ./feature_counts_res_new/rRNA/esc_EB3_S1_R1_001_trimmed.fq.gz_sorted.featureCounts.bam

My final object is to extract the "XS:Z:Unassigned_NoFeatures" reads and save them to another bam file.

Thank you for your time

sa-lee commented 4 years ago

Hi there,

I think this might be a question better asked at https://support.bioconductor.org, the read_bam() function uses GenomicAlignments::readGAlignments() underneath, so if there's something wrong with reading the BAMs for featureCounts it's probably best to notify the authors of that package.

ConYel commented 4 years ago

Thanks I will.