Skip to content

Commit

Permalink
Updated dependency and examples.
Browse files Browse the repository at this point in the history
Version bump.
  • Loading branch information
lingfeiwang committed Aug 15, 2020
1 parent 0e25fad commit 54dd52d
Show file tree
Hide file tree
Showing 16 changed files with 531 additions and 398 deletions.
2 changes: 1 addition & 1 deletion PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: normalisr
Version: 0.4.1
Version: 0.4.2
Summary: Normalisr Offers Robust Modelling of Associations Linearly In Single-cell RNA-seq
Home-page: https://github.com/lingfeiwang/normalisr
Author: Lingfei Wang
Expand Down
3 changes: 3 additions & 0 deletions UPDATES
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
0.4.2:
Updated dependency and examples.

0.4.1:
Updated documentation.

Expand Down
4 changes: 2 additions & 2 deletions docs/build/html/all_api.html
Original file line number Diff line number Diff line change
Expand Up @@ -523,8 +523,8 @@ <h1>All API<a class="headerlink" href="#all-api" title="Permalink to this headli
<dt id="normalisr.lcpm.lcpm">
<code class="sig-prename descclassname">normalisr.lcpm.</code><code class="sig-name descname">lcpm</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">reads</span></em>, <em class="sig-param"><span class="n">normalize</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">nth</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">ntot</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">varscale</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">seed</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#normalisr.lcpm.lcpm" title="Permalink to this definition"></a></dt>
<dd><p>Computes Bayesian log CPM from raw read counts.</p>
<p>The technical sampling process is modelled as a Binomial distribution. The logCPM given read counts is a Bayesian inference problem and follows (shifted) Beta distribution. We use the expectation of posterior logCPM as the estimated expression levels. Resampling function is also provided to account for variances in the posterior distribution.
<strong>Warning</strong>: Modifying keyword arguments other than nth or seed is neither recommended nor supported for function ‘lcpm’. Do so at your own risk.</p>
<p>The technical sampling process is modelled as a Binomial distribution. The logCPM given read counts is a Bayesian inference problem and follows (shifted) Beta distribution. We use the expectation of posterior logCPM as the estimated expression levels. Resampling function is also provided to account for variances in the posterior distribution.</p>
<p><strong>Warning</strong>: Modifying keyword arguments other than nth or seed is neither recommended nor supported for function ‘lcpm’. Do so at your own risk.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
Expand Down
4 changes: 2 additions & 2 deletions docs/build/html/user_api.html
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ <h2>Co-expression<a class="headerlink" href="#co-expression" title="Permalink to
<dt id="normalisr.normalisr.lcpm">
<code class="sig-prename descclassname">normalisr.normalisr.</code><code class="sig-name descname">lcpm</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">reads</span></em>, <em class="sig-param"><span class="n">normalize</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">nth</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">ntot</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">varscale</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">seed</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#normalisr.normalisr.lcpm" title="Permalink to this definition"></a></dt>
<dd><p>Computes Bayesian log CPM from raw read counts.</p>
<p>The technical sampling process is modelled as a Binomial distribution. The logCPM given read counts is a Bayesian inference problem and follows (shifted) Beta distribution. We use the expectation of posterior logCPM as the estimated expression levels. Resampling function is also provided to account for variances in the posterior distribution.
<strong>Warning</strong>: Modifying keyword arguments other than nth or seed is neither recommended nor supported for function ‘lcpm’. Do so at your own risk.</p>
<p>The technical sampling process is modelled as a Binomial distribution. The logCPM given read counts is a Bayesian inference problem and follows (shifted) Beta distribution. We use the expectation of posterior logCPM as the estimated expression levels. Resampling function is also provided to account for variances in the posterior distribution.</p>
<p><strong>Warning</strong>: Modifying keyword arguments other than nth or seed is neither recommended nor supported for function ‘lcpm’. Do so at your own risk.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
Expand Down
Binary file modified docs/build/latex/normalisr.pdf
Binary file not shown.
8 changes: 4 additions & 4 deletions examples/GSE120861/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ High-MOI CRISPRi CROP-seq pilot dataset for enhancer and gene-regulation screens
## Usage
### Data preparation
1. Enter GSE120861 as the working directory.
2. Run ./code/prepare.sh to download and convert dataset into Normalisr's tsv format. See prepared inputs in data/highmoi.
2. Run `code/prepare.sh` to download and convert dataset into Normalisr's tsv format. See prepared inputs in data/highmoi.

