Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Lspoor
    Member
    • Mar 2010
    • 18

    vcfutils.pl -specifying minimum read depth?



    Hi everyone, I was wondering if you might be able to help me with specifying a minimum read depth when calling consensus sequences?

    I'm running samtools-0.1.18 on Ubuntu 10.04. I have produced VCF files for all sites for my bacterial genome sequences (from BWA BAM files), which seem ok (based on using the following commandline: /samtools-0.1.18/samtools mpileup -E -q30 -Q30 -uf REF.fa isolate1.merged.bam | /samtools-0.1.18/bcftools/bcftools view -cg - > isolate1.all_sites.vcf), and am using the following command line in vcftools with the aim of specifying a minimum read depth of 3 when calling the genome consensus sequences:

    /samtools-0.1.18/bcfutils/vcfutils.pl vcf2fq -d3 AB10.all_sites_E_q30_Q30.vcf > AB10.all_sites_E_q30_Q30_RD3.fq (which I convert to FASTA using a python script).

    Whether or not I specify the option -d3 (I believe 3 is the default anyway) in the commandline, in all cases where the VCF file states that DP=1 or DP=2, rather than not calling the base, it calls a lowercase letter at these sites.

    Over the course of my genomes, this amounts to approximately 48 000 bases in each genome which have been called lowercase, which includes approximately 650 variant sites. If these variant sites are of poor quality and include potentially false positive SNPs, this may be adversely affecting my downstream phylogenetic analysis.

    My questions are:
    a) Does anyone know if this is normal for it to insert a lowercase base rather than calling 'n' at these sites (which is what I was incorrectly assuming it would do!)
    b) What are your opinions on whether I should just replace all of these sites with an 'n' to be on the conservative side?

    Any help is much appreciated, SeqAnswers has been so great at helping in the past!

    Best Wishes,

    Laura
  • wzhjlau2009
    Junior Member
    • Jun 2011
    • 5

    #2
    how about your results finally ? i am doing the same process as your had done . i want to know may i have a chance to have a communication with you about this area.my email:[email protected] QQ:461739553
    best wishes,
    wisdom

    Comment

    • swbarnes2
      Senior Member
      • May 2008
      • 910

      #3
      Here's the relevent part of the script:

      Options: -d INT minimum depth [$opts{d}]
      -D INT maximum depth [$opts{D}]
      -Q INT min RMS mapQ [$opts{Q}]
      -l INT INDEL filtering window [$opts{l}]
      my $_Q = $opts{Q};
      my $_d = $opts{d};
      my $_D = $opts{D};
      my %het = (AC=>'M', AG=>'R', AT=>'W', CA=>'M', CG=>'S', CT=>'Y',
      GA=>'R', GC=>'S', GT=>'K', TA=>'W', TC=>'Y', TG=>'K')

      ...

      my ($ref, $alt) = ($t[3], $1);
      my ($b, $q);
      $q = $1 if ($t[7] =~ /FQ=(-?[\d\.]+)/);
      if ($q < 0) {
      $_ = ($t[7] =~ /AF1=([\d\.]+)/)? $1 : 0;
      $b = ($_ < .5 || $alt eq '.')? $ref : $alt;
      $q = -$q;
      } else {
      $b = $het{"$ref$alt"};
      $b ||= 'N';
      }
      $b = lc($b);
      $b = uc($b) if (($t[7] =~ /MQ=(\d+)/ && $1 >= $_Q) && ($t[7] =~ /DP=(\d+)/ && $1 >= $_d && $1 <= $_D));
      So basically, the only way an N gets put in is if the FQ is < 0 (which happens when your SNP is mixed), and there's no single letter code for that mix.

      Otherwise, it will be lowercase unless the MQ and DP are within the ranges you set in the options, in which case, it's uppercase.

      Comment

      • ymwur
        Member
        • Nov 2012
        • 11

        #4
        Hi,
        So, I am wodnering what does a N in the concesus generated by mpileup measns?
        I am still confused about when FQ can be samller than 0? I am not sure what does mixed SNP mean?
        Does a N mean there is no read mapped to that particular site (if the bam is resulted by BWA mapping)?

        Thans,

        Chih-Ming

        Comment

        Latest Articles

        Collapse

        • SEQadmin2
          From Collection to Sequencing: Why Sample Preparation and Preservation Define Sequencing Data
          by SEQadmin2


          Data variability is still an issue in sequencing technologies despite the advances in reproducibility and accuracy of these platforms. But the problem does not originate in the sequencing itself, but in the previous steps, before the sample reaches the sequencer.


          The first step is collection, followed by preservation and sample preparation for analysis. Most scientists overlook those steps, but not being careful might just be skewing the experiment’s results.
          ...
          Yesterday, 10:05 AM
        • SEQadmin2
          Single-Cell Sequencing at an Inflection Point: Early Impacts of New Platforms and Emerging Trends
          by SEQadmin2


          With the launch of new single-cell sequencing platforms in 2026, the field stands at an exciting inflection point. This article surveys the most impactful advances in the field and discusses how they’re reshaping research in cancer, immunology, and beyond.


          Introduction

          Single-cell sequencing technologies have undergone remarkable advances over the past decade, transitioning from low-throughput experimental approaches to highly scalable platforms capable of...
          05-22-2026, 06:42 AM
        • SEQadmin2
          Environmental Genomics in the Age of NGS: From Microbes to Conservation Strategies
          by SEQadmin2

          Studying ecosystems means dealing with complex, multi-species communities that are hard to observe at scale. This complexity, however, hides many important questions to be answered, from how biogeochemical cycles work and how climate change can affect species distribution to how conservation strategies can work best.


          Genomics, particularly since the expansion of NGS, has transformed ecosystem ecology. By sequencing environmental DNA, we can now assess biodiversity without direct...
          05-06-2026, 09:04 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by SEQadmin2, Yesterday, 12:03 PM
        0 responses
        19 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, Yesterday, 11:40 AM
        0 responses
        14 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 05-28-2026, 11:40 AM
        0 responses
        29 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 05-26-2026, 10:12 AM
        0 responses
        31 views
        0 reactions
        Last Post SEQadmin2  
        Working...