The liftover code needs to *hard filter* records whose reference changes (since they no longer adhere to the VCF spec as they don't match the new reference - and can't be converted to VariantContext).
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3448 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
ff4a0764df
commit
e2674671e7
|
|
@ -132,11 +132,6 @@ public class VariantContextAdaptors {
|
|||
}
|
||||
|
||||
private static class VCFRecordAdaptor extends VCAdaptor {
|
||||
// // WARNING: do not use this method if you have anything other than point mutations in your VCF
|
||||
// VariantContext convert(String name, Object input) {
|
||||
// return vcfToVariantContext(name, (VCFRecord)input, null);
|
||||
// }
|
||||
|
||||
VariantContext convert(String name, Object input, ReferenceContext ref) {
|
||||
return vcfToVariantContext(name, (VCFRecord)input, ref);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@
|
|||
package org.broadinstitute.sting.gatk.walkers.vcf;
|
||||
|
||||
import org.broadinstitute.sting.utils.genotype.vcf.VCFWriter;
|
||||
import org.broadinstitute.sting.utils.BaseUtils;
|
||||
import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
|
||||
import org.broadinstitute.sting.gatk.walkers.*;
|
||||
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
|
||||
|
|
@ -55,22 +54,14 @@ public class FilterLiftedVCF extends RodWalker<Integer, Integer> {
|
|||
char recordRef = record.getReference().charAt(0);
|
||||
|
||||
if ( recordRef != ref ) {
|
||||
|
||||
// is it reverse complemented?
|
||||
if ( BaseUtils.simpleComplement(recordRef) == ref ) {
|
||||
record.setFilterString(record.isFiltered() ? String.format("%s;LiftoverToReverseComplementRefBase", record.getFilterString()) : "LiftoverToNewBase");
|
||||
failedLocs++;
|
||||
} else {
|
||||
record.setFilterString(record.isFiltered() ? String.format("%s;LiftoverToDifferentRefBase", record.getFilterString()) : "LiftoverToNewBase");
|
||||
failedLocs++;
|
||||
failedLocs++;
|
||||
} else {
|
||||
if ( writer == null ) {
|
||||
writer = new VCFWriter(out);
|
||||
writer.writeHeader(record.getHeader());
|
||||
}
|
||||
writer.addRecord(record);
|
||||
}
|
||||
|
||||
if ( writer == null ) {
|
||||
writer = new VCFWriter(out);
|
||||
writer.writeHeader(record.getHeader());
|
||||
}
|
||||
writer.addRecord(record);
|
||||
}
|
||||
|
||||
public Integer map(RefMetaDataTracker tracker, ReferenceContext ref, AlignmentContext context) {
|
||||
|
|
@ -80,7 +71,7 @@ public class FilterLiftedVCF extends RodWalker<Integer, Integer> {
|
|||
List<Object> rods = tracker.getReferenceMetaData("vcf");
|
||||
|
||||
for ( Object rod : rods )
|
||||
filterAndWrite(ref.getBaseAsChar(), (VCFRecord)rod);
|
||||
filterAndWrite((char)ref.getBase(), (VCFRecord)rod);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue