コード例 #1
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);
             }
         }
     }
 }
コード例 #2
0
        public void Read()
        {
            if (!File.Exists(filePath))
            {
                return;
            }
            using (BinaryReader reader = FileUtil.GetBinaryReader(filePath)) {
                int len = reader.ReadInt32();
                scanNumbers        = new int[len];
                peptides           = new MascotPeptide[len][];
                fixedModifications = new ushort[len][];
                for (int i = 0; i < scanNumbers.Length; i++)
                {
                    scanNumbers[i] = reader.ReadInt32();
                    int l = reader.ReadInt32();
                    peptides[i] = new MascotPeptide[l];
                    for (int j = 0; j < peptides[i].Length; j++)
                    {
                        peptides[i][j] = new MascotPeptide(reader);
                    }
                    l = reader.ReadInt32();
                    fixedModifications[i] = new ushort[l];
                    for (int j = 0; j < fixedModifications[i].Length; j++)
                    {
                        fixedModifications[i][j] = reader.ReadUInt16();
                    }
                }
                byte x = reader.ReadByte();
                switch (x)
                {
                case 0:
                    type = MascotQueryType.Silac;
                    break;

                case 1:
                    type = MascotQueryType.Isotope;
                    break;

                case 2:
                    type = MascotQueryType.Peak;
                    break;
                }
                reader.Close();
            }
        }
コード例 #3
0
 public void AddPeptide(int peptideNumber, MascotPeptide peptide)
 {
     peptides.Add(peptideNumber, peptide);
 }
コード例 #4
0
        public string GetModificationClassification(int index, HashSet <string> labelModSet)
        {
            MascotPeptide p = GetPeptidesAt(index)[0];

            return(p.GetModificationClassification(labelModSet));
        }
コード例 #5
0
        public bool IsHighestScoringCorrect(int index, string revstring, IProteinSet proteinSet)
        {
            MascotPeptide p = GetPeptidesAt(index)[0];

            return(!p.HasOnlyReverseHits(revstring, proteinSet));
        }