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
            Beyond CRISPR/Cas9: Understand, Choose, and Use the Right Genome Editing Tool
            by SEQadmin2






            CRISPR/Cas9 sparked the gene editing revolution for both research and therapeutics.1 But this system still showed severe issues that limited its applications. The most prominent were the heavy reliance on PAM sequences, delivery limitations, double-stranded breaks that prompt unintended edits and cell death, and editing inefficiency (both in targeting and in knock-in reliability).

            Despite this, “CRISPR helped turn genome editing from a specialized
            ...
            07-31-2026, 11:01 AM
          • SEQadmin2
            Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
            by SEQadmin2


            Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

            The systematic characterization of the human proteome has
            ...
            07-20-2026, 11:48 AM
          • SEQadmin2
            Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
            by SEQadmin2



            Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
            ...
            07-09-2026, 11:10 AM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by SEQadmin2, 07-31-2026, 02:55 AM
          0 responses
          20 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 07-24-2026, 12:17 PM
          0 responses
          16 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 07-23-2026, 11:41 AM
          0 responses
          16 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 07-20-2026, 11:10 AM
          0 responses
          26 views
          0 reactions
          Last Post SEQadmin2  
          Working...