SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Best BAM file Visualization tools ? abi General 0 05-21-2013 03:19 PM
Samscope: A new OpenGL based SAM/BAM visualization tool Crypticfortune Bioinformatics 26 05-21-2013 03:11 PM
IGV reading .bam enelkinsan Bioinformatics 1 12-18-2012 02:09 PM
Visualization of variants from varScan with IGV ozs2006 Bioinformatics 2 08-10-2011 10:04 PM
IGV bam file NicoBxl Bioinformatics 1 03-29-2011 05:24 AM

Reply
 
Thread Tools
Old 11-18-2013, 03:39 PM   #1
Bubblepig
Member
 
Location: Montreal

Join Date: Mar 2013
Posts: 13
Default FASTA to BAM for IGV visualization

Hi all,

Does anyone know how to make a .fasta file into a .bam file so that we can incorporate two reference genomes into IGV (Integrative Genomics Viewer)?

Thanks
Joyce
Bubblepig is offline   Reply With Quote
Old 11-18-2013, 04:45 PM   #2
GenoMax
Senior Member
 
Location: East Coast USA

Join Date: Feb 2008
Posts: 7,077
Default

Are you thinking of ["fasta" --> "align to a reference" (SAM) --> Convert to BAM --> View in IGV] workflow?

What do you mean by incorporate two reference genomes into IGV?
GenoMax is offline   Reply With Quote
Old 11-18-2013, 05:21 PM   #3
Bubblepig
Member
 
Location: Montreal

Join Date: Mar 2013
Posts: 13
Default

Hi GenoMax, thanks for your reply.

I will explain the situation a bit more clearly - we have aligned our MiSeq data based on this published "scaffold" reference genome but there are a lot of "N"s in this file, making it hard to tell apart true SNPs/indels from the bad reference sequence.

There is another well-annotated sequence of the same species but different lineage, and we'd like to use this as our IGV reference genome. At the same time, we're wondering if it's possible to convert the scaffold reference genome (.fasta) into a .bam file so we can open it along with our other real MiSeq samples?

Thanks,
Joyce
Bubblepig is offline   Reply With Quote
Old 11-18-2013, 05:39 PM   #4
GenoMax
Senior Member
 
Location: East Coast USA

Join Date: Feb 2008
Posts: 7,077
Default

You could align your sample (and the scaffold fasta) to the annotated genome and then open both BAM's in IGV using the annotated genome as your reference.
GenoMax is offline   Reply With Quote
Old 11-18-2013, 06:25 PM   #5
Bubblepig
Member
 
Location: Montreal

Join Date: Mar 2013
Posts: 13
Default

Genomax, do you know if I could do the conversion using samtools? If not, how do you think I could do so?
Thanks
Joyce
Bubblepig is offline   Reply With Quote
Old 11-19-2013, 04:34 AM   #6
ctseto
Member
 
Location: SE MN

Join Date: Oct 2013
Posts: 44
Default

You could map the sample to the new reference; and in parallel map old reference to new reference, then use samtools merge (which I think requires conversion from sam to bam).
ctseto is offline   Reply With Quote
Old 11-19-2013, 04:57 AM   #7
GenoMax
Senior Member
 
Location: East Coast USA

Join Date: Feb 2008
Posts: 7,077
Default

Quote:
Originally Posted by Bubblepig View Post
Genomax, do you know if I could do the conversion using samtools? If not, how do you think I could do so?
Thanks
Joyce
You will have to do some alignments to view the three datasets together in IGV.

Minimally you should:

1. Create an index for annotated reference.
2. Map your sequence and the scaffold fasta against the annotated reference.
3. Finally view the aligned BAM in IGV.

You will need access to a UNIX machine to do these steps.

Depending on how distant your organism (and the scaffold fasta) is from the annotated reference you may or may not be able to get useful visual information from IGV.
GenoMax is offline   Reply With Quote
Old 11-19-2013, 07:15 AM   #8
Bubblepig
Member
 
Location: Montreal

Join Date: Mar 2013
Posts: 13
Default

Thanks Genomax and ctseto. I am having trouble mapping the scaffold genome fasta to the index reference genome using bowtie2.
Quote:
Error: reads file does not look like a FASTQ file
libc++abi.dylib: terminate called throwing an exception
bowtie2-align died with signal 6 (ABRT)
Anything else I could try?

Thanks
Joyce
Bubblepig is offline   Reply With Quote
Old 11-19-2013, 07:40 AM   #9
GenoMax
Senior Member
 
Location: East Coast USA

Join Date: Feb 2008
Posts: 7,077
Default

Quote:
Originally Posted by Bubblepig View Post
Thanks Genomax and ctseto. I am having trouble mapping the scaffold genome fasta to the index reference genome using bowtie2.


Anything else I could try?

Thanks
Joyce
Are you remembering to include the "-f" option to indicate that your scaffold file is in "fasta" format?
GenoMax is offline   Reply With Quote
Old 11-19-2013, 08:14 AM   #10
Bubblepig
Member
 
Location: Montreal

Join Date: Mar 2013
Posts: 13
Default

Genomax, where should I indicate the -f option?

Here's the command:
Quote:
wpa031012:bowtie2-2.1.0 Behr$ /Users/Behr/bowtie2-2.1.0/bowtie2-align -p 4 -x H37Rv -U /Users/Behr/bowtie2-2.1.0/HN878.fasta -S HN878aligned.sam
-x H37Rv is the indexed referenced genome in bt2 format
HN878.fasta is the scaffold genome
-S HN878aligned.sam is what I want the output to be.

Thanks!! and
Joyce
Bubblepig is offline   Reply With Quote
Old 11-19-2013, 08:20 AM   #11
GenoMax
Senior Member
 
Location: East Coast USA

Join Date: Feb 2008
Posts: 7,077
Default

Try

Code:
$ /Users/Behr/bowtie2-2.1.0/bowtie2 -p 4 -f -x H37Rv -U /Users/Behr/bowtie2-2.1.0/HN878.fasta -S HN878aligned.sam
Why are you running bowtie2-align directly. Run the wrapper script "bowtie2" as indicated above.
GenoMax is offline   Reply With Quote
Old 11-19-2013, 11:37 AM   #12
Bubblepig
Member
 
Location: Montreal

Join Date: Mar 2013
Posts: 13
Default

Hi Genomax,

Thanks, I tried your script

Quote:
/Users/Behr/bowtie2-2.1.0/bowtie2 -p 4 -f -x H37Rv -U /Users/Behr/bowtie2-2.1.0/HN878.fasta -S HN878aligned.sam
After several minutes the HN878aligned.sam file remained 0 kb, and the computer became abnormally slow. The HN878.fasta file itself is only 4.4 MB, so I thought something wasn't going right.
I hit Command+C to terminate the script and got this message.

Quote:
^Cbowtie2-align died with signal 2 (INT)
Any idea?

Thanks
Joyce
Bubblepig is offline   Reply With Quote
Old 11-19-2013, 11:39 AM   #13
GenoMax
Senior Member
 
Location: East Coast USA

Join Date: Feb 2008
Posts: 7,077
Default

How much RAM do you have (are you using a virtual machine to run bowtie)? How big is your genome index file?
GenoMax is offline   Reply With Quote
Old 11-19-2013, 11:43 AM   #14
Bubblepig
Member
 
Location: Montreal

Join Date: Mar 2013
Posts: 13
Default

It's a Macbook so I used Terminal.
Here are the specs:
Processor 2.9 GHz Intel Core i7
Memory 8 GB 1600 MHz DDR3

There are 6 files for the indexed genome, all in bt2 format. They add up to less than 15 MB!
Bubblepig is offline   Reply With Quote
Old 11-19-2013, 11:46 AM   #15
GenoMax
Senior Member
 
Location: East Coast USA

Join Date: Feb 2008
Posts: 7,077
Default

Have you used bowtie2 on this machine before? Did you create the index files on this machine?
GenoMax is offline   Reply With Quote
Old 11-19-2013, 12:20 PM   #16
Bubblepig
Member
 
Location: Montreal

Join Date: Mar 2013
Posts: 13
Default

Yes I have used bowtie2, created index files, and aligned GBs of FASTQ files on this machine before!
I will give the -f script another try....maybe there was a glitch?! :P
Bubblepig is offline   Reply With Quote
Old 11-19-2013, 12:52 PM   #17
Bubblepig
Member
 
Location: Montreal

Join Date: Mar 2013
Posts: 13
Default

Hi Genomax...bad news...the computer died while running the script!
Is it possible for me to send you the links to the 2 fasta files?

Thanks
Joyce
Bubblepig 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 07:33 AM.


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