Skip to content

Initial columns functions - #22

Merged
ivirshup merged 19 commits into
mainfrom
columns
May 2, 2023
Merged

ivirshup merged 19 commits into
mainfrom
columns

Conversation

@lauradmartens

@lauradmartens lauradmartens commented Apr 27, 2023 •

Copy link
Copy Markdown
Contributor

Fixes #9 when finished and partly #6 for discoverability of columns

@lauradmartens

Copy link
Copy Markdown
Contributor Author
  • We might have to add a hierarchy to the column names because multiple tables contain same column names

@codecov-commenter

codecov-commenter commented Apr 27, 2023 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.47619% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.45%. Comparing base (0acfba3) to head (484af92).
⚠️ Report is 24 commits behind head on main.

Files with missing lines Patch % Lines
src/genomic_features/ensembl/ensembldb.py 90.47% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #22      +/-   ##
==========================================
+ Coverage   88.40%   90.45%   +2.05%     
==========================================
  Files           6        6              
  Lines         138      241     +103     
==========================================
+ Hits          122      218      +96     
- Misses         16       23       +7     
Files with missing lines Coverage Δ
src/genomic_features/_core/filters.py 89.47% <ø> (+3.94%) ⬆️
src/genomic_features/ensembl/ensembldb.py 90.25% <90.47%> (+0.06%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lauradmartens

Copy link
Copy Markdown
Contributor Author
  • Check why inner join tb1.left_join(tb2, 'gene_id').execute() returns one column called gene_id while left join returns gene_id_x and gene_id_y

@lauradmartens

Copy link
Copy Markdown
Contributor Author

This test needs to be checked:

# TODO: check why the number changes

@emdann emdann mentioned this pull request Apr 28, 2023
1 task
@lauradmartens
lauradmartens marked this pull request as ready for review April 28, 2023 16:37
@lauradmartens
lauradmartens requested a review from ivirshup April 28, 2023 16:37

@ivirshup ivirshup left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good! A few minor things, and one major thing:

Does joining on the protein table work now? That would be great!


tables.remove(start_with)
tables = [start_with] + tables
print(tables)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
print(tables)

My bad

Comment on lines +215 to +217
print(
f"Warning: tables {set(tab) - set(self.list_tables())} are not in the database."
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this be an error?

If it should be a warning, how about warnings.warn instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

At the moment it automatically deletes the tables that are not in the database and prints a warning (which I can replace by warnings.warn) unless you think error is preferable

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think an error makes more sense, since the result is different than what the user asked for.

But we can change that separately.

Comment thread tests/test_columns.py
Comment on lines +104 to +112
assert list(result.columns) == [
"gene_id",
"gene_name",
"protein_id",
"gene_biotype",
]
assert (
result.loc[result.gene_biotype != "protein_coding", "protein_id"].isna().all()
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does this work now?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, this works now. I added the mapping function to ensembldb.py

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great, so is #35 complete?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, we can close it.

@ivirshup ivirshup mentioned this pull request May 3, 2023
3 tasks done
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.

columns argument (plus joins)

3 participants