Exemplo n.º 1
0
 public bool ShareProteinId(ProteinSpectrumMatchSet other)
 {
     foreach (var prsm1 in this)
     {
         foreach (var prsm2 in other)
         {
             if (prsm1.ProteinId.Equals(prsm2.ProteinId))
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Exemplo n.º 2
0
        public ProteinSpectrumMatchSet[][] GroupAcrossRuns(List <ProteinSpectrumMatchSet>[] prsmGroup, INodeComparer <ProteinSpectrumMatchSet> prsmGroupComparer)
        {
            var nDataset = prsmGroup.Length;
            var prsmSet  = new NodeSet <ProteinSpectrumMatchSet>()
            {
            };

            for (var i = 0; i < nDataset; i++)
            {
                var groupedPrsms = prsmGroup[i];
                if (groupedPrsms == null)
                {
                    continue;
                }
                prsmSet.AddRange(groupedPrsms);
            }

            var alignedPrsms  = prsmSet.ConnnectedComponents(prsmGroupComparer);
            var alignedResult = new ProteinSpectrumMatchSet[alignedPrsms.Count][];

            for (var i = 0; i < alignedResult.Length; i++)
            {
                alignedResult[i] = new ProteinSpectrumMatchSet[nDataset];
            }

            for (var i = 0; i < alignedPrsms.Count; i++)
            {
                foreach (var set in alignedPrsms[i])
                {
                    if (alignedResult[i][set.DataId] != null)
                    {
                        alignedResult[i][set.DataId].Merge(set);
                        //Console.WriteLine("[{4}] {0}-{1}...{2}-{3}", set.MinScanNum, set.MaxScanNum, alignedResult[i][set.DataId].MinScanNum, alignedResult[i][set.DataId].MaxScanNum, set.DataId);
                    }
                    else
                    {
                        alignedResult[i][set.DataId] = set;
                    }
                }
            }
            return(alignedResult);
        }
Exemplo n.º 3
0
 public void Merge(ProteinSpectrumMatchSet other)
 {
     AddRange(other);
 }