Annotator in general should be able to annotate monomorphic or tri-allelic sites.

It's up to the individual annotations to decide whether they want to annotate or not.


git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2556 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
ebanks 2010-01-11 19:52:18 +00:00
parent 11f91b3c95
commit 42aff1d2c3
5 changed files with 8 additions and 9 deletions

View File

@ -15,7 +15,7 @@ public class AlleleBalance extends StandardVariantAnnotation {
public String annotate(RefMetaDataTracker tracker, ReferenceContext ref, Map<String, StratifiedAlignmentContext> stratifiedContexts, Variation variation) {
if ( !(variation instanceof VariantBackedByGenotype) )
if ( !variation.isBiallelic() || !(variation instanceof VariantBackedByGenotype) )
return null;
final List<Genotype> genotypes = ((VariantBackedByGenotype)variation).getGenotypes();
if ( genotypes == null || genotypes.size() == 0 )

View File

@ -20,8 +20,9 @@ public class RankSumTest implements VariantAnnotation {
public String annotate(RefMetaDataTracker tracker, ReferenceContext ref, Map<String, StratifiedAlignmentContext> stratifiedContexts, Variation variation) {
if ( !(variation instanceof VariantBackedByGenotype) )
if ( !variation.isBiallelic() || !variation.isSNP() || !(variation instanceof VariantBackedByGenotype) )
return null;
final List<Genotype> genotypes = ((VariantBackedByGenotype)variation).getGenotypes();
if ( genotypes == null || genotypes.size() == 0 )
return null;

View File

@ -162,10 +162,8 @@ public class VariantAnnotator extends RodWalker<Integer, Integer> {
Map<String, String> annotations = new HashMap<String, String>();
VariationRod variant = (VariationRod)rods.getRecords().get(0);
// if the reference base is not ambiguous, the variant is a SNP, and it's the appropriate type, we can annotate
if ( BaseUtils.simpleBaseToBaseIndex(ref.getBase()) != -1 &&
variant.isBiallelic() &&
variant.isSNP() ) {
// if the reference base is not ambiguous, we can annotate
if ( BaseUtils.simpleBaseToBaseIndex(ref.getBase()) != -1 ) {
Map<String, StratifiedAlignmentContext> stratifiedContexts = StratifiedAlignmentContext.splitContextBySample(context.getBasePileup());
if ( stratifiedContexts != null )
annotations = getAnnotations(tracker, ref, stratifiedContexts, variant, requestedAnnotations);

View File

@ -66,7 +66,7 @@ public class VariantAnnotatorIntegrationTest extends WalkerTest {
public void testHasAnnotsAsking1() {
WalkerTestSpec spec = new WalkerTestSpec(
baseTestString() + " -standard -B variant,VCF," + validationDataLocation + "vcfexample2.vcf -I " + validationDataLocation + "low_coverage_CEU.chr1.10k-11k.bam -L 1:10,020,000-10,021,000", 1,
Arrays.asList("ad0d78f399bba23227cf07341708e27d"));
Arrays.asList("e3282acfec015441dfc38715d5bfe530"));
executeTest("test file has annotations, asking for annotations, #1", spec);
}
@ -98,7 +98,7 @@ public class VariantAnnotatorIntegrationTest extends WalkerTest {
public void testNoAnnotsAsking1() {
WalkerTestSpec spec = new WalkerTestSpec(
baseTestString() + " -standard -B variant,VCF," + validationDataLocation + "vcfexample2empty.vcf -I " + validationDataLocation + "low_coverage_CEU.chr1.10k-11k.bam -L 1:10,020,000-10,021,000", 1,
Arrays.asList("b8609ff527e0882dfbe3505357fd2705"));
Arrays.asList("20943a3666ceef605d9154b6f2ff2fa1"));
executeTest("test file doesn't have annotations, asking for annotations, #1", spec);
}

View File

@ -22,7 +22,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest {
public void testMultiSamplePilot1PointEM() {
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
"-T UnifiedGenotyper -R " + oneKGLocation + "reference/human_b36_both.fasta -I " + validationDataLocation + "low_coverage_CEU.chr1.10k-11k.bam -varout %s -L 1:10,023,400-10,024,000 -bm empirical -gm EM_POINT_ESTIMATE -confidence 30", 1,
Arrays.asList("b7ea2739f9190ea6c5c63ffd1150454e"));
Arrays.asList("ee02dbbbbe957ccf0ee79dcdfd7abff6"));
executeTest("testMultiSamplePilot1 - Point Estimate EM", spec);
}