示例#1
0
        public IdentificationCollectionTreeViewModel(IEnumerable <UMCClusterLightMatched> clusters,
                                                     IEnumerable <Peptide> peptides,
                                                     TreeItemViewModel parent)
        {
            var tags = new GenericCollectionTreeViewModel();

            tags.Name = "AMT Tags";

            foreach (var cluster in clusters)
            {
                foreach (var match in cluster.ClusterMatches)
                {
                    tags.Items.Add(new MassTagToClusterMatch(match.MassTag));
                }
            }

            var peptideItems = new GenericCollectionTreeViewModel();

            peptideItems.Name = "Database Searches";
            var peptideModels = (from peptide in peptides
                                 select new PeptideTreeViewModel(peptide)).ToList();

            foreach (var item in peptideModels)
            {
                peptideItems.Items.Add(item);
            }
        }
        public UMCClusterTreeViewModel(UMCClusterLightMatched matchedCluster, TreeItemViewModel parent)
        {
            m_items = new ObservableCollection<TreeItemViewModel>();
            m_parent = parent;
            m_cluster = matchedCluster;
            var features = new UMCCollectionTreeViewModel(matchedCluster.Cluster);
            features.FeatureSelected += feature_FeatureSelected;
            features.Name = "Features";

            // Cluster level statistics
            var cluster = matchedCluster.Cluster;
            AddStatistics("Mass", cluster.MassMonoisotopic);

            var item = new StringTreeViewItem(
                cluster.Net.ToString("F3",
                    CultureInfo.InvariantCulture),
                "NET");

            m_items.Add(item);

            if (cluster.DriftTime > 0)
            {
                AddStatistics("Drift Time", cluster.DriftTime);
            }
            AddStatistics("Datasets", cluster.DatasetMemberCount);
            AddStatistics("Total", cluster.MemberCount);

            AddStatistics("Total MS/MS", cluster.MsMsCount);
            AddStatistics("Total Identifications", cluster.IdentifiedSpectraCount);

            var allIdentifications = new GenericCollectionTreeViewModel();
            allIdentifications.Name = "Identifications";

            // Items to display the base childen.
            var identifications = new PeptideCollectionTreeViewModel(cluster);
            identifications.Name = "Search Results";
            identifications.FeatureSelected += feature_FeatureSelected;

            var spectra = new MsMsCollectionTreeViewModel(cluster);
            spectra.Name = "MS/MS";
            m_spectra = spectra;
            spectra.SpectrumSelected += spectra_SpectrumSelected;
            spectra.FeatureSelected += feature_FeatureSelected;

            var matches = new MassTagCollectionMatchTreeViewModel(matchedCluster.ClusterMatches);
            matches.Name = "AMT Tags";

            allIdentifications.Items.Add(identifications);
            allIdentifications.Items.Add(spectra);
            allIdentifications.Items.Add(matches);
            m_allIdentifications = allIdentifications;

            m_items.Add(features);
            m_items.Add(allIdentifications);
        }
