-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b0b5f9c
commit 79a983b
Showing
1 changed file
with
36 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Created on Wed Jun 10 09:32:49 2020 | ||
@author: Ajit Johnson Nirmal | ||
Tests | ||
""" | ||
|
||
import pytest | ||
import sys, os | ||
|
||
#os.chdir ("/Users/aj/Dropbox (Partners HealthCare)/packages/scimap") | ||
|
||
@pytest.fixture | ||
def adata(): | ||
from scimap.preprocessing.mcmicro_to_scimap import mcmicro_to_scimap | ||
image_path = [os.getcwd() + '/scimap/tests/_data/example_data.csv'] | ||
adata = mcmicro_to_scimap (image_path, split='X_position', drop_markers=['BG1', 'BG2', 'BG3']) | ||
return adata | ||
|
||
|
||
def test_mcmicro_to_scimap(adata): | ||
assert adata.shape == (3029, 33) | ||
|
||
def test_rescale(adata): | ||
import pandas as pd | ||
import numpy as np | ||
from scimap.preprocessing.rescale import rescale | ||
|
||
# test rescaling data | ||
manual_gate = pd.DataFrame({'marker': ['CD3D', 'KI67'], 'gate': [7, 8]}) | ||
adata = rescale (adata, gate=manual_gate, failed_markers={'all':['CD20', 'CD21']}) | ||
a = np.round(adata[:,'CD3D'].X[0],2) | ||
|
||
# test | ||
assert a == 0.4 |