-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from Illumina/feature/WIT-154
Fix issue with base stats when bed files include truth but not query …
- Loading branch information
Showing
25 changed files
with
298 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
chr1 40000000 80500000 | ||
chr2 40000000 80500000 | ||
chr2 85000000 95510000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
chr1 145600000 146000000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[ | ||
{ | ||
"variantType": "Duplication", | ||
"binSizes": "1000,5000,10000,20000,50000", | ||
"bpDistance": 10000, | ||
"percentDistance": 0.25, | ||
"includedFilters": "PASS", | ||
"excludedFilters": "", | ||
"includeBed": "" | ||
}, | ||
{ | ||
"variantType": "Deletion", | ||
"binSizes": "1000,5000,10000,20000,50000", | ||
"bpDistance": 10000, | ||
"percentDistance": 0.25, | ||
"includedFilters": "PASS", | ||
"excludedFilters": "", | ||
"includeBed": "" | ||
}, | ||
{ | ||
"variantType": "CopyNumberReference", | ||
"binSizes": "1000,5000,10000,20000,50000", | ||
"bpDistance": 10000, | ||
"percentDistance": 0.25, | ||
"includedFilters": "PASS", | ||
"excludedFilters": "", | ||
"includeBed": "" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
##fileformat=VCFv4.2 | ||
##contig=<ID=chr1,length=249250621> | ||
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT QUERY | ||
chr1 145518989 . N <DEL> 150 PASS END=145809108;REFLEN=290119;SVLEN=-290119;SVTYPE=CNV GT:SM:CN:BC:PE 0/1:0.507438:1:110:28,0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
##fileformat=VCFv4.2 | ||
##contig=<ID=chr1,length=249250621> | ||
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT TRUTH | ||
chr1 145602105 . N <DEL> 150 PASS END=145808783;REFLEN=206678;SVTYPE=DEL; GT:CN 0/1:1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using System.Collections.Immutable; | ||
using System.IO; | ||
using System.Linq; | ||
using Ilmn.Das.App.Wittyer.Infrastructure; | ||
using Ilmn.Das.App.Wittyer.Input; | ||
using Ilmn.Das.App.Wittyer.Stats; | ||
using Ilmn.Das.Core.Tries.Extensions; | ||
using Ilmn.Das.Std.AppUtils.Misc; | ||
using Ilmn.Das.Std.XunitUtils; | ||
using Xunit; | ||
|
||
namespace Ilmn.Das.App.Wittyer.Test | ||
{ | ||
public class Wit149 | ||
{ | ||
private static readonly FileInfo Truth = | ||
Path.Combine("Resources", "WIT-149", "truth.vcf").ToFileInfo(); | ||
|
||
private static readonly FileInfo Query = | ||
Path.Combine("Resources", "WIT-149", "query.vcf").ToFileInfo(); | ||
|
||
private static readonly FileInfo Bed = | ||
Path.Combine("Resources", "WIT-149", "bed.bed").ToFileInfo(); | ||
|
||
[Fact] | ||
public void WholeChrIncluded() | ||
{ | ||
var outputDirectory = Path.GetRandomFileName().ToDirectoryInfo(); | ||
var inputSpecs = InputSpec.GenerateDefaultInputSpecs(false).Select(i => InputSpec.Create(i.VariantType, i.BinSizes, | ||
10000, i.PercentDistance, i.ExcludedFilters, i.IncludedFilters, IncludeBedFile.CreateFromBedFile(Bed))) | ||
.ToDictionary(i => i.VariantType, i => i); | ||
var wittyerSettings = WittyerSettings.Create(outputDirectory, Truth, Query, | ||
ImmutableList<ISamplePair>.Empty, EvaluationMode.CrossTypeAndSimpleCounting, | ||
inputSpecs); | ||
|
||
var (_, query, truth) = MainLauncher.GenerateResults(wittyerSettings).EnumerateSuccesses().First(); | ||
var results = MainLauncher.GenerateSampleMetrics(truth, query, false, inputSpecs); | ||
// should be end of bed - (start of query + 1 for padded base) = 135086622 - 1 = 135086621 | ||
MultiAssert.Equal(135086621U, results.OverallStats[StatsType.Base].QueryStats.TrueCount); | ||
MultiAssert.Equal(135086621U, results.OverallStats[StatsType.Base].TruthStats.TrueCount); | ||
MultiAssert.Equal(1U, results.OverallStats[StatsType.Event].QueryStats.TrueCount); | ||
MultiAssert.Equal(1U, results.OverallStats[StatsType.Event].TruthStats.TrueCount); | ||
MultiAssert.AssertAll(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using System.Collections.Generic; | ||
using System.Collections.Immutable; | ||
using System.IO; | ||
using System.Linq; | ||
using Ilmn.Das.App.Wittyer.Infrastructure; | ||
using Ilmn.Das.App.Wittyer.Input; | ||
using Ilmn.Das.App.Wittyer.Stats; | ||
using Ilmn.Das.App.Wittyer.Vcf.Variants; | ||
using Ilmn.Das.Core.Tries.Extensions; | ||
using Ilmn.Das.Std.AppUtils.Misc; | ||
using Ilmn.Das.Std.XunitUtils; | ||
using Xunit; | ||
|
||
namespace Ilmn.Das.App.Wittyer.Test | ||
{ | ||
public class Wit154 | ||
{ | ||
private static readonly FileInfo Truth = | ||
Path.Combine("Resources", "WIT-154", "truth.vcf").ToFileInfo(); | ||
|
||
private static readonly FileInfo Query = | ||
Path.Combine("Resources", "WIT-154", "query.vcf").ToFileInfo(); | ||
|
||
private static readonly FileInfo Bed = | ||
Path.Combine("Resources", "WIT-154", "bed.bed").ToFileInfo(); | ||
|
||
private static readonly FileInfo Config = | ||
Path.Combine("Resources", "WIT-154", "config.json").ToFileInfo(); | ||
|
||
[Fact] | ||
public void CrossType_ComplexBed_Works() | ||
{ | ||
var outputDirectory = Path.GetRandomFileName().ToDirectoryInfo(); | ||
var inputSpecs = InputSpec.CreateSpecsFromString( | ||
File.ReadAllText(Config.FullName), IncludeBedFile.CreateFromBedFile(Bed)) | ||
?.ToDictionary(i => i.VariantType, i => i) | ||
?? new Dictionary<WittyerType, InputSpec>(); | ||
var wittyerSettings = WittyerSettings.Create(outputDirectory, Truth, Query, | ||
ImmutableList<ISamplePair>.Empty, EvaluationMode.CrossTypeAndSimpleCounting, | ||
inputSpecs); | ||
|
||
var (_, query, truth) = MainLauncher.GenerateResults(wittyerSettings) | ||
.EnumerateSuccesses().First(); | ||
var results = MainLauncher | ||
.GenerateSampleMetrics(truth, query, false, inputSpecs); | ||
var baseStats = results.DetailedStats[WittyerType.Deletion].OverallStats[StatsType.Base]; | ||
MultiAssert.Equal(206678U, baseStats.QueryStats.TrueCount); | ||
MultiAssert.Equal(206678U, baseStats.TruthStats.TrueCount); | ||
MultiAssert.AssertAll(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.