jamescasbon/PyVCF — Issue #16: Crash when QUAL = .
Author: fabbyrob
Created: 2012-02-06 16:24:55+00:00
State: open

I have some sites in my data that have no quality, because no reads mapped there. For example:

scaffold_1 1330 . T . . . Dels=0.01;MQ=6.79;MQ0=0 GT ./. ./. ./. ./. ./. ./. ./. ./. ./. ./. ./. ./. ./.
scaffold_1 1331 . C . . . Dels=0.01;MQ=6.70;MQ0=0 GT ./. ./. ./. ./. ./. ./. ./. ./. ./. ./. ./. ./. ./.
scaffold_1 1332 . G . . . Dels=0.00;MQ=6.70;MQ0=0 GT ./. ./. ./. ./. ./. ./. ./. ./. ./. ./. ./. ./. ./.
scaffold_1 1333 . A . . . Dels=0.00;MQ=6.58;MQ0=0 GT ./. ./. ./. ./. ./. ./. ./. ./. ./. ./. ./. ./. ./.

The parser breaks on line 444. I've modified my version to give a 0 quality to these records, as a quick fix:

qual = 0 if row[5] == '.' else (float(row[5]) if '.' in row[5] else int(row[5]))