### Option 1: analyses at command line
1. Read and run ./code/cmd_highmoi.sh to see each step. Final outputs are:
1. Read and run `code/cmd_highmoi.sh` from current folder as working directory to see each step. Final outputs are:
* data/highmoi/X_pv.tsv.gz: differential expression matrix for P-values;
* data/highmoi/X_lfc.tsv.gz: differential expression matrix for logFCs;
* data/highmoi/1_gene.txt: gene names as columns of above files;
* data/highmoi/0_gRNA.txt: gRNA names as rows of above files;
* X=7 for competition-naive method, and 8 for competition-aware method.
2. See simple visualizations of the output in folder ipynb.
2. Run `cd ipynb; jupyter notebook` and then run `highmoi.ipynb` in jupyter to see simple visualizations of the output.

### Option 2: analyses with python
Read and run jupyter notebook at ./code/notebook_highmoi.ipynb
Run `cd code; jupyter notebook` and then read and run `notebook_highmoi.ipynb` in jupyter.

## Next
1. Redo the analyses with full dataset. This example uses 15 non-targeting and 15 TSS-targeting gRNAs and around 7,000 cells to work on 16GB of memory. Start from a clean example folder. Change variable ng_negselect, ng_tssselect, ng_other, droprate_ng, and droprate_g in code/prepare_highmoi.py. Then rerun the full example again.
Expand Down
48 changes: 30 additions & 18 deletions examples/GSE120861/code/notebook_highmoi.ipynb

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions examples/GSE120861/ipynb/highmoi.ipynb

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions examples/GSE123139/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ MARS-seq of T cells from human melanoma. This example contains two sub-examples
## Usage
### Data preparation
1. Enter GSE123139 as the working directory.
2. Run ./code/prepare.sh to download and convert the dataset into Normalisr's tsv format. See prepared inputs in data/de and data/coex.
2. Run `code/prepare.sh` to download and convert the dataset into Normalisr's tsv format. See prepared inputs in data/de and data/coex.

### Option 1: analyses at command line
1. For differential expression, read and run ./code/cmd_de.sh to see each step. Final outputs are:
1. For differential expression, read and run `code/cmd_de.sh` from current folder as working directory to see each step. Final outputs are:
* data/de/9_pv.tsv.gz: differential expression P-values;
* data/de/9_lfc.tsv.gz: differential expression logFCs;
* data/de/1_gene.txt: gene names as columns of above files.
2. For co-expression, edit, read, and run ./code/cmd_coex.sh to see each step. Final outputs are:
2. For co-expression, edit, read, and run `code/cmd_coex.sh` from current folder as working directory to see each step. Final outputs are:
* data/coex/lvX_pv.tsv.gz: co-expression P-values;
* data/coex/lvX_net.tsv.gz: binary co-expression network;
* data/coex/lvX_var.tsv.gz: gene variances;
Expand All @@ -20,11 +20,12 @@ MARS-seq of T cells from human melanoma. This example contains two sub-examples
* data/coex/lvX_goe.tsv.gz: table of gene ontology enrichment of master regulators;
* data/coex/1_gene.txt: gene names as rows and columns of co-expression result matrices;
* X in lvX indicates the number of GO pathway covariates removed, for a more cell-type-specific co-expression network.
3. See simple visualizations of the output in folder ipynb.
3. Run `cd ipynb; jupyter notebook` and then run each ipynb file in jupyter to see simple visualizations of the output.

### Option 2: analyses with python
1. For differential expression, read and run jupyter notebook at ./code/notebook_de.ipynb.
2. For co-expression, edit, read, and run jupyter notebook at ./code/notebook_coex.ipynb.
1. Run `cd code; jupyter notebook` to launch jupyter.
1. For differential expression, read and run `notebook_de.ipynb`.
2. For co-expression, edit, read, and run `notebook_coex.ipynb`.

## Next
1. Redo the analyses with full dataset. This example uses around half of the cells to work on 16GB of memory. For the full dataset, start from a clean example folder. Change variable drop_rate in code/prepare_raw.py and qcut in code/cmd_coex.sh. Then rerun the full example again.
Expand Down
Loading

0 comments on commit 54dd52d

Please sign in to comment.