Header Leaderboard Ad

Collapse

FASTA sequence From large BAM file

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

  • #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


    • #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


      • #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


        • #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


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

            Comment


            • #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


              • #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


                • #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


                  • #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

                    • seqadmin
                      A Brief Overview and Common Challenges in Single-cell Sequencing Analysis
                      by seqadmin


                      ​​​​​​The introduction of single-cell sequencing has advanced the ability to study cell-to-cell heterogeneity. Its use has improved our understanding of somatic mutations1, cell lineages2, cellular diversity and regulation3, and development in multicellular organisms4. Single-cell sequencing encompasses hundreds of techniques with different approaches to studying the genomes, transcriptomes, epigenomes, and other omics of individual cells. The analysis of single-cell sequencing data i...

                      01-24-2023, 01:19 PM
                    • seqadmin
                      Introduction to Single-Cell Sequencing
                      by seqadmin
                      Single-cell sequencing is a technique used to investigate the genome, transcriptome, epigenome, and other omics of individual cells using high-throughput sequencing. This technology has provided many scientific breakthroughs and continues to be applied across many fields, including microbiology, oncology, immunology, neurobiology, precision medicine, and stem cell research.

                      The advancement of single-cell sequencing began in 2009 when Tang et al. investigated the single-cell transcriptomes
                      ...
                      01-09-2023, 03:10 PM

                    ad_right_rmr

                    Collapse
                    Working...
                    X