VC utils prune method now will keep genotype attributes as well as info keys. RBP now emits a far reduce (NO INFO, only GT:GQ:PG) records, further reducing size of phasing output
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4882 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
8604335566
commit
60880b925f
|
|
@ -293,6 +293,7 @@ public class VariantContextUtils {
|
||||||
Map<String, Object> d = mvc.getAttributes();
|
Map<String, Object> d = mvc.getAttributes();
|
||||||
mvc.clearAttributes();
|
mvc.clearAttributes();
|
||||||
for ( String key : keysToPreserve )
|
for ( String key : keysToPreserve )
|
||||||
|
if ( d.containsKey(key) )
|
||||||
mvc.putAttribute(key, d.get(key));
|
mvc.putAttribute(key, d.get(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -301,6 +302,9 @@ public class VariantContextUtils {
|
||||||
for ( Genotype g : gs ) {
|
for ( Genotype g : gs ) {
|
||||||
MutableGenotype mg = new MutableGenotype(g);
|
MutableGenotype mg = new MutableGenotype(g);
|
||||||
mg.clearAttributes();
|
mg.clearAttributes();
|
||||||
|
for ( String key : keysToPreserve )
|
||||||
|
if ( g.hasAttribute(key) )
|
||||||
|
mg.putAttribute(key, g.getAttribute(key));
|
||||||
mvc.addGenotype(mg);
|
mvc.addGenotype(mg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -241,13 +241,14 @@ public class ReadBackedPhasingWalker extends RodWalker<PhasingStatsAndOutput, Ph
|
||||||
return new PhasingStatsAndOutput(phaseStats, completedList);
|
return new PhasingStatsAndOutput(phaseStats, completedList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final Set<String> KEYS_TO_KEEP_IN_REDUCED_VCF = new HashSet<String>(Arrays.asList("PQ"));
|
||||||
private VariantContext reduceVCToSamples(VariantContext vc, List<String> samplesToPhase) {
|
private VariantContext reduceVCToSamples(VariantContext vc, List<String> samplesToPhase) {
|
||||||
// for ( String sample : samplesToPhase )
|
// for ( String sample : samplesToPhase )
|
||||||
// logger.debug(String.format(" Sample %s has genotype %s, het = %s", sample, vc.getGenotype(sample), vc.getGenotype(sample).isHet() ));
|
// logger.debug(String.format(" Sample %s has genotype %s, het = %s", sample, vc.getGenotype(sample), vc.getGenotype(sample).isHet() ));
|
||||||
VariantContext subvc = vc.subContextFromGenotypes(vc.getGenotypes(samplesToPhase).values());
|
VariantContext subvc = vc.subContextFromGenotypes(vc.getGenotypes(samplesToPhase).values());
|
||||||
// logger.debug("original VC = " + vc);
|
// logger.debug("original VC = " + vc);
|
||||||
// logger.debug("sub VC = " + subvc);
|
// logger.debug("sub VC = " + subvc);
|
||||||
return subvc;
|
return VariantContextUtils.pruneVariantContext(subvc, KEYS_TO_KEEP_IN_REDUCED_VCF );
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<VariantContext> processQueue(PhasingStats phaseStats, boolean processAll) {
|
private List<VariantContext> processQueue(PhasingStats phaseStats, boolean processAll) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue