Skip to content

Commit

Permalink
add trailing no-count records to sd and rd (#8045)
Browse files Browse the repository at this point in the history
  • Loading branch information
tedsharpe authored Oct 6, 2022
1 parent c54ab58 commit 9e03432
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 253 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -802,9 +802,11 @@ static void walkReadMatches( final GATKRead read,
}

public void close() {
while ( !siteDepthQueue.isEmpty() ) {
writer.write(siteDepthQueue.removeFirst());
}
do {
while ( !siteDepthQueue.isEmpty() ) {
writer.write(siteDepthQueue.removeFirst());
}
} while ( readNextLocus() );
writer.close();
}

Expand Down Expand Up @@ -990,6 +992,11 @@ void close() {
if ( depthEvidence != null ) {
writer.write(depthEvidence);
countCounter.addCount(depthEvidence.getCounts()[0]);
final int[] emptyCount = new int[1];
while ( intervalIterator.hasNext() ) {
writer.write(new DepthEvidence(intervalIterator.next(), emptyCount));
countCounter.addCount(0);
}
}
writer.close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
public class CollectSVEvidenceIntegrationTest extends CommandLineProgramTest {

public static final String pesrTestDir = toolsTestDir + "walkers/sv/pesr";
public static final String tinyVCF = largeFileTestDir + "CEUTrio.HiSeq.WGS.b37.NA12878.20.21.tiny.vcf";

@Test
public void testPECollection() throws Exception {
Expand All @@ -38,7 +37,7 @@ public void testSRCollection() throws Exception {
@Test
public void testSDCollection() throws Exception {
final IntegrationTestSpec spec = new IntegrationTestSpec(
"-I " + NA12878_20_21_WGS_bam + " --sample-name NA12878 -F " + tinyVCF + " -SD %s",
"-I " + NA12878_20_21_WGS_bam + " --sample-name NA12878 -F " + pesrTestDir + "/snpSites.vcf -SD %s",
Collections.singletonList(pesrTestDir + "/NA12878" + SiteDepthCodec.FORMAT_SUFFIX + ".gz"));
spec.setOutputFileExtension(SiteDepthCodec.FORMAT_SUFFIX + ".gz");
spec.executeTest("SD collection", this);
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,250 +1,6 @@
20 9000000 9001000
20 9001000 9002000
20 10000000 10001000
20 10001000 10002000
20 10002000 10003000
20 10003000 10004000
20 10004000 10005000
20 10005000 10006000
20 10006000 10007000
20 10007000 10008000
20 10008000 10009000
20 10009000 10010000
20 10010000 10011000
20 10011000 10012000
20 10012000 10013000
20 10013000 10014000
20 10014000 10015000
20 10015000 10016000
20 10016000 10017000
20 10017000 10018000
20 10018000 10019000
20 10019000 10020000
20 10020000 10021000
20 10021000 10022000
20 10022000 10023000
20 10023000 10024000
20 10024000 10025000
20 10025000 10026000
20 10026000 10027000
20 10027000 10028000
20 10028000 10029000
20 10029000 10030000
20 10030000 10031000
20 10031000 10032000
20 10032000 10033000
20 10033000 10034000
20 10034000 10035000
20 10035000 10036000
20 10036000 10037000
20 10037000 10038000
20 10038000 10039000
20 10039000 10040000
20 10040000 10041000
20 10041000 10042000
20 10042000 10043000
20 10043000 10044000
20 10044000 10045000
20 10045000 10046000
20 10046000 10047000
20 10047000 10048000
20 10048000 10049000
20 10049000 10050000
20 10050000 10051000
20 10051000 10052000
20 10052000 10053000
20 10053000 10054000
20 10054000 10055000
20 10055000 10056000
20 10056000 10057000
20 10057000 10058000
20 10058000 10059000
20 10059000 10060000
20 10060000 10061000
20 10061000 10062000
20 10062000 10063000
20 10063000 10064000
20 10064000 10065000
20 10065000 10066000
20 10066000 10067000
20 10067000 10068000
20 10068000 10069000
20 10069000 10070000
20 10070000 10071000
20 10071000 10072000
20 10072000 10073000
20 10073000 10074000
20 10074000 10075000
20 10075000 10076000
20 10076000 10077000
20 10077000 10078000
20 10078000 10079000
20 10079000 10080000
20 10080000 10081000
20 10081000 10082000
20 10082000 10083000
20 10083000 10084000
20 10084000 10085000
20 10085000 10086000
20 10086000 10087000
20 10087000 10088000
20 10088000 10089000
20 10089000 10090000
20 10090000 10091000
20 10091000 10092000
20 10092000 10093000
20 10093000 10094000
20 10094000 10095000
20 10095000 10096000
20 10096000 10097000
20 10097000 10098000
20 10098000 10099000
20 10099000 10100000
20 10100000 10101000
20 10101000 10102000
20 10102000 10103000
20 10103000 10104000
20 10104000 10105000
20 10105000 10106000
20 10106000 10107000
20 10107000 10108000
20 10108000 10109000
20 10109000 10110000
20 10110000 10111000
20 10111000 10112000
20 10112000 10113000
20 10113000 10114000
20 10114000 10115000
20 10115000 10116000
20 10116000 10117000
20 10117000 10118000
20 10118000 10119000
20 10119000 10120000
20 10120000 10121000
20 10121000 10122000
20 10122000 10123000
20 10123000 10124000
20 10124000 10125000
20 10125000 10126000
20 10126000 10127000
20 10127000 10128000
20 10128000 10129000
20 10129000 10130000
20 10130000 10131000
20 10131000 10132000
20 10132000 10133000
20 10133000 10134000
20 10134000 10135000
20 10135000 10136000
20 10136000 10137000
20 10137000 10138000
20 10138000 10139000
20 10139000 10140000
20 10140000 10141000
20 10141000 10142000
20 10142000 10143000
20 10143000 10144000
20 10144000 10145000
20 10145000 10146000
20 10146000 10147000
20 10147000 10148000
20 10148000 10149000
20 10149000 10150000
20 10150000 10151000
20 10151000 10152000
20 10152000 10153000
20 10153000 10154000
20 10154000 10155000
20 10155000 10156000
20 10156000 10157000
20 10157000 10158000
20 10158000 10159000
20 10159000 10160000
20 10160000 10161000
20 10161000 10162000
20 10162000 10163000
20 10163000 10164000
20 10164000 10165000
20 10165000 10166000
20 10166000 10167000
20 10167000 10168000
20 10168000 10169000
20 10169000 10170000
20 10170000 10171000
20 10171000 10172000
20 10172000 10173000
20 10173000 10174000
20 10174000 10175000
20 10175000 10176000
20 10176000 10177000
20 10177000 10178000
20 10178000 10179000
20 10179000 10180000
20 10180000 10181000
20 10181000 10182000
20 10182000 10183000
20 10183000 10184000
20 10184000 10185000
20 10185000 10186000
20 10186000 10187000
20 10187000 10188000
20 10188000 10189000
20 10189000 10190000
20 10190000 10191000
20 10191000 10192000
20 10192000 10193000
20 10193000 10194000
20 10194000 10195000
20 10195000 10196000
20 10196000 10197000
20 10197000 10198000
20 10198000 10199000
20 10199000 10200000
20 10200000 10201000
20 10201000 10202000
20 10202000 10203000
20 10203000 10204000
20 10204000 10205000
20 10205000 10206000
20 10206000 10207000
20 10207000 10208000
20 10208000 10209000
20 10209000 10210000
20 10210000 10211000
20 10211000 10212000
20 10212000 10213000
20 10213000 10214000
20 10214000 10215000
20 10215000 10216000
20 10216000 10217000
20 10217000 10218000
20 10218000 10219000
20 10219000 10220000
20 10220000 10221000
20 10221000 10222000
20 10222000 10223000
20 10223000 10224000
20 10224000 10225000
20 10225000 10226000
20 10226000 10227000
20 10227000 10228000
20 10228000 10229000
20 10229000 10230000
20 10230000 10231000
20 10231000 10232000
20 10232000 10233000
20 10233000 10234000
20 10234000 10235000
20 10235000 10236000
20 10236000 10237000
20 10237000 10238000
20 10238000 10239000
20 10239000 10240000
20 10240000 10241000
20 10241000 10242000
20 10242000 10243000
20 10243000 10244000
20 10244000 10245000
20 10245000 10246000
20 10246000 10247000
20 10247000 10248000
20 10248000 10249000
20 10249000 10250000
20 10260000 10261000
20 10261000 10262000
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
##fileformat=VCFv4.2
##FILTER=<ID=LowQual,Description="Low quality">
##FORMAT=<ID=AD,Number=R,Type=Integer,Description="Allelic depths for the ref and alt alleles in the order listed">
##FORMAT=<ID=DP,Number=1,Type=Integer,Description="Approximate read depth (reads with MQ=255 or with bad mates are filtered)">
##FORMAT=<ID=GQ,Number=1,Type=Integer,Description="Genotype Quality">
##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype">
##FORMAT=<ID=PL,Number=G,Type=Integer,Description="Normalized, Phred-scaled likelihoods for genotypes as defined in the VCF specification">
##INFO=<ID=AC,Number=A,Type=Integer,Description="Allele count in genotypes, for each ALT allele, in the same order as listed">
##INFO=<ID=AF,Number=A,Type=Float,Description="Allele Frequency, for each ALT allele, in the same order as listed">
##INFO=<ID=AN,Number=1,Type=Integer,Description="Total number of alleles in called genotypes">
##INFO=<ID=BaseQRankSum,Number=1,Type=Float,Description="Z-score from Wilcoxon rank sum test of Alt Vs. Ref base qualities">
##INFO=<ID=DP,Number=1,Type=Integer,Description="Approximate read depth; some reads may have been filtered">
##INFO=<ID=DS,Number=0,Type=Flag,Description="Were any of the samples downsampled?">
##INFO=<ID=ExcessHet,Number=1,Type=Float,Description="Phred-scaled p-value for exact test of excess heterozygosity">
##INFO=<ID=FS,Number=1,Type=Float,Description="Phred-scaled p-value using Fisher's exact test to detect strand bias">
##INFO=<ID=InbreedingCoeff,Number=1,Type=Float,Description="Inbreeding coefficient as estimated from the genotype likelihoods per-sample when compared against the Hardy-Weinberg expectation">
##INFO=<ID=MLEAC,Number=A,Type=Integer,Description="Maximum likelihood expectation (MLE) for the allele counts (not necessarily the same as the AC), for each ALT allele, in the same order as listed">
##INFO=<ID=MLEAF,Number=A,Type=Float,Description="Maximum likelihood expectation (MLE) for the allele frequency (not necessarily the same as the AF), for each ALT allele, in the same order as listed">
##INFO=<ID=MQ,Number=1,Type=Float,Description="RMS Mapping Quality">
##INFO=<ID=MQRankSum,Number=1,Type=Float,Description="Z-score From Wilcoxon rank sum test of Alt vs. Ref read mapping qualities">
##INFO=<ID=QD,Number=1,Type=Float,Description="Variant Confidence/Quality by Depth">
##INFO=<ID=ReadPosRankSum,Number=1,Type=Float,Description="Z-score from Wilcoxon rank sum test of Alt vs. Ref read position bias">
##INFO=<ID=SOR,Number=1,Type=Float,Description="Symmetric Odds Ratio of 2x2 contingency table to detect strand bias">
##contig=<ID=20,length=63025520>
##contig=<ID=21,length=48129895>
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT NA12878
21 9000001 . A G 41.28 . AC=2;AF=1.00;AN=2;DP=2;ExcessHet=3.0103;FS=0.000;MLEAC=1;MLEAF=0.500;MQ=60.00;QD=20.64;SOR=0.693 GT:AD:DP:GQ:PL 1/1:0,2:2:6:53,6,0
21 9000002 . A G 41.28 . AC=2;AF=1.00;AN=2;DP=2;ExcessHet=3.0103;FS=0.000;MLEAC=1;MLEAF=0.500;MQ=60.00;QD=20.64;SOR=0.693 GT:AD:DP:GQ:PL 1/1:0,2:2:6:53,6,0
21 10032937 . C T 78.28 . AC=2;AF=1.00;AN=2;DP=2;ExcessHet=3.0103;FS=0.000;MLEAC=1;MLEAF=0.500;MQ=59.50;QD=25.36;SOR=0.693 GT:AD:DP:GQ:PL 1/1:0,2:2:6:90,6,0
21 10085649 . A G 78.28 . AC=2;AF=1.00;AN=2;DP=2;ExcessHet=3.0103;FS=0.000;MLEAC=1;MLEAF=0.500;MQ=59.50;QD=28.73;SOR=0.693 GT:AD:DP:GQ:PL 1/1:0,2:2:6:90,6,0
21 10085652 . C A 58.60 . AC=1;AF=0.500;AN=2;BaseQRankSum=1.611;DP=8;ExcessHet=3.0103;FS=0.000;MLEAC=1;MLEAF=0.500;MQ=59.88;MQRankSum=0.319;QD=7.33;ReadPosRankSum=1.242;SOR=0.693 GT:AD:DP:GQ:PL 0/1:6,2:8:66:66,0,722
21 10085654 . G C 58.60 . AC=1;AF=0.500;AN=2;BaseQRankSum=-2.100;DP=8;ExcessHet=3.0103;FS=0.000;MLEAC=1;MLEAF=0.500;MQ=59.88;MQRankSum=0.319;QD=7.33;ReadPosRankSum=1.242;SOR=0.693 GT:AD:DP:GQ:PL 0/1:6,2:8:66:66,0,722
21 10260001 . C T 78.28 . AC=2;AF=1.00;AN=2;DP=2;ExcessHet=3.0103;FS=0.000;MLEAC=1;MLEAF=0.500;MQ=59.50;QD=25.36;SOR=0.693 GT:AD:DP:GQ:PL 1/1:0,2:2:6:90,6,0
21 10260002 . A G 78.28 . AC=2;AF=1.00;AN=2;DP=2;ExcessHet=3.0103;FS=0.000;MLEAC=1;MLEAF=0.500;MQ=59.50;QD=28.73;SOR=0.693 GT:AD:DP:GQ:PL 1/1:0,2:2:6:90,6,0

0 comments on commit 9e03432

Please sign in to comment.