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

Refactor read_dist() #13

Open
kelly-sovacool opened this issue Sep 29, 2020 · 4 comments · May be fixed by #50
Open

Refactor read_dist() #13

kelly-sovacool opened this issue Sep 29, 2020 · 4 comments · May be fixed by #50

Comments

@kelly-sovacool
Copy link
Member

kelly-sovacool commented Sep 29, 2020

read_dist() should check whether the file provided is a lower triangular distance matrix, a square matrix, or not a valid format.

Details on phylip-formatted distance matrices: https://mothur.org/wiki/phylip-formatted_distance_matrix/#:~:text=The%20basic%20format%20of%20a,sequence%20to%20the%20other%20sequences.

Note: phyloseq::import_mothur_dist() exists, but we should have our own version because:

  • That function returns a matrix, but we like dataframes.
  • We don't want to have many external dependencies.
@kelly-sovacool
Copy link
Member Author

@NLesniak I wonder if read_dist() should have a more specific name since it is specifically for phylip-formatted lower triangular matrices, and not for square matrices or mothur's column format? e.g. read_mtx_phylip() or something like that?

@NLesniak
Copy link
Collaborator

@kelly-sovacool do you think we should rename this and have a specific function for each or add the ability to read different input types to this function?

@kelly-sovacool
Copy link
Member Author

kelly-sovacool commented Oct 15, 2020

@NLesniak perhaps both? For now maybe we should rename this one to something phylip-specific. If we want/need to add support for other file types, we would add those as functions following a similar naming scheme. Potentially then read_dist() could become a wrapper around those functions with a file type parameter.

@kelly-sovacool
Copy link
Member Author

Pat's code to read mothur's lower triangular distance file as a matrix: https://github.com/riffomonas/distances/blob/f5cb11b7d8c5a900249c5e676269699411f0092a/code/read_matrix.R

@kelly-sovacool kelly-sovacool changed the title read_dist() input validation Refactor read_dist() Mar 20, 2023
@kelly-sovacool kelly-sovacool changed the title Refactor read_dist() Refactor read_dist() Mar 20, 2023
@kelly-sovacool kelly-sovacool linked a pull request Jun 1, 2023 that will close this issue
1 task
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 a pull request may close this issue.

2 participants