Skip to content

Commit

Permalink
revision
Browse files Browse the repository at this point in the history
  • Loading branch information
bfurtwa committed Mar 23, 2021
1 parent b502287 commit b011548
Show file tree
Hide file tree
Showing 4 changed files with 336 additions and 128 deletions.
80 changes: 77 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

SCeptre is a python package that extends the functionalities of Scanpy to analyze multiplexed single-cell proteomics data.

### Installation from Github
## Installation from Github

Tested on Ubuntu 20.04.1 LTS.
It's recommended to work in a dedicated conda environment. E.g:
Expand All @@ -19,7 +19,8 @@ Clone the repository and `cd` into its root directory. Then:
pip install .
```

### Usage
## Usage
### Replication of Schoof et al.

Usage is exemplified in the notebooks for the analysis from the mansucript "Quantitative Single-Cell Proteomics as a Tool to Characterize Cellular Hierarchies".

Expand All @@ -31,7 +32,11 @@ conda activate sceptre
pip install Schoof_et_al/code/sceptre-0.1-py3-none-any.whl
```

Find the notebooks in the subdirectory `Schoof_et_al/code` and the required data in `Schoof_et_al/data`.
The required data can be downloaded from
http://proteomecentral.proteomexchange.org
using the dataset identifier PXD020586

Find the notebooks in the subdirectory `Schoof_et_al/code` and the place the required data in `Schoof_et_al/data`.

The following notebooks process the different datasets:

Expand All @@ -42,3 +47,72 @@ Notebook | Description
bulk.ipynb | SCeptre analysis of the 'bulk' dataset.
integrated.ipynb | SCeptre analysis of the 'integrated' dataset.

### Functions and example worklow
Each function has its own docstring explaining the function in depth. A typical workflow makes usage of the following steps:

#### Create meta data
To create the meta data for each cell, as done in Schoof et al., from a collection of tables describing the experimental design
and layouts of the 384-well plates, the following function is used. For details on the required tables, have a look at `Schoof_et_al/data/500ms`.
```
import sceptre as spt
spt.create_meta_data(input_dir="../data/500ms/", output_dir=res_dir)
```
Alternatively, the meta data table can be created by the user. It requires the columns `File ID` and `Channel` to map the meta data to each cell.

#### Load dataset
To load the dataset into python, to following function is used. To this end, only output tables from Proteome Discoverer are supported.
```
dataset = spt.load_dataset(proteins = "../data/500ms/500ms_Proteins.txt",
psms = "../data/500ms/500ms_PSMs.txt",
msms = "../data/500ms/500ms_MSMSSpectrumInfo.txt",
files = "../data/500ms/500ms_InputFiles.txt",
meta = res_dir + "meta.txt")
```

#### LC-MS QC
The dataset object can be used to quality control each LC-MS run with the follwing functions.
```
spt.plot_psms_msms(dataset)
spt.plot_avg_sn(dataset)
spt.plot_set_overview(dataset)
s_c_channels = ['127N', '128N', '128C', '129N', '129C', '130N', '130C',
'131N','131C', '132N', '132C', '133N', '133C', '134N']
spt.print_ms_stats(dataset, s_c_channels=s_c_channels)
spt.plot_interference(dataset)
```

#### Load dataset into Scanpy
Subsequently the dataset object is used to create a scanpy adata object.
```
adata = spt.dataset_to_scanpy(dataset)
```

#### Filtering and normalization
Non-single cell channels have to be removed.
```
adata = adata[adata.obs['Channel'] != '126'].copy()
adata = adata[adata.obs['Channel'] != '127C'].copy()
```
Then the dataset can be normalized.
```
spt.normalize(adata)
```

#### Cell QC
The follwing functions are used to filter out outlier cells.
```
spt.calculate_cell_filter(adata)
spt.apply_cell_filter(adata)
```

#### Batch QC
To detect potential systematic bias introduced by the sample preparation or measurement the following functions can be used.
```
spt.plot_batch_qc(adata)
spt.plot_plate_qc(adata)
```

#### Scanpy analysis
The adata object can now be used to perform a scanpy analysis.
2 changes: 1 addition & 1 deletion Schoof_et_al/code/300ms.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand Down
Loading

0 comments on commit b011548

Please sign in to comment.