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

fix: marginalize variable name #58

Merged
merged 2 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# PanGraph Changelog

## v0.7.1

- minor fix for multi-threaded marginalize, see [#58](https://github.com/neherlab/pangraph/pull/58).

## v0.7.0

- fasta input files are checked for duplicated records, and white lines between records are tolerated, see [#55](https://github.com/neherlab/pangraph/pull/55).
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PanGraph"
uuid = "0f9f61ca-f32c-45e1-b3bc-00138f4f8814"
authors = ["Nicholas Noll <nbnoll@eml.cc>"]
version = "0.7.0"
version = "0.7.1"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
20 changes: 10 additions & 10 deletions src/marginalize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,27 +70,27 @@ Marginalize = Command(
pairs = [(n₁, n₂) for n₁ in names for n₂ in names if n₁ < n₂]

Threads.@threads for (name₁, name₂) in pairs
G = Graphs.copy_graph(graph)
Graphs.keeponly!(G, name₁, name₂)
Γ = Graphs.copy_graph(graph)
Graphs.keeponly!(Γ, name₁, name₂)
if reduce
changed = true
while changed
l = length(G.block)
Graphs.deparalog!(G)
Graphs.detransitive!(G)
changed = l != length(G.block)
l = length(Γ.block)
Graphs.deparalog!(Γ)
Graphs.detransitive!(Γ)
changed = l != length(Γ.block)
end
else
Graphs.detransitive!(G)
Graphs.detransitive!(Γ)
end

# recompute positions
Graphs.finalize!(G)
Graphs.finalize!(Γ)

test_flag && verify(graph, G)
test_flag && verify(graph, Γ)

open("$(output)/$(name₁)-$(name₂).json", "w") do io
marshal(io, G; fmt = :json)
marshal(io, Γ; fmt = :json)
end
end
end
Expand Down