Ejemplo n.º 1
0
        public void Correct(string prefix, IProteinSet proteinSet)
        {
            int count = 0;

            for (int i = 0; i < proteinIndex.Length; i++)
            {
                if (T07SearchEngineEnhancement.IsReverseProtein(proteinSet.GetName(proteinIndex[i]), prefix))
                {
                    count++;
                }
            }
            if (count == 0 || count == proteinIndex.Length)
            {
                return;
            }
            List <int> result = new List <int>();

            for (int i = 0; i < proteinIndex.Length; i++)
            {
                if (!proteinSet.GetName(proteinIndex[i]).StartsWith(prefix))
                {
                    result.Add(proteinIndex[i]);
                }
            }
            proteinIndex = result.ToArray();
        }
Ejemplo n.º 2
0
 public void FillProteinToPepTable(Dictionary <string, HashSet <string> > protIdToPepSeqs, IProteinSet proteinSet)
 {
     if (peptides == null)
     {
         Read();
     }
     for (int i = 0; i < peptides.Length; i++)
     {
         MascotPeptide p            = peptides[i][0];
         int[]         proteinIndex = p.ProteinIndex;
         if (!T07SearchEngineEnhancement.ValidPeptide(p.Sequence))
         {
             continue;
         }
         foreach (int pi in proteinIndex)
         {
             string protId = proteinSet.GetName(pi);
             if (!protIdToPepSeqs.ContainsKey(protId))
             {
                 protIdToPepSeqs.Add(protId, new HashSet <string>());
             }
             string key = p.Sequence;
             if (!protIdToPepSeqs[protId].Contains(key))
             {
                 protIdToPepSeqs[protId].Add(key);
             }
         }
     }
 }
Ejemplo n.º 3
0
 public string[] GetProteinIds(IProteinSet proteinSet)
 {
     string[] result = new string[proteinIndex.Length];
     for (int i = 0; i < result.Length; i++)
     {
         result[i] = proteinSet.GetName(proteinIndex[i]);
     }
     return(result);
 }
Ejemplo n.º 4
0
 public bool HasOnlyReverseHits(string reverseStr, IProteinSet proteinSet)
 {
     for (int i = 0; i < proteinIndex.Length; i++)
     {
         if (!T07SearchEngineEnhancement.IsReverseProtein(proteinSet.GetName(proteinIndex[i]), reverseStr))
         {
             return(false);
         }
     }
     return(true);
 }
Ejemplo n.º 5
0
 public void ProcessPeptides(int fileIndex, Dictionary <string, int> proteinIdToGroupIndex, IPeakList peakList,
                             MsmsData msmsData, IIdentifiedPeptide[] identifiedPeptides, string[] peptideSequences,
                             ReQuantitationResult reQuantitationResult, bool reQuantify,
                             HashSet <string> labelModificationSet, IProteinSet proteinSet,
                             SilacType silacType, SilacLabel[] labels1, SilacLabel[] labels2, double ms2Tol,
                             string ms2TolUnit, int topx, string[] fixedMods)
 {
     if (peptides == null)
     {
         Read();
     }
     double[] monoIsoMz = peakList.MS2MonoisotopicMz;
     for (int i = 0; i < peptides.Length; i++)
     {
         MascotPeptide[] p              = peptides[i];
         int             scanNumber     = scanNumbers[i];
         int             ms2ind         = peakList.GetMs2IndexFromScanNumber(scanNumber);
         double          mz             = peakList.GetMs2Mz(ms2ind);
         double          monotopicMz    = monoIsoMz[ms2ind];
         double          time           = peakList.GetMs2Rt(ms2ind);
         int             silacId        = -1;
         int             isotopeId      = -1;
         int             silacIndex     = -1;
         SilacCluster    silacCluster   = null;
         IsotopeCluster  isotopeCluster = null;
         if (type == MascotQueryType.Silac)
         {
             int[] silacInfo = peakList.GetSilacInfoForMsmsScanNumber(scanNumber);
             silacId      = silacInfo[0];
             silacIndex   = silacInfo[1];
             silacCluster = peakList.GetSilacCluster(silacId);
         }
         else if (type == MascotQueryType.Isotope)
         {
             isotopeId      = peakList.GetIsotopeIndexForMsmsScanNumber(scanNumber);
             isotopeCluster = peakList.GetIsotopeCluster(isotopeId);
         }
         int index = Array.BinarySearch(peptideSequences, p[0].Sequence);
         if (index < 0)
         {
             continue;
         }
         HashSet <int> tmpGroupInds = new HashSet <int>();
         foreach (int pi in p[0].ProteinIndex)
         {
             string protId = proteinSet.GetName(pi);
             if (!proteinIdToGroupIndex.ContainsKey(protId))
             {
                 continue;
             }
             int groupInd = proteinIdToGroupIndex[protId];
             if (!tmpGroupInds.Contains(groupInd))
             {
                 tmpGroupInds.Add(groupInd);
             }
         }
         double[] specMasses;
         float[]  specIntensities;
         bool     uniqueProtein = (p[0].ProteinIndex.Length == 1);
         bool     uniqueGroup   = (tmpGroupInds.Count == 1);
         msmsData.GetSpectrumFromScanNumber(scanNumber, out specMasses, out specIntensities);
         identifiedPeptides[index].AddMascotPeptideHit(p, scanNumber, fileIndex, type, silacId, silacIndex, isotopeId,
                                                       silacCluster, isotopeCluster, time, peakList, mz, monotopicMz,
                                                       fixedModifications[i], specMasses, specIntensities,
                                                       reQuantitationResult, reQuantify, labelModificationSet, silacType,
                                                       labels1, labels2, ms2Tol, ms2TolUnit, topx, fixedMods);
         identifiedPeptides[index].UniqueProtein = uniqueProtein;
         identifiedPeptides[index].UniqueGroup   = uniqueGroup;
     }
 }