Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gene annotations to anndata vars #23

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open

Add gene annotations to anndata vars #23

wants to merge 26 commits into from

Conversation

emdann
Copy link
Member

@emdann emdann commented Apr 27, 2023

Closes #14

@codecov-commenter
Copy link

codecov-commenter commented Apr 27, 2023

Codecov Report

Merging #23 (e669b8b) into main (2398977) will decrease coverage by 0.98%.
The diff coverage is 92.98%.

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     
Impacted Files Coverage Δ
src/genomic_features/annotate.py 89.18% <89.18%> (ø)
src/genomic_features/__init__.py 100.00% <100.00%> (ø)
src/genomic_features/ensembl/ensembldb.py 93.15% <100.00%> (-1.06%) ⬇️

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@emdann
Copy link
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
tests/test_annotate_anndata.py Outdated Show resolved Hide resolved
tests/test_annotate_anndata.py Outdated Show resolved Hide resolved
tests/test_annotate_anndata.py Outdated Show resolved Hide resolved
src/genomic_features/annotate_anndata.py Outdated Show resolved Hide resolved
@emdann emdann requested a review from ivirshup May 7, 2023 22:11
def annotate_anndata(
adata_var: pd.DataFrame,
annotation_df: pd.DataFrame,
on: str = None,
Copy link
Collaborator

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
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

@lauradmartens
Copy link
Collaborator

Looks good! I added a few minor comments :)

Copy link
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.

docs/notebooks/data/pbmc3k_raw.h5ad Outdated Show resolved Hide resolved
src/genomic_features/__init__.py Outdated Show resolved Hide resolved
src/genomic_features/annotate_anndata.py Outdated Show resolved Hide resolved
src/genomic_features/annotate_anndata.py Outdated Show resolved Hide resolved
@emdann
Copy link
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