Skip to content

Add gene annotations to anndata vars#23

Open
emdann wants to merge 26 commits into
mainfrom
annotate-anndata
Open

Add gene annotations to anndata vars#23
emdann wants to merge 26 commits into
mainfrom
annotate-anndata

Conversation

@emdann
Copy link
Copy Markdown
Member

@emdann emdann commented Apr 27, 2023

Closes #14

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 27, 2023

Codecov Report

❌ Patch coverage is 89.47368% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.72%. Comparing base (2398977) to head (e669b8b).
⚠️ Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
src/genomic_features/annotate.py 89.18% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #23      +/-   ##
==========================================
- Coverage   93.69%   92.72%   -0.98%     
==========================================
  Files           6        7       +1     
  Lines         333      371      +38     
==========================================
+ Hits          312      344      +32     
- Misses         21       27       +6     
Files with missing lines Coverage Δ
src/genomic_features/__init__.py 100.00% <100.00%> (ø)
src/genomic_features/annotate.py 89.18% <89.18%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@emdann
Copy link
Copy Markdown
Member Author

emdann commented Apr 27, 2023

Outstanding issues:

  • Dealing with common column names between var table and annotation table. Throw error?

@emdann emdann marked this pull request as ready for review April 28, 2023 09:04
@emdann emdann requested a review from ivirshup April 28, 2023 09:05
Comment thread tests/test_annotate_anndata.py Outdated
Comment thread tests/test_annotate_anndata.py Outdated
Comment thread tests/test_annotate_anndata.py Outdated
Comment thread src/genomic_features/annotate_anndata.py Outdated
@emdann emdann requested a review from ivirshup May 7, 2023 22:11
@ivirshup ivirshup requested a review from lauradmartens May 8, 2023 11:34
def annotate_anndata(
adata_var: pd.DataFrame,
annotation_df: pd.DataFrame,
on: str = None,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found the variable names a bit confusing because in pandas syntax on means that the column is present in both tables. Maybe we could name it left_on and right_on like in pd.merge

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed to annotation_on and var_on to match the other params

Comment thread src/genomic_features/annotate_anndata.py
Comment thread src/genomic_features/annotate_anndata.py Outdated
@lauradmartens
Copy link
Copy Markdown
Contributor

Looks good! I added a few minor comments :)

Copy link
Copy Markdown
Member

@ivirshup ivirshup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, looks good.

One comment on the tutorial, can we make it so the AnnData used the same ensembl version as we annotate with? Either by using a different ensembl version, or a different AnnData.

Comment thread docs/notebooks/data/pbmc3k_raw.h5ad Outdated
Comment thread src/genomic_features/__init__.py Outdated
Comment thread src/genomic_features/annotate_anndata.py Outdated
Comment thread src/genomic_features/annotate_anndata.py
@emdann
Copy link
Copy Markdown
Member Author

emdann commented May 18, 2023

@ivirshup wrt Ensembl version matching, the pbmc3k data was mapped with cellranger 1.1, but I am having a hard time matching this version to a Ensembl release.

I'm gonna use the data from scvi.data.heart_cell_atlas_subsampled which is mapped to cellranger 3.0.1 with hg38 which according to the old release notes corresponds to Ensembl release 93.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

annotate_anndata/ annotate_table

4 participants