File size: 17,374 Bytes
8896a5f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 |
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Usage — D-SCRIPT v1.0-beta documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Data" href="data.html" />
<link rel="prev" title="Installation" href="installation.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home"> D-SCRIPT
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Usage</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#quick-start">Quick Start</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#predict-a-new-network-using-a-trained-model">Predict a new network using a trained model</a></li>
<li class="toctree-l3"><a class="reference internal" href="#embed-sequences-with-language-model">Embed sequences with language model</a></li>
<li class="toctree-l3"><a class="reference internal" href="#train-and-save-a-model">Train and save a model</a></li>
<li class="toctree-l3"><a class="reference internal" href="#evaluate-a-trained-model">Evaluate a trained model</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#prediction">Prediction</a></li>
<li class="toctree-l2"><a class="reference internal" href="#embedding">Embedding</a></li>
<li class="toctree-l2"><a class="reference internal" href="#training">Training</a></li>
<li class="toctree-l2"><a class="reference internal" href="#evaluation">Evaluation</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="data.html">Data</a></li>
<li class="toctree-l1"><a class="reference internal" href="api/index.html">API</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">D-SCRIPT</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home"></a> »</li>
<li>Usage</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/usage.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="usage">
<h1>Usage<a class="headerlink" href="#usage" title="Permalink to this headline">¶</a></h1>
<div class="section" id="quick-start">
<h2>Quick Start<a class="headerlink" href="#quick-start" title="Permalink to this headline">¶</a></h2>
<div class="section" id="predict-a-new-network-using-a-trained-model">
<h3>Predict a new network using a trained model<a class="headerlink" href="#predict-a-new-network-using-a-trained-model" title="Permalink to this headline">¶</a></h3>
<p>Pre-trained models can be downloaded from [TBD].
Candidate pairs should be in tab-separated (<code class="docutils literal notranslate"><span class="pre">.tsv</span></code>) format with no header, and columns for [protein name 1], [protein name 2].
Optionally, a third column with [label] can be provided, so predictions can be made using training or test data files (but the label will not affect the predictions).</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>dscript predict --pairs <span class="o">[</span>input data<span class="o">]</span> --seqs <span class="o">[</span>sequences, .fasta format<span class="o">]</span> --model <span class="o">[</span>model file<span class="o">]</span>
</pre></div>
</div>
</div>
<div class="section" id="embed-sequences-with-language-model">
<h3>Embed sequences with language model<a class="headerlink" href="#embed-sequences-with-language-model" title="Permalink to this headline">¶</a></h3>
<p>Sequences should be in <code class="docutils literal notranslate"><span class="pre">.fasta</span></code> format.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>dscript embed --seqs <span class="o">[</span>sequences<span class="o">]</span> --outfile <span class="o">[</span>embedding file<span class="o">]</span>
</pre></div>
</div>
</div>
<div class="section" id="train-and-save-a-model">
<h3>Train and save a model<a class="headerlink" href="#train-and-save-a-model" title="Permalink to this headline">¶</a></h3>
<p>Training and validation data should be in tab-separated (<code class="docutils literal notranslate"><span class="pre">.tsv</span></code>) format with no header, and columns for [protein name 1], [protein name 2], [label].</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>dscript train --train <span class="o">[</span>training data<span class="o">]</span> --val <span class="o">[</span>validation data<span class="o">]</span> --embedding <span class="o">[</span>embedding file<span class="o">]</span> --save-prefix <span class="o">[</span>prefix<span class="o">]</span>
</pre></div>
</div>
</div>
<div class="section" id="evaluate-a-trained-model">
<h3>Evaluate a trained model<a class="headerlink" href="#evaluate-a-trained-model" title="Permalink to this headline">¶</a></h3>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>dscript <span class="nb">eval</span> --model <span class="o">[</span>model file<span class="o">]</span> --test <span class="o">[</span><span class="nb">test</span> data<span class="o">]</span> --embedding <span class="o">[</span>embedding file<span class="o">]</span> --outfile <span class="o">[</span>result file<span class="o">]</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="prediction">
<h2>Prediction<a class="headerlink" href="#prediction" title="Permalink to this headline">¶</a></h2>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>usage: dscript predict <span class="o">[</span>-h<span class="o">]</span> --pairs PAIRS --model MODEL <span class="o">[</span>--seqs SEQS<span class="o">]</span>
<span class="o">[</span>--embeddings EMBEDDINGS<span class="o">]</span> <span class="o">[</span>-o OUTFILE<span class="o">]</span> <span class="o">[</span>-d DEVICE<span class="o">]</span>
<span class="o">[</span>--thresh THRESH<span class="o">]</span>
Make new predictions with a pre-trained model. One of --seqs and --embeddings is required.
optional arguments:
-h, --help show this <span class="nb">help</span> message and <span class="nb">exit</span>
--pairs PAIRS Candidate protein pairs to predict
--model MODEL Pretrained Model
--seqs SEQS Protein sequences in .fasta format
--embeddings EMBEDDINGS
h5 file with embedded sequences
-o OUTFILE, --outfile OUTFILE
File <span class="k">for</span> predictions
-d DEVICE, --device DEVICE
Compute device to use
--thresh THRESH Positive prediction threshold - used to store contact
maps and predictions in a separate file. <span class="o">[</span>default:
<span class="m">0</span>.5<span class="o">]</span>
</pre></div>
</div>
</div>
<div class="section" id="embedding">
<h2>Embedding<a class="headerlink" href="#embedding" title="Permalink to this headline">¶</a></h2>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>usage: dscript embed <span class="o">[</span>-h<span class="o">]</span> --seqs SEQS --outfile OUTFILE <span class="o">[</span>-d DEVICE<span class="o">]</span>
Generate new embeddings using pre-trained language model
optional arguments:
-h, --help show this <span class="nb">help</span> message and <span class="nb">exit</span>
--seqs SEQS Sequences to be embedded
--outfile OUTFILE h5 file to write results
-d DEVICE, --device DEVICE
Compute device to use
</pre></div>
</div>
</div>
<div class="section" id="training">
<h2>Training<a class="headerlink" href="#training" title="Permalink to this headline">¶</a></h2>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>usage: dscript train <span class="o">[</span>-h<span class="o">]</span> --train TRAIN --val VAL --embedding EMBEDDING
<span class="o">[</span>--augment<span class="o">]</span> <span class="o">[</span>--projection-dim PROJECTION_DIM<span class="o">]</span>
<span class="o">[</span>--dropout-p DROPOUT_P<span class="o">]</span> <span class="o">[</span>--hidden-dim HIDDEN_DIM<span class="o">]</span>
<span class="o">[</span>--kernel-width KERNEL_WIDTH<span class="o">]</span> <span class="o">[</span>--use-w<span class="o">]</span>
<span class="o">[</span>--pool-width POOL_WIDTH<span class="o">]</span>
<span class="o">[</span>--negative-ratio NEGATIVE_RATIO<span class="o">]</span>
<span class="o">[</span>--epoch-scale EPOCH_SCALE<span class="o">]</span> <span class="o">[</span>--num-epochs NUM_EPOCHS<span class="o">]</span>
<span class="o">[</span>--batch-size BATCH_SIZE<span class="o">]</span> <span class="o">[</span>--weight-decay WEIGHT_DECAY<span class="o">]</span>
<span class="o">[</span>--lr LR<span class="o">]</span> <span class="o">[</span>--lambda LAMBDA_<span class="o">]</span> <span class="o">[</span>-o OUTFILE<span class="o">]</span>
<span class="o">[</span>--save-prefix SAVE_PREFIX<span class="o">]</span> <span class="o">[</span>-d DEVICE<span class="o">]</span>
<span class="o">[</span>--checkpoint CHECKPOINT<span class="o">]</span>
Train a new model
optional arguments:
-h, --help show this <span class="nb">help</span> message and <span class="nb">exit</span>
Data:
--train TRAIN Training data
--val VAL Validation data
--embedding EMBEDDING
h5 file with embedded sequences
--augment Set flag to augment data by adding <span class="o">(</span>B A<span class="o">)</span> <span class="k">for</span> all pairs
<span class="o">(</span>A B<span class="o">)</span>
Projection Module:
--projection-dim PROJECTION_DIM
Dimension of embedding projection layer <span class="o">(</span>default: <span class="m">100</span><span class="o">)</span>
--dropout-p DROPOUT_P
Parameter p <span class="k">for</span> embedding dropout layer <span class="o">(</span>default: <span class="m">0</span>.5<span class="o">)</span>
Contact Module:
--hidden-dim HIDDEN_DIM
Number of hidden units <span class="k">for</span> comparison layer in contact
prediction <span class="o">(</span>default: <span class="m">50</span><span class="o">)</span>
--kernel-width KERNEL_WIDTH
Width of convolutional filter <span class="k">for</span> contact prediction
<span class="o">(</span>default: <span class="m">7</span><span class="o">)</span>
Interaction Module:
--use-w Use weight matrix in interaction prediction model
--pool-width POOL_WIDTH
Size of max-pool in interaction model <span class="o">(</span>default: <span class="m">9</span><span class="o">)</span>
Training:
--negative-ratio NEGATIVE_RATIO
Number of negative training samples <span class="k">for</span> each positive
training sample <span class="o">(</span>default: <span class="m">10</span><span class="o">)</span>
--epoch-scale EPOCH_SCALE
Report heldout performance every this many epochs
<span class="o">(</span>default: <span class="m">5</span><span class="o">)</span>
--num-epochs NUM_EPOCHS
Number of epochs <span class="o">(</span>default: <span class="m">100</span><span class="o">)</span>
--batch-size BATCH_SIZE
Minibatch size <span class="o">(</span>default: <span class="m">25</span><span class="o">)</span>
--weight-decay WEIGHT_DECAY
L2 regularization <span class="o">(</span>default: <span class="m">0</span><span class="o">)</span>
--lr LR Learning rate <span class="o">(</span>default: <span class="m">0</span>.001<span class="o">)</span>
--lambda LAMBDA_ Weight on the similarity objective <span class="o">(</span>default: <span class="m">0</span>.35<span class="o">)</span>
Output and Device:
-o OUTPUT, --output OUTPUT
Output file path <span class="o">(</span>default: stdout<span class="o">)</span>
--save-prefix SAVE_PREFIX
Path prefix <span class="k">for</span> saving models
-d DEVICE, --device DEVICE
Compute device to use
--checkpoint CHECKPOINT
Checkpoint model to start training from<span class="sb">``</span>
</pre></div>
</div>
</div>
<div class="section" id="evaluation">
<h2>Evaluation<a class="headerlink" href="#evaluation" title="Permalink to this headline">¶</a></h2>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>usage: dscript <span class="nb">eval</span> <span class="o">[</span>-h<span class="o">]</span> --model MODEL --test TEST --embedding EMBEDDING
<span class="o">[</span>-o OUTFILE<span class="o">]</span> <span class="o">[</span>-d DEVICE<span class="o">]</span>
Evaluate a trained model
optional arguments:
-h, --help show this <span class="nb">help</span> message and <span class="nb">exit</span>
--model MODEL Trained prediction model
--test TEST Test Data
--embedding EMBEDDING
h5 file with embedded sequences
-o OUTFILE, --outfile OUTFILE
Output file to write results
-d DEVICE, --device DEVICE
Compute device to use
</pre></div>
</div>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="data.html" class="btn btn-neutral float-right" title="Data" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="installation.html" class="btn btn-neutral float-left" title="Installation" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2020, Samuel Sledzieski, Rohit Singh.
</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html> |