예제 #1
0
        public void TestClusters(string databasetPath, int minMsMsCount)
        {
            var providers = DataAccessFactory.CreateDataAccessProviders(databasetPath, false);
            var clusters  = providers.ClusterCache.FindAll();

            Console.WriteLine(@"Cluster ID\tCluster Size\tMs Ms Total\tMatching");
            foreach (var cluster in clusters)
            {
                var clusterPeptideMap = new ClusterIdentificationStatistic();

                if (cluster.MsMsCount > minMsMsCount)
                {
                    cluster.ReconstructUMCCluster(providers, true, false, true, true);
                }

                var hasIdentifications = false;
                foreach (var umc in cluster.UmcList)
                {
                    foreach (var feature in umc.Features)
                    {
                        foreach (var spectrum in feature.MSnSpectra)
                        {
                            foreach (var peptide in spectrum.Peptides)
                            {
                                var sequence = peptide.Sequence;
                                if (!clusterPeptideMap.Peptides.ContainsKey(sequence))
                                {
                                    clusterPeptideMap.Peptides.Add(sequence, 0);
                                    clusterPeptideMap.PeptideDatasets.Add(sequence, new List <int>());
                                }
                                clusterPeptideMap.PeptideDatasets[sequence].Add(umc.GroupId);
                                clusterPeptideMap.Peptides[sequence]++;
                                hasIdentifications = true;
                            }
                        }
                    }
                }

                if (hasIdentifications)
                {
                    Console.WriteLine("{0}\t{1}\t{2}\t{3}", cluster.Id, cluster.UmcList.Count, cluster.MsMsCount,
                                      clusterPeptideMap.TotalDatasetsObserved);
                }
            }
        }
예제 #2
0
        public void TestClusters(string databasetPath, int minMsMsCount)
        {
            var providers = DataAccessFactory.CreateDataAccessProviders(databasetPath, false);
            var clusters = providers.ClusterCache.FindAll();

            Console.WriteLine(@"Cluster ID\tCluster Size\tMs Ms Total\tMatching");
            foreach (var cluster in clusters)
            {
                var clusterPeptideMap = new ClusterIdentificationStatistic();

                if (cluster.MsMsCount > minMsMsCount)

                    cluster.ReconstructUMCCluster(providers, true, true);

                var hasIdentifications = false;
                foreach (var umc in cluster.UmcList)
                {
                    foreach (var feature in umc.Features)
                    {
                        foreach (var spectrum in feature.MSnSpectra)
                        {
                            foreach (var peptide in spectrum.Peptides)
                            {
                                var sequence = peptide.Sequence;
                                if (!clusterPeptideMap.Peptides.ContainsKey(sequence))
                                {
                                    clusterPeptideMap.Peptides.Add(sequence, 0);
                                    clusterPeptideMap.PeptideDatasets.Add(sequence, new List<int>());
                                }
                                clusterPeptideMap.PeptideDatasets[sequence].Add(umc.GroupId);
                                clusterPeptideMap.Peptides[sequence]++;
                                hasIdentifications = true;
                            }
                        }
                    }
                }

                if (hasIdentifications)
                    Console.WriteLine("{0}\t{1}\t{2}\t{3}", cluster.Id, cluster.UmcList.Count, cluster.MsMsCount,
                        clusterPeptideMap.TotalDatasetsObserved);
            }
        }