ebf7c2678556d6eae1e6521f317977fd1c9cdc88
mspeir
  Sun Feb 16 09:56:46 2025 -0800
adding entry about running blat locally, refs #34829

diff --git src/hg/htdocs/FAQ/FAQblat.html src/hg/htdocs/FAQ/FAQblat.html
index 02a517e205e..b52bb586743 100755
--- src/hg/htdocs/FAQ/FAQblat.html
+++ src/hg/htdocs/FAQ/FAQblat.html
@@ -16,31 +16,31 @@
 expected</a></li>
 <li><a href="#blat2">BLAT use restrictions</a></li>
 <li><a href="#blat3">Downloading BLAT source and documentation</a></li>
 <li><a href="#blat5">Replicating web-based BLAT parameters in command-line version</a></li>
 <li><a href="#blat6">Using the <em>-ooc</em> flag</a></li>
 <li><a href="#blat4">Replicating web-based BLAT percent identity and score calculations</a></li>
 <li><a href="#blat7">Replicating web-based BLAT &quot;I'm feeling lucky&quot; search 
 results</a></li>
 <li><a href="#blat8">Using BLAT for short sequences with maximum sensitivity</a></li>
 <li><a href="#blat9">BLAT ALL genomes</a></li>
 <li><a href="#blat10">BLAT ALL genomes: No matches found</a></li>
 <li><a href="#blat11">Approximating web-based BLAT results using gfServer/gfClient</a></li>
 <li><a href="#blat12">Standalone or gfServer/gfClient result start positions off by one</a></li>
 <li><a href="#blat13">Protein-translated BLAT having different results</a></li>
 <li><a href="#blat14">Querying BLAT programmatically using URLs</a></li>
-
+<li><a href="#blat15">Running BLAT locally</a></li>
 </ul>
 <hr>
 <p>
 <a href="index.html">Return to FAQ Table of Contents</a></p>
 
 <a name="blat1"></a>
 <h2>BLAT vs. BLAST</h2>
 <h6>What are the differences between BLAT and BLAST?</h6>
 <p>
 BLAT is an alignment tool like BLAST, but it is structured differently. On DNA, BLAT works by 
 keeping an index of an entire genome in memory. Thus, the target database of BLAT is not a set of 
 GenBank sequences, but instead an index derived from the assembly of the entire genome. By default,
 the index consists of all non-overlapping 11-mers except for those heavily involved in repeats, and 
 it uses less than a gigabyte of RAM. This smaller size means that BLAT is far more easily 
 <a href="../goldenPath/help/mirror.html">mirrored</a> than BLAST. Blat of DNA is designed to quickly find 
@@ -486,17 +486,49 @@
 The URL requires three variables: the sequence to blat, the type of query and the database, as follows</p>
 <pre>
 https://genome.ucsc.edu/cgi-bin/hgBlat?userSeq=[seq]&amp;type=[type]&amp;db=[database]&amp;output=json</pre>
 <p>
 If the sequence is longer than 8kbp, the request must be sent via HTTP POST.
 </p>
 <p>
 Query types include DNA, protein, translated RNA and translated DNA:</p>
 <pre>
 <a href="https://genome.ucsc.edu/cgi-bin/hgBlat?userSeq=GACCTCGGCGTGGCCTAGCG&amp;type=DNA&amp;db=hg38&amp;output=json">https://genome.ucsc.edu/cgi-bin/hgBlat?userSeq=GACCTCGGCGTGGCCTAGCG&amp;type=DNA&amp;db=hg38&amp;output=json</a>
 <a href="https://genome.ucsc.edu/cgi-bin/hgBlat?userSeq=IGCLPAHLLGDMWGRFWTNLYSLTVPFGQKPNIDVTDAMVDQAWDAQRIFKEAEKFFVSVGLPNM&amp;type=protein&amp;db=hg38&amp;output=json">https://genome.ucsc.edu/cgi-bin/hgBlat?userSeq=IGCLPAHLLGDMWGRFWTNLYSLTVPFGQKPNIDVTDAMVDQAWDAQRIFKEAEKFFVSVGLPNM&amp;type=protein&amp;db=hg38&amp;output=json</a>
 <a href="https://genome.ucsc.edu/cgi-bin/hgBlat?userSeq=UUUCCCUUCCCCACUGUAGUGGGAGAGAAGGGAGUGGCCAUACCAUAUUUUUCUCGUGGGCCGUUGUAGUCAUAAGGCCUUCCUUUGCGGAAAAUUUUCAGGGUGGGAUA&amp;type=translated%20RNA&amp;db=hg38&amp;output=json">https://genome.ucsc.edu/cgi-bin/hgBlat?userSeq=UUUCCCUUCCCCACUGUAGUGGGAGAGAAGGGAGUGGCCAUACCAUAUUUUUCUCGUGGGCCGUUGUAGUCAUAAGGCCUUCCUUUGCGGAAAAUUUUCAGGGUGGGAUA&type=translated%20RNA&db=hg38&output=json</a>
 <a href="https://genome.ucsc.edu/cgi-bin/hgBlat?userSeq=TTTCCCTTCCCCACTGTAGTGGGAGAGAAGGGAGTGGCCATACCATATTTTTCTCGTGGGCCGTTGTAGTCATAAGGCCTTCCTTTGCGGAAAATTTTCAGGGTGGGATA&amp;type=translated%20DNA&amp;db=hg38&amp;output=json">https://genome.ucsc.edu/cgi-bin/hgBlat?userSeq=TTTCCCTTCCCCACTGTAGTGGGAGAGAAGGGAGTGGCCATACCATATTTTTCTCGTGGGCCGTTGTAGTCATAAGGCCTTCCTTTGCGGAAAATTTTCAGGGTGGGATA&amp;type=translated%20DNA&amp;db=hg38&amp;output=json</a>
 </pre>
 
+<a name="blat15"></a>
+<h2>Running BLAT Locally</h2>
+<h6>How do I run BLAT locally if I'm running into limitations with the web-based version?</h6>
+<p>
+If you have access to a Linux or Mac OSX command-line you can run <code>blat</code> locally.
+The blat binary is available under the directory for your system type under the
+<a href="https://hgdownload.soe.ucsc.edu/admin/exe/">utilities directory</a> on our download server.
+<p>
+Once you have the downloaded the <code>blat</code> program to your computer, ensure the 'execute' bit is
+on for permissions:
+<pre><code>$ ls -og blat
+-rwxrwxr-x 1 5528712 Nov  7 04:03 blat
+</code></pre>
+<p>
+If the permissions indicate something like: <code>-rw-rw-r--</code>, then
+you will need to enable the ability to execute the program:
+<pre><code>$ chmod +x blat</code></pre>
+<p>
+To confirm that it works, run the program without arguments. This will also
+display the help message.
+<pre><code>$ ./blat</code></pre>
+<p>
+You can now use this program locally on your sequences. For example, given a
+sample.fa, to find that sequence in the human/hg38 genome, you would run:
+<pre><code>$ ./blat hg38.2bit sample.fa output.psl</code></pre>
+<p>
+You can download the 2bit file for your assembly of interest from the
+<a href="https://hgdownload.soe.ucsc.edu/downloads.html">download server</a>
+under the "Genome sequence files and select annotations (2bit, GTF, GC-content, etc)" link.
+For example, the hg38.2bit sequence can be found <a
+href="https://hgdownload.soe.ucsc.edu/goldenPath/hg38/bigZips/">here</a>.
+
 <!--#include virtual="$ROOT/inc/gbPageEnd.html" -->
 </body>