Ejemplo n.º 1
0
 public bool HasSearchResults(Peptide peptide)
 {
     using (var session = Workspace.OpenSession())
     {
         var criteria = session.CreateCriteria(typeof(DbPeptideSpectrumMatch))
                        .Add(Restrictions.Eq("MsDataFile", session.Load <DbMsDataFile>(Id)))
                        .Add(Restrictions.Eq("Peptide", session.Load <DbPeptide>(peptide.Id)));
         return(criteria.List().Count > 0);
     }
 }
Ejemplo n.º 2
0
        public List <PeptideFileAnalysis> GetFileAnalyses()
        {
            var result = new List <PeptideFileAnalysis>();

            using (var session = Workspace.OpenSession())
            {
                var criteria = session.CreateCriteria(typeof(DbPeptideFileAnalysis))
                               .Add(Restrictions.Eq("MsDataFile", session.Load <DbMsDataFile>(Id)));
                foreach (DbPeptideFileAnalysis peptideFileAnalysis in criteria.List())
                {
                    int index = Workspace.PeptideAnalyses.IndexOfKey(peptideFileAnalysis.PeptideAnalysis.GetId());
                    if (index >= 0)
                    {
                        result.Add(PeptideFileAnalysis.GetPeptideFileAnalysis(
                                       Workspace.PeptideAnalyses[index],
                                       peptideFileAnalysis));
                    }
                }
            }
            return(result);
        }