RahmanTeam / DECoN

50 stars 29 forks source link

Rsamtools version not compatible with VN:1.4 BAM files? #34

Open ToonRosseel opened 3 years ago

ToonRosseel commented 3 years ago

Dear, I would really like to test DECoN. The installation was successful, but I get following error message when I try to run ReadInBams.R with our BAM files:

Error in value[[3L]](cond) : 
  failed to open BamFile: SAM/BAM header missing or empty
  file: 'file.bam'
Calls: getBamCounts ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
In addition: Warning message:
In doTryCatch(return(expr), name, parentenv, handler) :
  [bam_header_read] invalid BAM binary header (this is not a BAM file).
Execution halted

According the error message, the headers are missing, but they are not! The upper header lines of my BAM files look like this:

@HD VN:1.4  SO:coordinate
@SQ SN:chr1 LN:248956422
@SQ SN:chr2 LN:242193529
@SQ SN:chr3 LN:198295559
@SQ SN:chr4 LN:190214555
@SQ SN:chr5 LN:181538259
@SQ SN:chr6 LN:170805979
@SQ SN:chr7 LN:159345973
@SQ SN:chr8 LN:145138636
...

I seems to me that the error message is made by the Rsamtools package version 1.18.3. If I read my BAM file with a more recent Rsamtools version (eg. v2.8.0), I do not get this message. But as DECoN depends on an old R version (3.1.2), it's not just possibly to use a more recent Rsamtools version (and all it's dependencies). Does anyone know an easy (or less easy) fix for this issue?