wilbin's picture
Upload 248 files
8896a5f verified
<!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 &mdash; 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> &raquo;</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>
&#169; 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>