Hi Kajia,
There you have it. Your BAM file suffers some pathology.
Things to try
1) re run samtools view -bS s_1.sam > s_1.bam. You may have mistyped a
character at the command line.
2) If 1 produces the same result, try Picard instead of samttols.
3) Try visualising the BAM file using IGV. Note that you'll need to
sort and index the file. You can do that too with picard.
If the problems persist, I recommend emailing the samtools email list.
This is not really a BEDTools bug, in my opinion. Perhaps it will help
realise samtools developers that a user could use something a little
bit more informative than "this is not a BAM file".
By the way, since the .bam file is actually not a BAM file, before you
write to the samtools list, try this at the command line
file s_1.bam
That should tell what type of file that is.
Ivan
Ivan Gregoretti, PhD
On Fri, Sep 14, 2012 at 12:31 PM, Linda C <
linda...@gmail.com> wrote:
> Hi Ivan
>
> It gave me the error msg:
>
> [bam_header_read] invalid BAM binary header (this is not a BAM file).
> [main_samview] fail to read the header from "s_1.bam".
>
> Should I convert sam to bam for the two files separately as you suggested?
> My goal is to upload the bgr files to UCSC genome browser. So I need to do:
> sam --> bam --> bed --> bgr (bedgraph). So if I deal the two files
> separately, evetually, I should get two tracks on the genome browser for
> each sample (as they are pair-end)?
>
> I'm totally new to the pair-end sequencing. Thank you for your input!