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

Filter prefixes #293

Merged
merged 13 commits into from
Aug 4, 2022
Merged

Filter prefixes #293

merged 13 commits into from
Aug 4, 2022

Conversation

hrshdhgd
Copy link
Contributor

@hrshdhgd hrshdhgd commented Aug 1, 2022

@hrshdhgd hrshdhgd marked this pull request as ready for review August 2, 2022 14:50
@hrshdhgd hrshdhgd requested a review from matentzn August 2, 2022 14:50
matentzn
matentzn previously approved these changes Aug 3, 2022
Copy link
Collaborator

@matentzn matentzn left a comment

Choose a reason for hiding this comment

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

I approve this, but if you really want to make me happy you can add a CLI method

remove(msdf1, msdf2)
  msdf1.remove_mappings(msdf2)
  write(msdf1)

@hrshdhgd
Copy link
Contributor Author

hrshdhgd commented Aug 3, 2022

Your wish is my command!

sssom remove abcd.sssom.tsv --remove-map def.sssom.tsv -o abde.sssom.tsv` 

should work.

Copy link
Collaborator

@matentzn matentzn left a comment

Choose a reason for hiding this comment

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

Excellent, left a few comments but nothing that blocks merging. THANKS

@main.command()
@input_argument
@click.option(
"--remove-map",
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is great, we can later consider making this multivalued (not now). Thank you!

@@ -360,6 +360,8 @@ def filter_file(input: str, output: TextIO, **kwargs) -> MappingSetDataFrame:
for exp in v[1:]:
query += " OR "
query += k + " LIKE '" + exp + "') "
else:
query += ") "
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is new, I assume there was no test for the else case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was missing and became apparent when only 1 value to a param was given for e.g. --subject_id ABCD:1234 instead of multiple --subject_id ABCD:1234 --subject_id DEFG:4567. The missing ) that's added in the code above threw an error. There was no test to check this.

@hrshdhgd hrshdhgd merged commit 0b5952f into master Aug 4, 2022
@hrshdhgd hrshdhgd deleted the filter-prefixes branch August 4, 2022 13:57
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.

2 participants