Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kirstyn
    Junior Member
    • May 2012
    • 8

    #1

    Mpileup consensus Ns

    Hi

    I have been generating consensus sequences from a BWA-aligned BAM file using the following script:
    samtools mpileup -Euf Reference.fasta input.bam | bcftools view -cg - | vcfutils.pl vcf2fq > cns.fq

    In Tablet view the BAM file shows decent coverage across the genome and my reads have been quality filtered. My issue is that the consensus sequence has Ns even in positions where I can clearly see reads that map to the reference. At first I thought this was to do with a default read depth cutoff, but even accounting for this the numbers don't add up!

    Does anyone know why mpileup is calling an N at certain positions?
  • auratus
    Junior Member
    • Jan 2013
    • 1

    #2
    16S and 23S consensus replaced with N

    I have the same issue. In particular with 16S and 13S in bacteria. I have plenty of coverage in this area but I got "N" on my consensus sequence.
    I used this:

    samtools mpileup -u foo.bam | bcftools view -cg - | vcfutils.pl vcf2fq > foo.fq

    Any answer?

    Comment

    • syfo
      Just a member
      • Nov 2012
      • 103

      #3
      Same here.
      Ns in the consensus fasta while the region seems to be well covered. I guess it is about some quality filtering but I do not manage to get the right parameters.
      Anyone with a proposition please?

      Command line:
      Code:
      samtools mpileup -u infile.bam | bcftools view -cg - | vcfutils.pl vcf2fq | seqtk fq2fa - > outfile.fa

      Comment

      • scami
        Member
        • Sep 2010
        • 55

        #4
        May be indexing.....

        Hi Guys
        the N in the consensus may me due to a missing indexed reference file. Try the following:

        Code:
        samtools index alignmentFile.bam
        and then try the mpileup command again.

        Hope it helps

        Comment

        • syfo
          Just a member
          • Nov 2012
          • 103

          #5
          Hi, thanks for your help.

          Well, in my case I precisely do not want samtools to use the reference sequence for the calling, I am looking for the consensus from the reads only.

          Also, most of the bases are correctly called but a couple of positions are missing and end up in Ns although base information seems available in the alignments. I am suspecting base quality to be an issue but I don't manage to get a decent set of parameters for the command line.

          Even with something like this
          samtools mpileup -RAB -d10000000 -Q0 -q0 -u | bcftools view -g -p1 - | vcfutils.pl vcf2fq -d0 -Q0 | seqtk fq2fa -

          some bases are discarded.

          I believe vcfutils.pl is involved because if I replace the "AF1=0" tag by "AF1=1" in the VCF (after the bcftools view command) N are replaced by a proper base information.

          Still, even small and "obvious" deletions in the reference sequence are not handled the way I want because the consensus includes "N" where it should be uninterrupted, but that is another issue I guess.
          Note: the bam files are already sorted and indexed.

          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, Yesterday, 11:13 AM
          0 responses
          19 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, Yesterday, 10:48 AM
          0 responses
          18 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...