예제 #1
0
 public ProteinMetadata ChangeWebSearchInfo(WebSearchInfo webSearchInfo)
 {
     return(new ProteinMetadata(this)
     {
         WebSearchInfo = webSearchInfo
     });
 }
예제 #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);
 }
예제 #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;
 }
예제 #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);
 }