Example #1
0
        public void GetCancerTypeCount_same_study()
        {
            var cosmicItem = new CosmicItem(ChromosomeUtilities.Chr1, 100, "rs101", "A", "C", "GENE0", new HashSet <CosmicItem.CosmicStudy>
            {
                new CosmicItem.CosmicStudy("100", new [] { "primary histology 0", "histology subtype 1" }, new [] { "primarySite 0", "site subtype 1" }),
                new CosmicItem.CosmicStudy("100", new [] { "primary histology 0", "histology subtype 1" }, new [] { "primarySite 0", "site subtype 1" })
            }, 1);

            var cancerTypeCounts = cosmicItem.GetCancerTypeCounts();

            Assert.Equal(2, cancerTypeCounts.Count);
            Assert.Equal(1, cancerTypeCounts["primary histology 0"]);
            Assert.Equal(1, cancerTypeCounts["histology subtype 1"]);
        }
Example #2
0
        public void GetCancerTypeCount_different_studies()
        {
            var cosmicItem = new CosmicItem(new Chromosome("chr1", "1", 0), 100, "rs101", "A", "C", "GENE0", new HashSet <CosmicItem.CosmicStudy>
            {
                new CosmicItem.CosmicStudy("100", new [] { "primary histology 0", "histology subtype 1" }, new [] { "primarySite 0", "site subtype 1" }),
                new CosmicItem.CosmicStudy("101", new [] { "primary histology 0", "histology subtype 2" }, new [] { "primarySite 0", "site subtype 1" })
            }, 1);

            var cancerTypeCounts = cosmicItem.GetCancerTypeCounts();

            Assert.Equal(3, cancerTypeCounts.Count());
            Assert.Equal(2, cancerTypeCounts["primary histology 0"]);
            Assert.Equal(1, cancerTypeCounts["histology subtype 1"]);
            Assert.Equal(1, cancerTypeCounts["histology subtype 2"]);
        }