示例#3
0
        public override void LoadChildren()
        {
            if (m_loaded)
            {
                return;
            }

            var peptides = m_parentCluster.FindPeptides();

            if (peptides.Count < 1)
            {
                return;
            }

            // Tally up the unique peptides
            var uniqueCounts = new Dictionary <string, List <Peptide> >();

            foreach (var peptide in peptides)
            {
                if (!uniqueCounts.ContainsKey(peptide.Sequence))
                {
                    uniqueCounts.Add(peptide.Sequence, new List <Peptide>());
                }
                uniqueCounts[peptide.Sequence].Add(peptide);
            }
            // Show that to the user
            AddStatistic("Unique Identifications", uniqueCounts.Count);
            AddStatistic("Total Identifications", peptides.Count);


            foreach (var sequence in uniqueCounts.Keys)
            {
                // Create a collection for each unique sequence
                var model = new GenericCollectionTreeViewModel();
                model.Name = sequence;
                model.AddStatistic("Total Members", uniqueCounts[sequence].Count);

                foreach (var p in uniqueCounts[sequence])
                {
                    var peptideModel = new PeptideTreeViewModel(p);
                    peptideModel.FeatureSelected += peptideModel_FeatureSelected;
                    model.Items.Add(peptideModel);
                }


                m_items.Add(model);
            }


            m_loaded = true;
        }
        public override void LoadChildren()
        {
            if (m_loaded)
                return;

            var peptides = m_parentCluster.FindPeptides();

            if (peptides.Count < 1)
                return;

            // Tally up the unique peptides
            var uniqueCounts = new Dictionary<string, List<Peptide>>();
            foreach (var peptide in peptides)
            {
                if (!uniqueCounts.ContainsKey(peptide.Sequence))
                {
                    uniqueCounts.Add(peptide.Sequence, new List<Peptide>());
                }
                uniqueCounts[peptide.Sequence].Add(peptide);
            }
            // Show that to the user
            AddStatistic("Unique Identifications", uniqueCounts.Count);
            AddStatistic("Total Identifications", peptides.Count);

            foreach (var sequence in uniqueCounts.Keys)
            {
                // Create a collection for each unique sequence
                var model = new GenericCollectionTreeViewModel();
                model.Name = sequence;
                model.AddStatistic("Total Members", uniqueCounts[sequence].Count);

                foreach (var p in uniqueCounts[sequence])
                {
                    var peptideModel = new PeptideTreeViewModel(p);
                    peptideModel.FeatureSelected += peptideModel_FeatureSelected;
                    model.Items.Add(peptideModel);
                }

                m_items.Add(model);
            }

            m_loaded = true;
        }
        public IdentificationCollectionTreeViewModel(IEnumerable<UMCClusterLightMatched> clusters,
            IEnumerable<Peptide> peptides,
            TreeItemViewModel parent)
        {
            var tags = new GenericCollectionTreeViewModel();
            tags.Name = "AMT Tags";

            foreach (var cluster in clusters)
            {
                foreach (var match in cluster.ClusterMatches)
                {
                    tags.Items.Add(new MassTagToClusterMatch(match.MassTag));
                }
            }

            var peptideItems = new GenericCollectionTreeViewModel();
            peptideItems.Name = "Database Searches";
            var peptideModels = (from peptide in peptides
                select new PeptideTreeViewModel(peptide)).ToList();
            foreach (var item in peptideModels)
            {
                peptideItems.Items.Add(item);
            }
        }
示例#6
0
        public UMCClusterTreeViewModel(UMCClusterLightMatched matchedCluster, TreeItemViewModel parent)
        {
            m_items   = new ObservableCollection <TreeItemViewModel>();
            m_parent  = parent;
            m_cluster = matchedCluster;
            var features = new UMCCollectionTreeViewModel(matchedCluster.Cluster);

            features.FeatureSelected += feature_FeatureSelected;
            features.Name             = "Features";

            // Cluster level statistics
            var cluster = matchedCluster.Cluster;

            AddStatistics("Mass", cluster.MassMonoisotopic);


            var item = new StringTreeViewItem(
                cluster.Net.ToString("F3",
                                     CultureInfo.InvariantCulture),
                "NET");

            m_items.Add(item);

            if (cluster.DriftTime > 0)
            {
                AddStatistics("Drift Time", cluster.DriftTime);
            }
            AddStatistics("Datasets", cluster.DatasetMemberCount);
            AddStatistics("Total", cluster.MemberCount);

            AddStatistics("Total MS/MS", cluster.MsMsCount);
            AddStatistics("Total Identifications", cluster.IdentifiedSpectraCount);

            var allIdentifications = new GenericCollectionTreeViewModel();

            allIdentifications.Name = "Identifications";

            // Items to display the base childen.
            var identifications = new PeptideCollectionTreeViewModel(cluster);

            identifications.Name             = "Search Results";
            identifications.FeatureSelected += feature_FeatureSelected;


            var spectra = new MsMsCollectionTreeViewModel(cluster);

            spectra.Name              = "MS/MS";
            m_spectra                 = spectra;
            spectra.SpectrumSelected += spectra_SpectrumSelected;
            spectra.FeatureSelected  += feature_FeatureSelected;

            var matches = new MassTagCollectionMatchTreeViewModel(matchedCluster.ClusterMatches);

            matches.Name = "AMT Tags";

            allIdentifications.Items.Add(identifications);
            allIdentifications.Items.Add(spectra);
            allIdentifications.Items.Add(matches);
            m_allIdentifications = allIdentifications;

            m_items.Add(features);
            m_items.Add(allIdentifications);
        }