Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • vcfutils to get consensus sequence

    There have been several posts about this, but it has been a while, and my queries are not completely answered, so thought I would put it down again.

    I am trying to generate a consensus sequence from a vcf file and a reference genome. I am trying to use vcfutils, and I get an error as

    Use of uninitialized value in addition (+) at /my/bin/vcfutils.pl line 518
    ....

    I am trying to rewrite vcfutils.pl to avoid this error. The error is in the area -

    $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));
    $q = int($q + 33 + .499);
    $q = chr($q <= 126? $q : 126);

    The current format of VCF files does not have an FQ flag, so this code fails when it is trying to parse out the FQ value. My question is - how can I calculate $q from the VCF file?

    There is great information in
    Discussion of next-gen sequencing related bioinformatics: resources, algorithms, open source efforts, etc


    which says
    "$q, which is derived from the FQ, ends up being the quality score"

    But I am still trying to figure out how to calculate this value.

    Thanks very much.

  • #2
    I encountered the same problem with vcfutils.pl

    I ended up using the old (deprecated) pileup file to get the consensus sequence.

    samtools pileup -cf ref.fa aln.bam | samtools.pl pileup2fq -D100 > cns.fastq

    Comment


    • #3
      Oh dear..I think the current version of samtools doesnt even support it. Do you know which version you were using, I will get that
      Thanks very much!

      Comment


      • #4
        samtools 1.11

        Comment

        Latest Articles

        Collapse

        • seqadmin
          Essential Discoveries and Tools in Epitranscriptomics
          by seqadmin




          The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
          04-22-2024, 07:01 AM
        • seqadmin
          Current Approaches to Protein Sequencing
          by seqadmin


          Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
          04-04-2024, 04:25 PM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by seqadmin, Yesterday, 08:47 AM
        0 responses
        12 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-11-2024, 12:08 PM
        0 responses
        60 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-10-2024, 10:19 PM
        0 responses
        59 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-10-2024, 09:21 AM
        0 responses
        54 views
        0 likes
        Last Post seqadmin  
        Working...
        X