JAL-4061 JAL-4062 update find box image and docs in help
[jalview.git] / help / help / html / features / search.html
1 <html>
2 <!--
3  * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
4  * Copyright (C) $$Year-Rel$$ The Jalview Authors
5  * 
6  * This file is part of Jalview.
7  * 
8  * Jalview is free software: you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License 
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *  
13  * Jalview is distributed in the hope that it will be useful, but 
14  * WITHOUT ANY WARRANTY; without even the implied warranty 
15  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
16  * PURPOSE.  See the GNU General Public License for more details.
17  * 
18  * You should have received a copy of the GNU General Public License
19  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
20  * The Jalview Authors are detailed in the 'AUTHORS' file.
21  -->
22 <head>
23 <title>Search</title>
24 <style type="text/css">
25 <!--
26 td {
27   text-align: center;
28 }
29 -->
30 </style>
31 </head>
32
33 <body>
34   <p>
35     <strong>Search</strong>
36   </p>
37   <p>The search box is displayed by pressing Control and F or
38     selecting &quot;Find...&quot; from the &quot;Search&quot; menu.</p>
39   <img src="search.png"  height="152">
40   <p>&quot;Find next&quot; will find the next occurrence of the
41     query and adjust the alignment window view to show it, and
42     &quot;Find all&quot; highlights all matches for a query. The
43     &quot;New Feature&quot; is a quick way to highlight and group
44     residues matching the specified search pattern throughout the
45     alignment.
46   <ul>
47     <li>The search uses regular expressions. (understands a mixture
48       of posix and perl style regex - see below for a summary)</li>
49                 <li>If a region is selected, then search will <strong>only</strong>
50       be performed on that region.<br />
51     <em>Tip: to quickly clear the current selection, click the
52         alignment view you wish to search, then press 'Escape'.</em>
53     </li>
54     <li>Gaps are ignored when matching the query to the sequences
55       in the alignment.</li>
56     <li>Hidden columns can optionally be ignored (<em>since Jalview 2.11</em>)</li>
57                 <li>The search is applied to both sequences and their IDs. <br />
58                         Check boxes also enable searching of:
59                         <ul>
60                                 <li><strong>Sequence description</strong> (<em>since Jalview 2.10</em>)
61                                 </li>
62                                 <li><strong>Sequence Feature</strong> type and description for currently displayed features (<em>since Jalview
63                                                 2.11.3.0</em>)
64                                 </li>
65                         </ul>
66                 </li>
67     <li>Tick the &quot;Match Case&quot; box to perform a case
68       sensitive search.</li>
69     <li>To access a <a href="#queryhistory">previously used
70         query</a> press the down arrow or click on the button on the right
71       of the text field.
72   </ul>
73   <p>
74     <strong>Creating Features from Search Results</strong>
75   </p>
76   <p>If &quot;New Feature&quot; is selected, the feature can be
77     given a name from a popup input box. Use the &quot;Feature
78     Settings&quot; under the &quot;View&quot; menu to change the
79     visibility and colour of the new sequence feature.</p>
80   <p>
81   <p>
82     <strong>Selecting regions from Search Results</strong>
83   </p>
84   <p>
85     Press 'B' or use the <em>Select Highlighted Columns</em> option from
86     the alignment window's select menu to add columns containing
87     highlighted search results to the alignment window's column
88     selection. Alt-'B' will add all but the highlighted columns, and
89     Ctrl (or Cmd) -B will toggle the column selection for the
90     highlighted region.
91   </p>
92   <p>
93   <strong>Copying highlighted regions to a new alignment</strong>
94   </p>
95   <p>
96         Press <strong>Copy</strong> button or type Ctrl (Cmd on OSX) + Shift +
97         C to copy highlighted search results to the clipboard, enabling them
98         to be pasted to a new alignment (via Shift+Ctrl (or Cmd) + V).
99   </p>
100         <p>
101
102     <strong>A quick Regular Expression Guide</strong>
103   </p>
104   <p>A regular expression is not just a simple text query - although
105     it can be used like one, the query is not parsed literally, but
106     interpreted like a series of instructions defining the features of
107     the match. For example, a simple query like &quot;ACDED&quot; would
108     match all occurences of that string, but &quot;ACD+ED&quot; matches
109     both 'ACDDED' and 'ACDDDDDDDDED'. More usefully, the query
110     &quot;[GVATC]{;5,}&quot; would find stretches of small, hydrophobic
111     amino acids of at least five residues in length.</p>
112   <p>
113     The table below describes some of the regular expression syntax:<br>
114   </p>
115   <table width="100%" border="1">
116     <tr>
117       <td width="24%">Regular Expression Element</td>
118       <td width="76%">Effect</td>
119     </tr>
120     <tr>
121       <td width="24%">.</td>
122       <td width="76%">Matches any single character</td>
123     </tr>
124     <tr>
125       <td>[]</td>
126       <td>Matches any one of the characters in the brackets</td>
127     </tr>
128     <tr>
129       <td>^</td>
130       <td>Matches at the start of an ID or sequence</td>
131     </tr>
132     <tr>
133       <td>$</td>
134       <td>Matches at the end of an ID or sequence</td>
135     </tr>
136     <tr>
137       <td>*</td>
138       <td>Matches if the preceding element matches zero or more
139         times</td>
140     </tr>
141     <tr>
142       <td>?</td>
143       <td>Matches if the preceding element matched once or not at
144         all</td>
145     </tr>
146     <tr>
147       <td>+</td>
148       <td>Matches if the preceding element matched at least once</td>
149     </tr>
150     <tr>
151       <td>{count}</td>
152       <td>Matches if the preceding element matches a specified
153         number of times</td>
154     </tr>
155     <tr>
156       <td>{min,}</td>
157       <td>Matches of the preceding element matched at least the
158         specified number of times</td>
159     </tr>
160     <tr>
161       <td>{min,max}</td>
162       <td>Matches if the preceding element matches min or at most
163         max number of times</td>
164     </tr>
165   </table>
166   <p>
167     <a name="queryhistory" /><strong>Search History</strong>
168   </p>
169   <p>A record of all the recent queries made via the Find dialog are
170     stored along with your Jalview user preferences. To open the search
171     history, click on the button to the right of the query field, or
172     press the down arrow key.</p>
173   <p><img src="searchhist.png" width="404" height="185" />
174   </p><p>The search history keeps up to 99 queries by default. To clear
175     the history, or modify the size of the history, right-click the text
176     box.</p>
177   <p><img src="searchclearhist.png" width="402" height="127"/>
178   </p>
179 <p width="100%">
180     <strong>Other dialogs that provide a query history</strong>
181   </p>
182   <p>
183     Jalview's <a href="uniprotsequencefetcher.html">Uniprot</a> and <a
184       href="pdbsequencefetcher.html">PDB</a> free text database search
185     dialogs also provide a query history.
186   </p>
187   <em>The query histories were introduced in Jalview 2.10.2</em>
188 </body>
189 </html>