Hi Devon, 

Thank you for your help. That did help. I had another question — is it 
necessary to sort and index the bam file prior to the trying to view it using 
the tview command? I tried to use the tview command but it gives me an error:

[bam_index_load] fail to load BAM index.

Thank you, 
Aakriti 
On Aug 6, 2014, at 12:01 PM, Devon Ryan <dpr...@dpryan.com> wrote:

> Hi Aakriti,
> 
> The -t option takes a file argument, which is probably causing your problem. 
> You likely just want:
> samtools view -Sb agaA_1_local.sam > agaA_1_local.bam
> 
> Bowtie2 outputs SAM files with a header, so there's generally no reason to 
> replace it with the -t option.
> 
> Best,
> Devon
> 
> --
> Devon Ryan, Ph.D.
> Email: dpr...@dpryan.com
> Laboratory for Molecular and Cellular Cognition
> German Centre for Neurodegenerative Diseases (DZNE)
> Ludwig-Erhard-Allee 2
> 53175 Bonn
> Germany
> 
> 
> On Wed, Aug 6, 2014 at 11:34 AM, Aakriti Jain <aakriti.jai...@gmail.com> 
> wrote:
> Hello,
> 
> I was wondering if I could get some advice on using samtools properly.
> 
> I'm trying to analyze an output file from a Bowtie2 alignment which is in 
> .sam format. I first converted the .sam file to .bam using the following 
> command:
> 
> $ samtools view -S -t -b agaA_1_local.sam > agaA_1_local.bam
> 
> and I got the following return line:
> [samopen] SAM header is present: 1 sequences.
> 
> I noticed a .bam file in my directory, so I tried to use the following line:
> 
> $ samtools tview agaA_1_local.bam agaA.fasta
> 
> and got the following errors:
> [bam_header_read] EOF marker is absent. The input is probably truncated.
> [bam_header_read] invalid BAM binary header (this is not a BAM file).
> 
> I'm not sure what I'm doing wrong? Am I missing some steps? Why is my .bam 
> file not an actual BAM file?
> 
> Any help on this will be greatly appreciated!
> 
> Thank you,
> Aakriti Jain
> ------------------------------------------------------------------------------
> Infragistics Professional
> Build stunning WinForms apps today!
> Reboot your WinForms applications with our WinForms controls.
> Build a bridge from your legacy apps to the future.
> http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
> _______________________________________________
> Samtools-help mailing list
> Samtools-help@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/samtools-help
> 

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
Samtools-help mailing list
Samtools-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/samtools-help

Reply via email to