-
Notifications
You must be signed in to change notification settings - Fork 0
# SCP-2635 Ensure cell names from expression matrices are unique across files #124
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
2c4bd53
Tests for unique cells
knapii-developments a210996
Save work
knapii-developments 2657aee
Save work
knapii-developments a7e54b5
Add tests and function for unique cells
knapii-developments 8cef472
Organize tests
knapii-developments c3ccdf0
Save work
knapii-developments 79948a7
Save work
knapii-developments fb81c6d
Make updates
knapii-developments b98438d
Add addition tests
knapii-developments 15399b7
Update function name to reflect purpose
knapii-developments cbb3bc9
enabling granular error reporting for expression matrix validation
devonbush 4595753
Apply suggestions from code review
devonbush f64d882
Merge pull request #126 from broadinstitute/db-granular-errors
knapii-developments ae9778e
Update ingest/expression_files/expression_files.py
knapii-developments c8804d7
Merge branch 'master' into ea-dense-cross-file-validation
knapii-developments File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import sys | ||
| import unittest | ||
| from unittest.mock import MagicMock | ||
| from bson.objectid import ObjectId | ||
|
|
||
| sys.path.append("../ingest") | ||
| from expression_files.expression_files import GeneExpression | ||
|
|
||
|
|
||
| class TestExpressionFiles(unittest.TestCase): | ||
| def test_check_unique_cells(self): | ||
| client_mock = MagicMock() | ||
| header = ["GENE", "foo", "foo2", "foo3"] | ||
|
|
||
| client_mock["data_arrays"].find.return_value = [ | ||
| {"values": ["foo3", "foo4", "foo5"]}, | ||
| {"values": ["foo6", "foo7", "foo8"]}, | ||
| ] | ||
| with self.assertRaises(ValueError) as cm: | ||
| GeneExpression.check_unique_cells(header, ObjectId(), client_mock) | ||
| self.assertTrue("contains 1 cells" in str(cm.exception)) | ||
| self.assertTrue("foo3" in str(cm.exception)) | ||
|
|
||
| header = ["GENE", "foo", "foo3", "foo2", "foo6"] | ||
| with self.assertRaises(ValueError) as cm: | ||
| GeneExpression.check_unique_cells(header, ObjectId(), client_mock) | ||
| self.assertTrue("contains 2 cells" in str(cm.exception)) | ||
| self.assertTrue("foo3" in str(cm.exception)) | ||
| self.assertTrue("foo6" in str(cm.exception)) | ||
|
|
||
| header = ["GENE", "foo", "foo2"] | ||
| self.assertTrue( | ||
| GeneExpression.check_unique_cells(header, ObjectId(), client_mock) | ||
| ) | ||
|
|
||
| client_mock["data_arrays"].find.return_value = [] | ||
| self.assertTrue( | ||
| GeneExpression.check_unique_cells(header, ObjectId(), client_mock) | ||
| ) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not strictly necessary, but you could add
{"linear_data_id": study_id}.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im adding this suggestion in another PR.