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:
parent
06a212e612
commit
3176715c74
|
|
@ -20,17 +20,14 @@ public class Alignability implements InfoFieldAnnotation {
|
||||||
VariantContext vc)
|
VariantContext vc)
|
||||||
{
|
{
|
||||||
TabularROD record = (TabularROD)(tracker.lookup("alignability", null));
|
TabularROD record = (TabularROD)(tracker.lookup("alignability", null));
|
||||||
int value;
|
if (record == null)
|
||||||
if (record == null) { value = 3; }
|
return null;
|
||||||
else
|
|
||||||
{
|
if (record.get("alignability") == null)
|
||||||
if (record.get("alignability") == null)
|
throw new RuntimeException("ERROR: alignability column not defined in alignability input.\n");
|
||||||
{
|
|
||||||
throw new RuntimeException("ERROR: alignability column not defined in alignability input.\n");
|
int value = Integer.parseInt(record.get("alignability"));
|
||||||
}
|
|
||||||
value = Integer.parseInt(record.get("alignability"));
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
map.put(getKeyName(), String.format("%d", value));
|
map.put(getKeyName(), String.format("%d", value));
|
||||||
return map;
|
return map;
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ import org.broadinstitute.sting.gatk.walkers.*;
|
||||||
import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.*;
|
import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.*;
|
||||||
import org.broadinstitute.sting.utils.*;
|
import org.broadinstitute.sting.utils.*;
|
||||||
import org.broadinstitute.sting.utils.genotype.vcf.*;
|
import org.broadinstitute.sting.utils.genotype.vcf.*;
|
||||||
import org.broadinstitute.sting.utils.genotype.Genotype;
|
|
||||||
import org.broadinstitute.sting.utils.cmdLine.Argument;
|
import org.broadinstitute.sting.utils.cmdLine.Argument;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
@ -54,6 +53,10 @@ public class VariantAnnotator extends LocusWalker<Integer, Integer> {
|
||||||
for (int i = 0; i < genotypeAnnotationClasses.size(); i++)
|
for (int i = 0; i < genotypeAnnotationClasses.size(); i++)
|
||||||
out.println("\t" + genotypeAnnotationClasses.get(i).getSimpleName());
|
out.println("\t" + genotypeAnnotationClasses.get(i).getSimpleName());
|
||||||
out.println();
|
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);
|
System.exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -168,12 +171,4 @@ public class VariantAnnotator extends LocusWalker<Integer, Integer> {
|
||||||
|
|
||||||
vcfWriter.close();
|
vcfWriter.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Genotype getFirstVariant(char ref, List<Genotype> genotypes) {
|
|
||||||
for ( Genotype g : genotypes ) {
|
|
||||||
if ( g.isVariant(ref) )
|
|
||||||
return g;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue