Skip to content

Matrix#45

Open
mattheww95 wants to merge 10 commits into
devfrom
matrix
Open

Matrix#45
mattheww95 wants to merge 10 commits into
devfrom
matrix

Conversation

@mattheww95

@mattheww95 mattheww95 commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

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.

@mattheww95
mattheww95 changed the base branch from main to dev July 13, 2026 19:02
@mattheww95 mattheww95 linked an issue Jul 14, 2026 that may be closed by this pull request
@mattheww95
mattheww95 marked this pull request as ready for review July 14, 2026 15:29

@emarinier emarinier left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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
]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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?

Comment thread src/beave/cluster.py
dists_to_matrix, square_matrix, cluster_args.delimiter, matrix_output
)
matrix_task = create_matrix(
cluster_args, distances, profile_names, output_extension, tg

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd prefer tg as something like task_group, but it's okay.

Comment thread README.md
>>> 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}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should the * in SampleID*1 and dist*{hamming,normalized} be _, or is this correct?

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.

Add option to generate matrix only.

2 participants