\section{Search}

Pharmit provides two search modalities depending on whether the pharmacophore or shape query is the primary query.  In both cases, the primary query determines the pose alignment of the hit compounds and the secondary query serves as an additional filter.
If desired, the complete set of query-aligned results may be saved as a compressed SDF structure file.

\subsection{Pharmacophore/Shape Search}

If the primary query is the pharmacophore query, the selected database is searched for compounds that match the specified pharmacophore using the Pharmer \cite{Koes_2011} search technology.  Pharmer has comparable virtual screening performance to other pharmacophore methods \cite{Sanders_2012} but is orders of magnitude faster.

Results are aligned to the pharmacophore to minimize the root mean squared deviation (RMSD) between the query features and the hit compound features. Results are sorted with respect to this pharmacophore RMSD. An example of a pharmacophore-oriented search is shown in Figure~\ref{pharmfig}.

If a shape query is also present, then the shape constraints are applied to the pharmacophore-aligned pose; only heavy atom centers are compared to the shape constraints.  That is, the pharmacophore-aligned results are filtered to ensure that hits have at least one heavy atom center that falls within the inclusive shape and no heavy atom center that falls within the exclusive shape.  With this modality, the exclusive shape is generally the most useful, as it provides a way to eliminate compounds that match the pharmacophore but have significant steric clashes with the receptor.
Due to the importance and increased specificity of the interactions specified by a pharmacophore, pharmacophore search followed by shape filtering is the default and recommended search modality.  

\subsection{Shape/Pharmacophore Search}

If the primary query is the shape query, VAMS \cite{vams} is used to search a shape index \cite{matchpack} for matches.  Although VAMS does not exhibit as good virtual screening performance as more expensive methods, such as ROCS \cite{Hawkins_2007}, it is orders of magnitude faster and serves as an effective shape-based pre-screen \cite{vams}.
With VAMS, molecules are pre-aligned to their moments of inertia and hits are aligned to the moments of inertia of the query.  Molecular shapes are computed using the solvent excluded volume and are stored at a 0.5{\AA} resolution. A shape matches the query if, in its aligned position, the \textit{entirety} of the inclusive shape constraint is contained within the shape while no part of the shape overlaps the exclusive shape.  This is a more stringent requirement than that which is imposed when the shape query is used as a filter to a pharmacophore search.
Matching compounds are sorted with respect to their Tanimoto shape similarity with the query ligand. An example of a shape-oriented search is shown in Figure~\ref{shapefig}.

If a pharmacophore query is present, it is used to filter the shape-aligned results. In this case, the pharmacophore features of the hit compound must fall within the tolerance spheres of the pharamacophore query with the compound in the shape-aligned pose. That is, a compound that would match a pharmacophore query if the query were the primary query may still be filtered out.
 
\subsection{Additional Filters}
Pharmit allows users to specify additional, non-structural filters on the results. As shown in Figure~\ref{pharmfig}, the number of compounds returned can be reduced by restricting the number poses returned for every conformation, the number of conformations returned for every compound, and the total number of compounds.

Compounds may be filtered by specifying desired ranges for molecular properties that are commonly used to identify drug-like molecules.
As shown in Figure~\ref{shapefig}, these include molecular weight, the number of rotatable bonds, logP (a measure of lipophilicity), topological polar surface area (indicative of the compound's ability to permeate cell membranes), the number of aromatic groups, the number of hydrogen bond acceptors, and the number of hydrogen bond donors.  Properties are precomputed using OpenBabel \cite{O_Boyle_2011}.

\subsection{Result Browser}
When a search is initiated, a results sidebar opens to display the search results, as seen in Figures~\ref{pharmfig} and \ref{shapefig}. Results may be sorted in increasing or decreasing order based on RMSD (for pharmacophore searches), similarity score (for shape searches), molecular weight, or number of rotatable bonds. Clicking on a result displays the query-aligned compound in the molecular viewer, as Figure~\ref{pharmfig} shows.  If desired, a new Pharmit session can be initiated from the ligand-protein complex represented by the selected hit compound.
Compounds are annotated with all known database identifiers, as shown in Figure~\ref{shapefig}. Where applicable, these identifiers are linked to the source database, so it is possible to immediately investigate bioactivity data in PubChem or bring up the compound's order page from a commercial vendor.