private void CreateCustIntervalTsv(string fileName) { if (string.IsNullOrEmpty(fileName)) { return; } var benchMark = new Benchmark(); var version = DataSourceVersionReader.GetSourceVersion(fileName); var reader = new CustomIntervalParser(new FileInfo(fileName), _refNamesDictionary); using (var writer = new IntervalTsvWriter(_outputDirectory, version, _genomeAssembly.ToString(), SaTsvCommon.CustIntervalSchemaVersion, reader.KeyName, ReportFor.AllVariants)) { foreach (var custInterval in reader.GetCustomIntervals()) { writer.AddEntry(custInterval.Chromosome.EnsemblName, custInterval.Start, custInterval.End, custInterval.GetJsonString()); } } var timeSpan = Benchmark.ToHumanReadable(benchMark.GetElapsedTime()); TsvWriterUtilities.WriteCompleteInfo("customInterval", fileName, timeSpan); }
public void CustomIntervalTypeReaderTest() { var customFile = new FileInfo(Resources.TopPath("icslInterval.bed")); var customReader = new CustomIntervalParser(customFile, _refChromDict); // all items from this file should be of type cosmic. foreach (var customInterval in customReader.GetCustomIntervals()) { Assert.Equal("IcslIntervals", customInterval.Type); } }
public CustomIntervalDbCreator(string bedFile, string outputDirectory, ChromosomeRenamer renamer) { if (bedFile == null) { return; } _renamer = renamer; _outputDirectory = outputDirectory; _observedRefSeq = new HashSet <string>(); _intervalParser = new CustomIntervalParser(new FileInfo(bedFile), renamer); _dataVersion = AddSourceVersion(bedFile); }
public void InforFieldsTest() { var customFile = new FileInfo(Resources.TopPath("icslInterval.bed")); var customReader = new CustomIntervalParser(customFile, _refChromDict); // all items from this file should be of type cosmic. var i = 0; foreach (var customInterval in customReader.GetCustomIntervals()) { switch (i) { case 0: //checking the first item Assert.Equal("chr1", customInterval.Chromosome.UcscName); Assert.Equal(69091, customInterval.Start); Assert.Equal(70008, customInterval.End); Assert.Equal("OR4F5", customInterval.StringValues["gene"]); Assert.Equal("0.0", customInterval.NonStringValues["score"]); Assert.Equal("3.60208899915", customInterval.NonStringValues["exacScore"]); Assert.Equal("Some_evidence_of_constraint", customInterval.StringValues["assesment"]); break; case 1: Assert.Equal("chr1", customInterval.Chromosome.UcscName); Assert.Equal(861121, customInterval.Start); Assert.Equal(879582, customInterval.End); Assert.Equal("SAMD11", customInterval.StringValues["gene"]); Assert.Equal("0.997960686608", customInterval.NonStringValues["score"]); Assert.Equal("-3.7861959419", customInterval.NonStringValues["exacScore"]); Assert.Equal("Minimal_evidence_of_constraint", customInterval.StringValues["assesment"]); break; } i++; } }