Matrix#45
Open
mattheww95 wants to merge 10 commits into
Open
Conversation
mattheww95
marked this pull request as ready for review
July 14, 2026 15:29
emarinier
approved these changes
Jul 15, 2026
emarinier
left a comment
Member
There was a problem hiding this comment.
Looks good to me. Thanks. Just a few comments.
Comment on lines
+1270
to
+1274
| lines = [ | ||
| [int(f) if f.isdigit() else f for f in i.split("\t")] | ||
| for i in matrix.read_text().split("\n") | ||
| if i | ||
| ] |
Member
There was a problem hiding this comment.
I understand what this is doing, but it's pretty densely coded. The if i being in-line below the for i ... makes it look like it's supposed to be a classic for-loop, but a tab is missing. Do you know if this is the normal way to format these sorts of code blocks?
| dists_to_matrix, square_matrix, cluster_args.delimiter, matrix_output | ||
| ) | ||
| matrix_task = create_matrix( | ||
| cluster_args, distances, profile_names, output_extension, tg |
Member
There was a problem hiding this comment.
I'd prefer tg as something like task_group, but it's okay.
| >>> beave match -q src/beave/tests/data/R1KC1K.head.tsv -r src/beave/tests/data/R1KC1K.tail.tsv -t 101 -l average -c 8 | ||
| ``` | ||
|
|
||
| In some instances you may have no need to perform clustering and simply want a distance matrix for other downstream purposes. The matrix option can perform this task and generate a matrix or all pairwise distances in a molten format. e.g. SampleID*1, SampleID_2, dist*{hamming,normalized} |
Member
There was a problem hiding this comment.
Should the * in SampleID*1 and dist*{hamming,normalized} be _, or is this correct?
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Added option to generate distance matrix and exit program.
This may not be needed, holding off on merging for now. May add molten output option.