Skip to content

Commit

Permalink
Merge pull request #26 from klarman-cell-observatory/yiming
Browse files Browse the repository at this point in the history
Modify dockerfile to enable unit test
  • Loading branch information
yihming committed Jun 19, 2020
2 parents 72df0e0 + c11cd9d commit 1a39d90
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ RUN apt-get -qq -y remove curl gnupg && \

COPY . /pegasusio/
WORKDIR /pegasusio/tests
RUN git clone https://github.com/klarman-cell-observatory/pegasus-test-data.git
RUN git clone https://github.com/klarman-cell-observatory/pegasusio-test-data.git
WORKDIR /pegasusio/
RUN pip3 install -e .

WORKDIR /pegasusio/tests
10 changes: 5 additions & 5 deletions tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@
class TestIO(unittest.TestCase):

def test_read_h5ad(self):
data = io.read_input("tests/pegasusio-test-data/case1/pbmc3k.h5ad", genome = 'hg19')
data = io.read_input("pegasusio-test-data/case1/pbmc3k.h5ad", genome = 'hg19')
self.assertEqual(data.shape, (2638, 1838))

def test_mixture_data(self):
data = io.read_input("tests/pegasusio-test-data/case2/1k_hgmm_v3_filtered_feature_bc_matrix.h5")
data = io.read_input("pegasusio-test-data/case2/1k_hgmm_v3_filtered_feature_bc_matrix.h5")
data.select_data('mm10-rna')
self.assertEqual(data.shape, (1063, 54232))
data.select_data('hg19-rna')
self.assertEqual(data.shape, (1063, 57905))

def test_read_10x_mtx(self):
data = io.read_input("tests/pegasusio-test-data/case3/42468c97-1c5a-4c9f-86ea-9eaa1239445a.mtx", genome = 'hg19')
data = io.read_input("pegasusio-test-data/case3/42468c97-1c5a-4c9f-86ea-9eaa1239445a.mtx", genome = 'hg19')
self.assertEqual(data.shape, (2544, 58347))

def test_read_loom(self):
data = io.read_input("tests/pegasusio-test-data/case3/pancreas.loom", genome = 'hg19')
data = io.read_input("pegasusio-test-data/case3/pancreas.loom", genome = 'hg19')
self.assertEqual(data.shape, (2544, 58347))

def test_read_zarr(self):
data = io.read_input("tests/pegasusio-test-data/case4/MantonBM1_1_dbls.zarr")
data = io.read_input("pegasusio-test-data/case4/MantonBM1_1_dbls.zarr")
self.assertEqual(data.shape, (4274, 19360))

if __name__ == '__main__':
Expand Down

0 comments on commit 1a39d90

Please sign in to comment.