SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert merged BAM back to per lane BAM or FASTQ file danielsbrewer Bioinformatics 6 10-03-2013 08:29 AM
TopHat file.bam file.bed join Trudy Bioinformatics 1 05-21-2013 12:59 PM
Are there any good ways to use SAMtools java API to convert .bam file into .txt file? alextree Bioinformatics 8 01-24-2012 10:20 AM
what is the file size for a 30X human genome sequencing file, raw and BAM? RNA-seq Illumina/Solexa 2 04-15-2011 12:27 PM

Reply
 
Thread Tools
Old 09-20-2011, 01:13 AM   #1
litali
Member
 
Location: us

Join Date: Jul 2010
Posts: 78
Default BAM file from the 2.6 version

Hi
In the 454 2.6 mapper version there is a .bam file created. How can it be viewed in ucsc or in other softwares?
litali is offline   Reply With Quote
Old 09-20-2011, 07:42 AM   #2
maubp
Peter (Biopython etc)
 
Location: Dundee, Scotland, UK

Join Date: Jul 2009
Posts: 1,543
Default

Like any other BAM file? BAM is the binary version of SAM, see
http://samtools.sourceforge.net/
http://samtools.sourceforge.net/swlist.shtml
maubp is offline   Reply With Quote
Old 09-21-2011, 12:06 AM   #3
litali
Member
 
Location: us

Join Date: Jul 2010
Posts: 78
Default BAM file

I tried different softwares, including aremis bamview, but when i upload the file I just don't see there anything...
litali is offline   Reply With Quote
Old 09-21-2011, 12:19 AM   #4
maubp
Peter (Biopython etc)
 
Location: Dundee, Scotland, UK

Join Date: Jul 2009
Posts: 1,543
Default

Have you indexed the BAM file with "samtools index example.bam"?

What does "samtools idxstats" tell you? This should summarise how many reads were mapped - perhaps very few mapped.

Also the first few lines in SAM format would be interesting for diagnosis, try "samtools view example.bam | head -n 50" for the first 50 lines. If you post them here, wrap it with [ code ] and [ /code ] tags to get it to display nicely on the forum.
maubp is offline   Reply With Quote
Old 09-21-2011, 12:24 AM   #5
ulz_peter
Senior Member
 
Location: Graz, Austria

Join Date: Feb 2010
Posts: 219
Default

BAM files from the GsMapper software is neither reference-ordered nor indexed, so you need to do these steps before actually being able to use it properly.

