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

New command: sort #51

Closed
matentzn opened this issue May 31, 2021 · 9 comments
Closed

New command: sort #51

matentzn opened this issue May 31, 2021 · 9 comments
Assignees

Comments

@matentzn
Copy link
Collaborator

See mapping-commons/sssom#39

We need a command that uses the canonical column order to sort an entire mapping set data frame correctly.

@cmungall
Copy link
Collaborator

cmungall commented Jul 6, 2021

I think this lower priority now we can just do sssom dosql SELECT * FROM match ORDER BY ...

@hrshdhgd
Copy link
Contributor

hrshdhgd commented Sep 2, 2021

Implement ^^^ as a test. (test/test.sh)

@matentzn
Copy link
Collaborator Author

matentzn commented Oct 4, 2021

We need to be able to sort the columns by their canonical order, with a method like
https://github.com/mapping-commons/sssom-py/pull/158/files#diff-8e0eb781f6bf2cf74b9c6a904555d8bd7f214fef45ea8e55da8527f834e600e4L191

I am happy if the sort function could simply build on the the dosql command, in combination with a canonical column ordering.

@hrshdhgd
Copy link
Contributor

hrshdhgd commented Apr 11, 2022

It seems like Mapping(**mdict) already sorts the column names in the order it appears in sssom.yaml as slots thus keeping it a standard sequence. So a sort method is not needed(?).

So everytime we read a file using read_sssom_table() , the columns are sorted automatically. I confirmed this using a test case.

cc: @matentzn , @cmungall

@matentzn
Copy link
Collaborator Author

Sort needs to sort also the rows!

This here seems wrong:
https://github.com/monarch-initiative/mondo/blob/master/src/ontology/mappings/mondo_broadmatch_icd10cm.sssom.tsv

You can see it has a subject_label right at the end, while I would expect it to be after subject_id!

@hrshdhgd
Copy link
Contributor

Aah .. I see why that's happening. Easy fix!

hrshdhgd added a commit that referenced this issue Apr 12, 2022
@hrshdhgd
Copy link
Contributor

hrshdhgd commented Apr 12, 2022

Now for rows, what would be the sort-by rule?

EDIT: Spoke to Chris and he said just a simple ascending ordered sort of the first column rows should suffice for now.

@hrshdhgd
Copy link
Contributor

@hrshdhgd
Copy link
Contributor

hrshdhgd commented Apr 12, 2022

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

No branches or pull requests

3 participants