/// <summary> /// Return a filtered substructure library /// </summary> /// <param name="original"></param> /// <param name="filt"></param> public SubstructureLibrary(SubstructureLibrary original, SubstructureLibraryFilter filt) { _name = original.Name; _arEntries = new ArrayList(); _hsAssayResults = new Hashtable(); _hsChemIds = new Hashtable(); _propertyString = "Not loaded from file."; // copy the entries from the previous library, but only if they are within range foreach (SubstructureEntry ent in original.Entries) { if (filt.EntryName != "") { if (ent.Name == filt.EntryName) { _arEntries.Add(ent.Copy()); } } else { if (ent.NumEntries >= filt.MinCompounds && ent.NumEntries <= filt.MaxCompounds) { _arEntries.Add(ent.Copy()); } } } }
private void cmdApplyFilterLib_Click(object sender, EventArgs e) { SubstructureLibraryFilter filt = new SubstructureLibraryFilter(); if (txtMaxCompounds.Text != "") { filt.MaxCompounds = Convert.ToInt32(txtMaxCompounds.Text); } if (txtMinCompounds.Text != "") { filt.MinCompounds = Convert.ToInt32(txtMinCompounds.Text); } filt.EntryName = txtEntryName.Text; _env.ApplySubstructureLibraryFilter(filt); lblSubsFiltProps.Text = _env.subsLib.FilteredLibrary.propertyString; }
/// <summary> /// Apply a filter to this substructure library and return the filtered library /// This will also set the _filteredLib property of this object /// </summary> /// <param name="filt"></param> /// <returns></returns> public SubstructureLibrary ApplyFilter(SubstructureLibraryFilter filter) { _filter = filter; _filteredLib = new SubstructureLibrary(this, filter); return(_filteredLib); }
public void ApplySubstructureLibraryFilter(SubstructureLibraryFilter filt) { _subsLib.ApplyFilter(filt); }