Throwing an error if INFO fields arguments contain whitespace.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5651 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
corin 2011-04-15 20:52:55 +00:00
parent fce6d25075
commit 2cf6a06503
1 changed files with 10 additions and 0 deletions

View File

@ -48,6 +48,7 @@ import org.broadinstitute.sting.gatk.walkers.annotator.VariantAnnotatorEngine;
import org.broadinstitute.sting.utils.GenomeLoc;
import org.broadinstitute.sting.utils.SampleUtils;
import org.broadinstitute.sting.utils.bed.BedParser;
import org.broadinstitute.sting.utils.exceptions.UserException;
import org.broadinstitute.sting.utils.vcf.VCFUtils;
import javax.activation.*;
@ -85,6 +86,14 @@ public class DeclareValidityWalker extends RodWalker<Integer, Integer>{
public Integer reduceInit() {
for(char a : note.toCharArray()){
if(Character.isWhitespace(a)) throw new UserException("White space is not allowed in VCF Info fields, please omit it from your build, note, and source arguments.");
}
for(char b : source.toCharArray()){
if(Character.isWhitespace(b)) throw new UserException("White space is not allowed in VCF Info fields, please omit it from your build, note, and source arguments.");
}
Set<VCFHeaderLine> old = VCFUtils.getHeaderFields(getToolkit());
Set<VCFHeaderLine> newlines = new HashSet<VCFHeaderLine>();
for(VCFHeaderLine each : old){
@ -108,6 +117,7 @@ public class DeclareValidityWalker extends RodWalker<Integer, Integer>{
public Map<String, Object> addValidation(int Validity, String Note, String Source){
HashMap<String, Object> validityAnnots = new HashMap<String, Object>();
validityAnnots.put("validity", Validity);
validityAnnots.put("user", System.getenv("USER"));