![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Extract sequence from multi fasta file with PERL | andreitudor | Bioinformatics | 27 | 07-07-2019 08:45 AM |
introducing BAMseek, a large file viewer for BAM and SAM | BAMseek | Bioinformatics | 11 | 07-23-2013 09:02 PM |
Find all occurrences of a sequence in a fasta file | dphansti | Bioinformatics | 3 | 12-06-2011 07:11 AM |
To get the sequence from a given BAM file | ardmore | Bioinformatics | 11 | 11-12-2011 11:22 AM |
Bam and Sam don't like my fasta file | mindlessbrain | Bioinformatics | 2 | 12-09-2010 11:47 PM |
![]() |
|
Thread Tools |
![]() |
#1 |
Junior Member
Location: georgia Join Date: Nov 2011
Posts: 5
|
![]()
I hope I would be able to get some help even though my question will sound very basic, I am new to sequencing formats.
I am working on a project that involves obtaining reference sequences from the .bam files in the 1000 genomes database, to perform disease studies for a group. I used samtools view to download the genomic region I am interested in, but the actual sequence column in the .bam files seem to have reads for both forward and reverse strands. I would like to know, how I could get the simple nucleotide sequence of the reference strand from .bam file ... some kind of consensus sequence I am guessing. |
![]() |
![]() |
![]() |
#2 |
Peter (Biopython etc)
Location: Dundee, Scotland, UK Join Date: Jul 2009
Posts: 1,543
|
![]()
Are you trying to get the consensus sequence from a BAM file?
The reference sequence would be the same standard human genome used for all the 1000 genomes, and can probably be downloaded from their site as FASTA. |
![]() |
![]() |
![]() |
#3 |
Junior Member
Location: georgia Join Date: Nov 2011
Posts: 5
|
![]()
Yes, I want to get the consensus FASTA sequence from the BAM file for a given chromosome region(not necessarily the whole chromosome sequence).
|
![]() |
![]() |
![]() |
#4 |
Peter (Biopython etc)
Location: Dundee, Scotland, UK Join Date: Jul 2009
Posts: 1,543
|
![]()
Have you tried searching the forum (or Google) for the terms BAM consensus?
Look at the samtools mpileup command (which replaced the older samtools pileup command). |
![]() |
![]() |
![]() |
#5 |
Member
Location: USA Join Date: Jun 2011
Posts: 51
|
![]()
I have the same question. I used the command
Code:
samtools mpileup -uf ref.fa aln.bam | bcftools view -cg - | vcfutils.pl vcf2fq > cns.fq Code:
the 'Argument “f” isn’t numeric in numeric |
![]() |
![]() |
![]() |
#6 |
Peter (Biopython etc)
Location: Dundee, Scotland, UK Join Date: Jul 2009
Posts: 1,543
|
![]()
You're not the only person to hit that,
http://biostar.stackexchange.com/que...ric-in-numeric |
![]() |
![]() |
![]() |
#7 |
Member
Location: USA Join Date: Jun 2011
Posts: 51
|
![]()
Well. I think that it is the bug of samtools manual.
I used the command Code:
samtools pileup -cf ref.fa aln.bam | samtools.pl pileup2fq -D100 > cns.fastq |
![]() |
![]() |
![]() |
#8 | |
Senior Member
Location: San Diego Join Date: May 2008
Posts: 912
|
![]() Quote:
And you do realize that neither method will touch putative indels, right? |
|
![]() |
![]() |
![]() |
#9 |
Peter (Biopython etc)
Location: Dundee, Scotland, UK Join Date: Jul 2009
Posts: 1,543
|
![]() |
![]() |
![]() |
![]() |
#10 |
Junior Member
Location: Estonia Join Date: Jan 2013
Posts: 5
|
![]()
See here for one way to get a .vcf file with SNPs and indels from the .bam file, or a consensus sequence:
http://samtools.sourceforge.net/mpileup.shtml The consensus sequence generated by this method has the problem that it only applies the SNPs to the reference sequence, but not the indels. The .vcf file is better since it includes both SNPs and indels. The .vcf file can be converted to a .fasta sequence using this tool: https://www.broadinstitute.org/gatk/...Reference.html However, note that this tool will only take into account indels of length up to 2 bases (as of January 2013). You may want to write your own script to insert all the indels (including the longer ones) from the .vcf into the .fasta. Last edited by kriikku; 01-13-2013 at 06:46 AM. |
![]() |
![]() |
![]() |
Thread Tools | |
|
|