You can download picard (http://sourceforge.net/projects/picard/) and invoke the SortSam.jar Tool like

Code:
java -jar SortSam.jar SO=coordinate INPUT=454Contigs.bam OUTPUT=output.bam VALIDATION_STRINGENCY=LENIENT CREATE_INDEX=true
That should work and most software should be able to visualize it properly. For efficient visualization I recommend IGV (http://www.broadinstitute.org/software/igv/home)

Hope that helps
ulz_peter is offline   Reply With Quote
Old 09-21-2011, 12:37 AM   #6
litali
Member
 
Location: us

Join Date: Jul 2010
Posts: 78
Default

Thank you,
I tried the picard but received many errors in the following format:
Ignoring SAM validation error: ERROR: Read name F01BJ5E01DP1XH, No M or N operator between pair of I operators in CIGAR
????
litali is offline   Reply With Quote
Old 09-21-2011, 12:42 AM   #7
ulz_peter
Senior Member
 
Location: Graz, Austria

Join Date: Feb 2010
Posts: 219
Default

I get the same error, and by visualizing the 454 Bam files it seems that instead of a substitution it declares variants as an insert and deletion, which makes absolutely no sense. But I'm afraid you can't replace the cigar string without extensive programming...

So until this has been solved you can either align your reads with different software or live with that problem...
ulz_peter is offline   Reply With Quote
Old 09-21-2011, 12:47 AM   #8
litali
Member
 
Location: us

Join Date: Jul 2010
Posts: 78
Default bam

so, I don't understand, how do you work with this? I should ignore the errors and take the output files (which ones?) to the viewers?
litali is offline   Reply With Quote
Old 09-21-2011, 12:49 AM   #9
litali
Member
 
Location: us

Join Date: Jul 2010
Posts: 78
Default

P.s I only see one output file there: output.bai
litali is offline   Reply With Quote
Old 09-21-2011, 12:52 AM   #10
ulz_peter
Senior Member
 
Location: Graz, Austria

Join Date: Feb 2010
Posts: 219
Default

I actually stopped using the BAM file for visualizazion as (at least in IGV) the insertion/deletions are a mess to look at. I now do analysis on the gsMapper without visualization as well as analysis on freeware (bwa bwtsw algorithm) which yields a vaild bam file for visualization.

If it is crucial to visualize the data for you, you might ask Roche technical support to have that changed in future releases or you switch to another alignment program...
Or maybe there is a viewer somewhere else which displays insertions/deletions nicely...
ulz_peter is offline   Reply With Quote
Old 09-21-2011, 12:56 AM   #11
ulz_peter
Senior Member
 
Location: Graz, Austria

Join Date: Feb 2010
Posts: 219
Default

that's pretty strange that you only get one output file. Are you sure the sorting step is finished?
ulz_peter is offline   Reply With Quote
Old 09-21-2011, 01:02 AM   #12
litali
Member
 
Location: us

Join Date: Jul 2010
Posts: 78
Default

I think the sorting step is finished as after all the errors I receive: net.sf.picard.sam.SortSam done. Elapsed time: 0.07 minutes.
Runtime.totalMemory()=157810688
but still, I have there only the output.bai file.
I need a file which I can upload to a viewer (maybe to uscs) so I can see the coverage of the genes in the region, including annotation, so I thought the new feature of the .BAM file would be useful as I know there are many softwares which use .BAM files...
litali is offline   Reply With Quote
Old 09-21-2011, 01:17 AM   #13
maubp
Peter (Biopython etc)
 
Location: Dundee, Scotland, UK

Join Date: Jul 2009
Posts: 1,543
Default

Quote:
Originally Posted by ulz_peter View Post
I get the same error, and by visualizing the 454 Bam files it seems that instead of a substitution it declares variants as an insert and deletion, which makes absolutely no sense. But I'm afraid you can't replace the cigar string without extensive programming...

So until this has been solved you can either align your reads with different software or live with that problem...
I don't like it, but it makes perfect sense if you look at how Newbler produces ACE alignments. If you view the ACE file (e.g. in Tablet) you see the insert/deletion quite nicely (since the reference is gapped) and this caries over to the Newbler BAM file (where the reference is ungapped so the insertion isn't so clear).

Sadly the Newbler use of an insert/deletion rather than a substitution has long been a source of frustration to anyone interested in SNP detection.

Hopefully they will fix this in Newbler 2.7 given feedback - a short term solution as you say would be to edit the CIGAR strings in the SAM/BAM representation.
maubp is offline   Reply With Quote
Old 09-21-2011, 01:20 AM   #14
maubp
Peter (Biopython etc)
 
Location: Dundee, Scotland, UK

Join Date: Jul 2009
Posts: 1,543
Default

Quote:
Originally Posted by litali View Post
I think the sorting step is finished as after all the errors I receive: net.sf.picard.sam.SortSam done. Elapsed time: 0.07 minutes.
Runtime.totalMemory()=157810688
but still, I have there only the output.bai file.
You might find samtools easier to use than Picard (I do at least),

Code:
samtools sort example.bam example_sorted
will turn example.bam into example_sorted.bam which you then must index with:

Code:
samtools index example_sorted.bam
Perhaps that will work for you. It would be nice of Roche to have this done for you - in principle they could output a sorted BAM file.
maubp is offline   Reply With Quote
Old 09-21-2011, 01:30 AM   #15
litali
Member
 
Location: us

Join Date: Jul 2010
Posts: 78
Default

samtools doesn't work at all, probably something wrong with the installation. I downloaded it and extracted the file, so now i have a file :samtools-0.1.18 with many files inside. But when i tried to run samtools I recieve: bash: samtools: command not found
How this can be fixed?
litali is offline   Reply With Quote
Old 09-21-2011, 01:55 AM   #16
maubp
Peter (Biopython etc)
 
Location: Dundee, Scotland, UK

Join Date: Jul 2009
Posts: 1,543
Default

Quote:
Originally Posted by litali View Post
samtools doesn't work at all, probably something wrong with the installation. I downloaded it and extracted the file, so now i have a file :samtools-0.1.18 with many files inside. But when i tried to run samtools I recieve: bash: samtools: command not found
How this can be fixed?
You don't just download and unzip samtools - you must compile it. What OS are you on?
maubp is offline   Reply With Quote
Old 09-21-2011, 02:53 AM   #17
litali
Member
 
Location: us

Join Date: Jul 2010
Posts: 78
Default samtools

i use linux redhat
litali is offline   Reply With Quote
Old 09-21-2011, 02:58 AM   #18
maubp
Peter (Biopython etc)
 
Location: Dundee, Scotland, UK

Join Date: Jul 2009
Posts: 1,543
Default

Quote:
Originally Posted by litali View Post
i use linux redhat
Then the installation shouldn't be a problem - follow the instructions in the INSTALL file.
maubp is offline   Reply With Quote
Old 09-21-2011, 04:14 AM   #19
litali
Member
 
Location: us

Join Date: Jul 2010
Posts: 78
Default Igv

ok, I installed samtools and created the sorted and the index files. Now I tried to upload them into the IGV viewer, but still I see no alignments..
litali is offline   Reply With Quote
Old 09-21-2011, 04:16 AM   #20
ulz_peter
Senior Member
 
Location: Graz, Austria

Join Date: Feb 2010
Posts: 219
Default

does it say zoom in to view alignments or is it just empty?
ulz_peter is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 03:35 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2022, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO