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

Ambiguous greedy & parallel dissimilarity computation #226

Merged
merged 28 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7104bc5
updated state freq computation to account for ambiguous alleles
mattjones315 Sep 26, 2023
cbfea70
added tests for computing frequencies in ambiguous setting
mattjones315 Sep 26, 2023
58e3a05
robust duplicate dropping for ambiguous characters
mattjones315 Sep 26, 2023
2cfba2b
formatting
mattjones315 Sep 26, 2023
98a786b
implemented greedy splitting with ambiguous states
mattjones315 Sep 26, 2023
66dbc33
full support for greedy with ambiguous states
mattjones315 Sep 27, 2023
085a409
updated when ccphylo tests would be run
mattjones315 Sep 27, 2023
ac3deb4
added mixin utilities test
mattjones315 Sep 27, 2023
a58480e
updated duplicated leaf addition to account for ambiguity
mattjones315 Sep 27, 2023
6418ba5
added test to catch ambiguous states where theyre not supposed to be
mattjones315 Sep 27, 2023
7c22236
Merge branch 'master' into ambiguous_greedy
mattjones315 Sep 27, 2023
1097521
updated missing data classification when ambig states are present
mattjones315 Sep 27, 2023
e641932
formatting
mattjones315 Sep 27, 2023
ccfd54e
added breaking test for collapsing ambiguous edges
mattjones315 Sep 27, 2023
d27cd57
updated ancestral reconstruction with ambiguous states
mattjones315 Sep 27, 2023
54bb343
updated branch length calculation with ambiguous states
mattjones315 Sep 27, 2023
bfb1ad1
parallel distance computation
mattjones315 Oct 5, 2023
d493646
appending duplicates correctly for hybridsolver
mattjones315 Oct 6, 2023
2b3d554
updated ccphylo config and gitignore
mattjones315 Oct 10, 2023
4196559
added shared memory buffer
mattjones315 Oct 10, 2023
2071fc4
updated docstring in DistanceSolver for threads
mattjones315 Oct 10, 2023
c2a56ba
updated docstring in NeighborJoiningSolver
mattjones315 Oct 10, 2023
fbeb105
updated neighborjoining_solve_tests with new threads parameter
mattjones315 Oct 10, 2023
97656e0
updated ccphylo search
mattjones315 Oct 10, 2023
877c9bd
updated docstrings
mattjones315 Oct 10, 2023
1368c49
updated README with ccphylo instructions
mattjones315 Oct 10, 2023
9964571
added more tests for cluster linkage
mattjones315 Oct 10, 2023
60a914e
Merge branch 'master' into ambiguous_greedy
mattjones315 Oct 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -165,5 +165,4 @@ stdout.log
notebooks/.ipynb_checkpoints
cassiopeia/tools/branch_length_estimator/_iid_exponential_bayesian.cpp
docs/api/reference/**
cassiopeia/config.ini
.vscode
9 changes: 8 additions & 1 deletion cassiopeia/data/CassiopeiaTree.py
Original file line number Diff line number Diff line change
Expand Up @@ -1401,7 +1401,11 @@ def get_mutations_along_edge(

mutations = []
for i in range(self.n_character):
if parent_states[i] != child_states[i]:

mattjones315 marked this conversation as resolved.
Show resolved Hide resolved
parent_state = (list(parent_states[i]) if is_ambiguous_state(parent_states[i]) else [parent_states[i]])
child_state = (list(child_states[i]) if is_ambiguous_state(child_states[i]) else [child_states[i]])

if len(np.intersect1d(parent_state, child_state)) < 1:
if treat_missing_as_mutations:
mutations.append((i, child_states[i]))
elif (
Expand Down Expand Up @@ -1828,6 +1832,7 @@ def compute_dissimilarity_map(
] = None,
prior_transformation: str = "negative_log",
layer: Optional[str] = None,
threads: int = 1
) -> None:
"""Computes a dissimilarity map.

Expand All @@ -1854,6 +1859,7 @@ def compute_dissimilarity_map(
the square root of 1/p
layer: Character matrix layer to use. If not specified, use the
default :attr:`character_matrix`.
threads: Number of threads to use for dissimilarity map computation.
"""

if layer is not None:
Expand Down Expand Up @@ -1884,6 +1890,7 @@ def compute_dissimilarity_map(
dissimilarity_function,
weights,
self.missing_state_indicator,
threads=threads,
)

dissimilarity_map = scipy.spatial.distance.squareform(dissimilarity_map)
Expand Down
Loading
Loading