Dear All,
I have a problem and I would like your help....
I got some published ChIP-seq data....So I got the Bam and the Bai files.....and I do the following....
chr <- 'chr10'
fileName<-c("/data/lena/GG/file_1.bam")
fragment.size=200
chr.size<-seqlengths(Mmusculus)[chr]
which <- GRanges(seqnames=chr,IRanges(1,chr.size))
what <- c("rname", "strand", "pos", "qwidth","seq","qual")
param <- ScanBamParam(which = which,what=what)
chip.bam <- scanBam(fileName, param=param)
and I get the following error message
record: 0
error: 0
file: /data/lena/GG/file_1.bam
index: /data/lena/GG/file_1.bam
In addition: Warning message:
In .Call2(func, .extptr(file), space, flag, simpleCigar, ..., PACKAGE = "Rsamtools") :
space 'chr10' not in BAM header
I can understand that has something to do with the header BUT how can I fix that?
Could you please help me?
Thank you in advance
Best regards Lena
I don't know anything about scanBam, but it is only a warning message and it says you have 0 errors, so it should work. Does it not give you no output or not the output taht you expect?
there is no output at all! I have a for loop initially which scans the BAM file for all the chromosomes....so the loop stops and I get the message....My script is correct because it is working perfectly with other BAM files....
Can you post the header of the non-working BAM file and a working BAM file?
yeah or run scanBamHeader to see if that chromosome really exists (it might just be '10')
thank you very much! it works! however I have now another problem....if you can see the post below....can you please help me? thank you in advance. best regards. Lena