Commit 2ca7263f authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Check reference allele to allowed vcf chars

parent 6aa0a3d3
...@@ -137,7 +137,12 @@ object MpileupToVcf extends ToolCommand { ...@@ -137,7 +137,12 @@ object MpileupToVcf extends ToolCommand {
writer.println("##FORMAT=<ID=ARC,Number=A,Type=Integer,Description=\"Alternetive Reverse Reads\">") writer.println("##FORMAT=<ID=ARC,Number=A,Type=Integer,Description=\"Alternetive Reverse Reads\">")
writer.println("##FORMAT=<ID=GT,Number=1,Type=String,Description=\"Genotype\">") writer.println("##FORMAT=<ID=GT,Number=1,Type=String,Description=\"Genotype\">")
writer.println("#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\t" + commandArgs.sample) writer.println("#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\t" + commandArgs.sample)
val inputStream = if (commandArgs.input != null) Source.fromFile(commandArgs.input).getLines else Source.stdin.getLines val inputStream = if (commandArgs.input != null) {
Source.fromFile(commandArgs.input).getLines
} else {
logger.info("No input file as argument, waiting on stdin")
Source.stdin.getLines
}
class Counts(var forward: Int, var reverse: Int) class Counts(var forward: Int, var reverse: Int)
for ( for (
line <- inputStream; line <- inputStream;
...@@ -146,7 +151,11 @@ object MpileupToVcf extends ToolCommand { ...@@ -146,7 +151,11 @@ object MpileupToVcf extends ToolCommand {
) { ) {
val chr = values(0) val chr = values(0)
val pos = values(1) val pos = values(1)
val ref = values(2) val ref = values(2) match {
case "A" | "T" | "G" | "C" => values(2)
case "a" | "t" | "g" | "c" => values(2).toUpperCase
case _ => "N"
}
val reads = values(3).toInt val reads = values(3).toInt
val mpileup = values(4) val mpileup = values(4)
val qual = values(5) val qual = values(5)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment