1. Alignability mask returns null when not available.

2. --list now prints out the available classes/groups too.


git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3072 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
ebanks 2010-03-24 20:49:07 +00:00
parent 06a212e612
commit 3176715c74
2 changed files with 12 additions and 20 deletions

View File

@ -20,17 +20,14 @@ public class Alignability implements InfoFieldAnnotation {
VariantContext vc)
{
TabularROD record = (TabularROD)(tracker.lookup("alignability", null));
int value;
if (record == null) { value = 3; }
else
{
if (record.get("alignability") == null)
{
throw new RuntimeException("ERROR: alignability column not defined in alignability input.\n");
}
value = Integer.parseInt(record.get("alignability"));
}
if (record == null)
return null;
if (record.get("alignability") == null)
throw new RuntimeException("ERROR: alignability column not defined in alignability input.\n");
int value = Integer.parseInt(record.get("alignability"));
Map<String, Object> map = new HashMap<String, Object>();
map.put(getKeyName(), String.format("%d", value));
return map;

View File

@ -8,7 +8,6 @@ import org.broadinstitute.sting.gatk.walkers.*;
import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.*;
import org.broadinstitute.sting.utils.*;
import org.broadinstitute.sting.utils.genotype.vcf.*;
import org.broadinstitute.sting.utils.genotype.Genotype;
import org.broadinstitute.sting.utils.cmdLine.Argument;
import java.util.*;
@ -54,6 +53,10 @@ public class VariantAnnotator extends LocusWalker<Integer, Integer> {
for (int i = 0; i < genotypeAnnotationClasses.size(); i++)
out.println("\t" + genotypeAnnotationClasses.get(i).getSimpleName());
out.println();
out.println("\nAvailable classes/groups of annotations:");
for ( Class c : PackageUtils.getInterfacesExtendingInterface(AnnotationType.class) )
out.println("\t" + c.getSimpleName());
out.println();
System.exit(0);
}
@ -168,12 +171,4 @@ public class VariantAnnotator extends LocusWalker<Integer, Integer> {
vcfWriter.close();
}
public static Genotype getFirstVariant(char ref, List<Genotype> genotypes) {
for ( Genotype g : genotypes ) {
if ( g.isVariant(ref) )
return g;
}
return null;
}
}