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