Esempio n. 1
0
 public ProteinMetadata ChangeWebSearchInfo(WebSearchInfo webSearchInfo)
 {
     return(new ProteinMetadata(this)
     {
         WebSearchInfo = webSearchInfo
     });
 }
Esempio n. 2
0
 public ProteinMetadata(string name, string description, string preferredName, string accession, string gene, string species, string websearchterm = null)
 {
     Name          = name;
     Description   = description;
     PreferredName = preferredName;
     Accession     = accession;
     Gene          = gene;
     Species       = species;
     WebSearchInfo = WebSearchInfo.FromString(websearchterm);
 }
Esempio n. 3
0
 private ProteinMetadata(ProteinMetadata other)
 {
     if (other == null)
     {
         return;
     }
     Name          = other.Name;
     Description   = other.Description;
     PreferredName = other.PreferredName;
     Accession     = other.Accession;
     Gene          = other.Gene;
     Species       = other.Species;
     WebSearchInfo = other.WebSearchInfo;
 }
Esempio n. 4
0
 public bool HasProteinNamesWithUnresolvedMetadata()
 {
     // Get a list of proteins with unresolved metadata websearches
     using (var session = OpenSession())
     {
         var hql   = @"SELECT WebSearchStatus FROM " + typeof(DbProteinName);
         var query = session.CreateQuery(hql);
         foreach (var value in query.List())
         {
             var term          = value == null ? string.Empty : value.ToString();
             var webSearchInfo = WebSearchInfo.FromString(term);
             if (webSearchInfo.GetPendingSearchTerm().Length > 0 || // Protein not yet searched
                 webSearchInfo.IsEmpty())                           // Protein has never been considered for metadata search
             {
                 return(true);
             }
         }
     }
     return(false);
 }