-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove torchaudio, add test data and bump version to 0.2.2 (#15)
* Add synthetic data for integration test * Remove torchaudio * Bump version to 0.2.2 Co-authored-by: Sheng, Caibin <[email protected]>
- Loading branch information
Showing
10 changed files
with
209 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# -*- coding: utf-8 -*- | ||
__version__ = '0.2.1' | ||
__version__ = '0.2.2' |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,208 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "ac5906d1-7f3a-4661-8235-8bca20ec9c45", | ||
"metadata": {}, | ||
"source": [ | ||
"## integration test" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"id": "aa6514e7-19b3-4b91-9f6f-e2ad125bf9d7", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import warnings\n", | ||
"warnings.filterwarnings(\"ignore\", category=DeprecationWarning)\n", | ||
"\n", | ||
"from scAR import model\n", | ||
"import pandas as pd" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"id": "9f1b9ec0-8452-4f17-983a-324e2d2e1920", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"raw_count = pd.read_pickle('raw_counts.pickle')\n", | ||
"empty_profile = pd.read_pickle('ambient_profile.pickle')\n", | ||
"expected_output = pd.read_pickle('output_assignment.pickle')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"id": "476f7dba-8bbb-4f7b-9344-b2f0abf8eab1", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"..Running VAE using the following param set:\n", | ||
"......scAR mode: CROPseq\n", | ||
"......count model: binomial\n", | ||
"......num_input_feature: 5\n", | ||
"......NN_layer1: 150\n", | ||
"......NN_layer2: 100\n", | ||
"......latent_space: 15\n", | ||
"......dropout_prob: 0\n", | ||
"......kld_weight: 1e-05\n", | ||
"......lr: 0.001\n", | ||
"......lr_step_size: 5\n", | ||
"......lr_gamma: 0.97\n", | ||
"===========================================\n", | ||
" Training.....\n", | ||
"100%|██████████| 40/40 [00:09<00:00, 4.21it/s]\n", | ||
"===========================================\n", | ||
" Inferring .....\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"scarObj = model(raw_count=raw_count.values,\n", | ||
" empty_profile=empty_profile,\n", | ||
" scRNAseq_tech='CROPseq')\n", | ||
"\n", | ||
"scarObj.train(epochs=40,\n", | ||
" batch_size=64,)\n", | ||
"\n", | ||
"scarObj.inference()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "c1bc7f76-b22a-4fe4-a297-d4db3dfd80c3", | ||
"metadata": {}, | ||
"source": [ | ||
"**test whether the output is expected**" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"id": "604f97ab-62ae-4eed-8ea4-82bb4f2ea002", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/html": [ | ||
"<div>\n", | ||
"<style scoped>\n", | ||
" .dataframe tbody tr th:only-of-type {\n", | ||
" vertical-align: middle;\n", | ||
" }\n", | ||
"\n", | ||
" .dataframe tbody tr th {\n", | ||
" vertical-align: top;\n", | ||
" }\n", | ||
"\n", | ||
" .dataframe thead th {\n", | ||
" text-align: right;\n", | ||
" }\n", | ||
"</style>\n", | ||
"<table border=\"1\" class=\"dataframe\">\n", | ||
" <thead>\n", | ||
" <tr style=\"text-align: right;\">\n", | ||
" <th></th>\n", | ||
" <th>sgRNAs</th>\n", | ||
" <th>n_sgRNAs</th>\n", | ||
" </tr>\n", | ||
" </thead>\n", | ||
" <tbody>\n", | ||
" <tr>\n", | ||
" <th>0</th>\n", | ||
" <td>1</td>\n", | ||
" <td>1</td>\n", | ||
" </tr>\n", | ||
" <tr>\n", | ||
" <th>1</th>\n", | ||
" <td>3</td>\n", | ||
" <td>1</td>\n", | ||
" </tr>\n", | ||
" <tr>\n", | ||
" <th>2</th>\n", | ||
" <td>4</td>\n", | ||
" <td>1</td>\n", | ||
" </tr>\n", | ||
" <tr>\n", | ||
" <th>3</th>\n", | ||
" <td>0</td>\n", | ||
" <td>1</td>\n", | ||
" </tr>\n", | ||
" <tr>\n", | ||
" <th>4</th>\n", | ||
" <td>2</td>\n", | ||
" <td>1</td>\n", | ||
" </tr>\n", | ||
" </tbody>\n", | ||
"</table>\n", | ||
"</div>" | ||
], | ||
"text/plain": [ | ||
" sgRNAs n_sgRNAs\n", | ||
"0 1 1\n", | ||
"1 3 1\n", | ||
"2 4 1\n", | ||
"3 0 1\n", | ||
"4 2 1" | ||
] | ||
}, | ||
"execution_count": 4, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"scarObj.feature_assignment.head()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 5, | ||
"id": "9710ad5d-744e-448a-be7e-b49fb8ed22cc", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"True" | ||
] | ||
}, | ||
"execution_count": 5, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"scarObj.feature_assignment.equals(expected_output)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "scAR-0.2", | ||
"language": "python", | ||
"name": "scar-0.2" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.4" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters