Skip to content

Commit

Permalink
Merge pull request #45 from klarman-cell-observatory/yiming
Browse files Browse the repository at this point in the history
Fix bug on inconsistency of count matrix with feature info
  • Loading branch information
bli25 committed Nov 26, 2020
2 parents c46a539 + 02f4a28 commit be7f04d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
13 changes: 2 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,8 @@ RUN apt-get -qq update && \
python3-dev \
python3-pip

RUN pip3 install setuptools==47.1.1 --no-cache-dir && \
pip3 install cython==0.29.19 --no-cache-dir && \
pip3 install numpy==1.18.5 --no-cache-dir && \
pip3 install scipy==1.4.1 --no-cache-dir && \
pip3 install pandas==1.0.4 --no-cache-dir && \
pip3 install anndata==0.7.3 --no-cache-dir && \
pip3 install loompy==3.0.6 --no-cache-dir && \
pip3 install docopt==0.6.2 --no-cache-dir && \
pip3 install natsort==7.0.1 --no-cache-dir && \
pip3 install importlib-metadata==1.6.0 --no-cache-dir && \
pip3 install zarr==2.4.0 --no-cache-dir
RUN pip3 install setuptools --no-cache-dir && \
pip3 install cython --no-cache-dir

RUN apt-get -qq -y remove curl gnupg && \
apt-get -qq -y autoremove && \
Expand Down
6 changes: 3 additions & 3 deletions pegasusio/aggr_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def _get_fillna_dict(df: pd.DataFrame) -> dict:
fillna_dict[column] = ""
else:
raise ValueError(f"{column} has unsupported dtype {df[column].dtype}!")

return fillna_dict


Expand Down Expand Up @@ -98,7 +98,7 @@ def _merge_matrices(self, feature_metadata: pd.DataFrame, unilist: List[Unimodal
data = np.concatenate(data_list)
row = np.concatenate(row_list)
col = np.concatenate(col_list)
matrices[mat_key] = coo_matrix((data, (row, col))).tocsr(copy = False)
matrices[mat_key] = coo_matrix((data, (row, col)), shape=(row_base, feature_metadata.shape[0])).tocsr(copy = False)

return matrices

Expand Down Expand Up @@ -154,7 +154,7 @@ def _aggregate_unidata(self, unilist: List[UnimodalData]) -> UnimodalData:


matrices = self._merge_matrices(feature_metadata, unilist, modality)


uns_dict = {}
metadata = {"genome": unilist[0].metadata["genome"], "modality": unilist[0].metadata["modality"]}
Expand Down

0 comments on commit be7f04d

Please sign in to comment.