public void OneTranscriptOneHeterozygousSynonymous() { Genome genome = new Genome(Path.Combine(TestContext.CurrentContext.TestDirectory, "TestData", "chr1_sample.fa")); VCFParser vcf = new VCFParser(Path.Combine(TestContext.CurrentContext.TestDirectory, "TestVcfs", "chr_1_one_heterozygous_synonymous.vcf")); List <Variant> variants = vcf.Select(x => new Variant(null, x, genome)).ToList(); Assert.AreEqual(1, variants.Count); GeneModel geneModel = new GeneModel(genome, Path.Combine(TestContext.CurrentContext.TestDirectory, "TestData", "chr1_one_transcript.gtf")); List <Protein> proteins_wo_variant = geneModel.Translate(true).ToList(); List <Transcript> transcripts = geneModel.ApplyVariants(variants); List <Protein> proteins = transcripts.Select(t => t.Protein()).ToList(); Assert.AreEqual(1, geneModel.Genes.Count); Assert.AreEqual(1, proteins.Count); Assert.AreEqual(1, proteins_wo_variant.Count); Assert.AreEqual(1, new HashSet <string> { proteins[0].BaseSequence, proteins_wo_variant[0].BaseSequence }.Count); Assert.IsTrue(proteins.Any(p => p.FullName.Contains(FunctionalClass.SILENT.ToString()))); // synonymous Assert.IsTrue(proteins.Any(p => p.FullName.Contains(GenotypeType.HETEROZYGOUS.ToString()))); // synonymous Assert.IsTrue(proteins.Any(p => p.FullName.Contains("1:69666"))); string proteinFasta = Path.Combine(TestContext.CurrentContext.TestDirectory, "TestVcfs", "chr_1_one_heterozygous_synonymous.fasta"); ProteinDbWriter.WriteFastaDatabase(proteins, proteinFasta, " "); string[] proteinFastaLines = File.ReadLines(proteinFasta).ToArray(); Assert.IsTrue(proteinFastaLines[0].Contains(FunctionalClass.SILENT.ToString())); // synonymous Assert.IsTrue(proteinFastaLines[0].Contains("1:69666")); }
public void ParseVcf([Values("testData/NA12878.knowledgebase.snapshot.20131119.b37.vcf.gz")] string fname) { Assert.IsTrue(File.Exists(fname)); VCFParser vcp = new VCFParser(fname); var j = vcp.First(); var ii = j.Genotypes; var i = vcp.Select(x => x.NoCallCount).Count(); Console.WriteLine("Count: {0}", i); }
static void Main(string[] args) { fname = "testData/NA12878.knowledgebase.snapshot.20131119.b37.vcf.gz"; System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch(); sw.Start(); VCFParser vcp = new VCFParser(fname); var j = vcp.First(); var ii = j.Genotypes; var i = vcp.Select(x => x.NoCallCount).Count(); sw.Stop(); Console.WriteLine(sw.Elapsed.ToString()); }
static void Main (string[] args) { var fname = "testData/NA12878.knowledgebase.snapshot.20131119.b37.vcf.gz"; System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch (); sw.Start (); VCFParser vcp = new VCFParser (fname); var j = vcp.First (); var ii = j.Genotypes.Count; var i = vcp.Select (x => x.NoCallCount).Count (); sw.Stop (); Console.WriteLine("Count: {0}/{1}", ii,i); Console.WriteLine ("Elapsed: {0}", sw.Elapsed); var anyKey = Console.ReadKey(); }
public void test() { VCFParser parser = new VCFParser(Path.Combine(TestContext.CurrentContext.TestDirectory, @"testData", @"NA12878.knowledgebase.snapshot.20131119.b37.vcf.gz")); List <VariantContext> context = parser.Select(x => x).ToList(); }