Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mez
    Junior Member
    • Nov 2011
    • 5

    #1

    FASTA sequence From large BAM file

    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.
  • maubp
    Peter (Biopython etc)
    • Jul 2009
    • 1544

    #2
    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.

    Comment

    • mez
      Junior Member
      • Nov 2011
      • 5

      #3
      Yes, I want to get the consensus FASTA sequence from the BAM file for a given chromosome region(not necessarily the whole chromosome sequence).

      Comment

      • maubp
        Peter (Biopython etc)
        • Jul 2009
        • 1544

        #4
        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).

        Comment

        • ardmore
          Member
          • Jun 2011
          • 51

          #5
          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
          However I got an error.
          Code:
          the 'Argument “f” isn’t numeric in numeric

          Comment

          • maubp
            Peter (Biopython etc)
            • Jul 2009
            • 1544

            #6
            You're not the only person to hit that,
            http://biostar.stackexchange.com/que...ric-in-numeric

            Comment

            • ardmore
              Member
              • Jun 2011
              • 51

              #7
              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
              Everything is fine.

              Comment

              • swbarnes2
                Senior Member
                • May 2008
                • 910

                #8
                Originally posted by ardmore View Post
                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
                Everything is fine.
                Pileup is deprecated. Everyone uses mpileup. Don't expect a lot of help if you stay with pileup.

                And you do realize that neither method will touch putative indels, right?

                Comment

                • maubp
                  Peter (Biopython etc)
                  • Jul 2009
                  • 1544

                  #9
                  Originally posted by swbarnes2 View Post
                  And you do realize that neither method will touch putative indels, right?
                  What do you recommend for getting an indel aware consensus from a BAM file?

                  Comment

                  • kriikku
                    Junior Member
                    • Jan 2013
                    • 5

                    #10
                    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, 06:46 AM.

                    Comment

                    Latest Articles

                    Collapse

                    • SEQadmin2
                      Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
                      by SEQadmin2



                      Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

                      Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
                      ...
                      10-14-2026, 09:55 AM
                    • SEQadmin2
                      New Genomics Technologies Take Aim at Long-Standing Limits
                      by SEQadmin2


                      Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

                      We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
                      ...
                      09-28-2026, 10:25 AM

                    ad_right_rmr

                    Collapse

                    News

                    Collapse

                    Topics Statistics Last Post
                    Started by SEQadmin2, 10-22-2026, 11:13 AM
                    0 responses
                    24 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 10-22-2026, 10:48 AM
                    0 responses
                    20 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 10-15-2026, 10:52 AM
                    0 responses
                    36 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 10-14-2026, 05:39 AM
                    0 responses
                    42 views
                    0 reactions
                    Last Post SEQadmin2  
                    Working...