Merge pull request #555 from broadinstitute/eb_add_option_to_CGVCFs_for_all_sites_GVCF
Added an option to CombineGVCFs to create basepair resolution gVCFs from...
This commit is contained in:
commit
4e74e77e74
|
|
@ -134,6 +134,9 @@ public class CombineGVCFs extends RodWalker<CombineGVCFs.PositionalState, Combin
|
|||
@Output(doc="File to which the combined gVCF should be written")
|
||||
protected VariantContextWriter vcfWriter = null;
|
||||
|
||||
@Argument(fullName="convertToBasePairResolution", shortName="bpResolution", doc = "If specified, convert banded gVCFs to all-sites gVCFs", required=false)
|
||||
protected boolean USE_BP_RESOLUTION = false;
|
||||
|
||||
private GenomeLocParser genomeLocParser;
|
||||
|
||||
public void initialize() {
|
||||
|
|
@ -176,7 +179,7 @@ public class CombineGVCFs extends RodWalker<CombineGVCFs.PositionalState, Combin
|
|||
previousState.VCs.addAll(startingStates.VCs);
|
||||
}
|
||||
|
||||
if ( containsEndingContext(previousState.VCs, currentPos) ) {
|
||||
if ( USE_BP_RESOLUTION || containsEndingContext(previousState.VCs, currentPos) ) {
|
||||
endPreviousStates(previousState, currentPos, startingStates.refBases.length > 1 ? startingStates.refBases[1] : (byte)'N');
|
||||
}
|
||||
|
||||
|
|
@ -289,7 +292,8 @@ public class CombineGVCFs extends RodWalker<CombineGVCFs.PositionalState, Combin
|
|||
|
||||
// attributes
|
||||
final Map<String, Object> attrs = new HashMap<>(1);
|
||||
attrs.put(VCFConstants.END_KEY, Integer.toString(end));
|
||||
if ( !USE_BP_RESOLUTION )
|
||||
attrs.put(VCFConstants.END_KEY, Integer.toString(end));
|
||||
|
||||
// genotypes
|
||||
final GenotypesContext genotypes = GenotypesContext.create();
|
||||
|
|
|
|||
|
|
@ -165,4 +165,12 @@ public class CombineGVCFsIntegrationTest extends WalkerTest {
|
|||
spec.disableShadowBCF();
|
||||
executeTest("testMD5s", spec);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBasepairResolution() throws Exception {
|
||||
final String cmd = baseTestString(" -L 1:69485-69791 --convertToBasePairResolution");
|
||||
final WalkerTestSpec spec = new WalkerTestSpec(cmd, 1, Arrays.asList("a068fb2c35cdd14df1e8f1f92f4114b4"));
|
||||
spec.disableShadowBCF();
|
||||
executeTest("testBasepairResolution", spec);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue