Skip to content

Commit

Permalink
add the script for the paper
Browse files Browse the repository at this point in the history
  • Loading branch information
axsk committed Feb 21, 2024
1 parent cd4854c commit 2dcd5b6
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
39 changes: 39 additions & 0 deletions scripts/papersuru.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using ISOKANN
using ISOKANN.IsoMu
using Random

using Plots, JLD2

datapath = "/data/numerik/ag_cmd/trajectory_transfers_for_isokann/data/Feb16_data_for_paper_disulfide_sims"

function papersuru(n=30_000)
Random.seed!(42)

links = [DataLink("$datapath/_$i") for i in 1:10]

mu = isokann(links, learnrate=1e-4, regularization=1e-2)

train!(mu, n)
IsoMu.cpu!(mu)

ids = save_reactive_path(mu, sigma=0.7, out="out/paper/react.pdb")

scatter(
1:size(mu.iso.data[1], 2),
mu.iso.model(mu.iso.data[1]) |> vec,
xlabel="frame",
ylabel="\\chi",
legend=false,
markersize=1,
xticks=0:1000:10000,
markerstrokewidth=0,
) |> display
savefig("out/paper/paperplot.pdf")

chi = mu.iso.model(mu.iso.data[1])

plot!(ids, chi[ids], linealpha=1, linecolor="Salmon") |> display
savefig("out/paper/paperplot2.pdf")

jldsave("out/paper/results.jld2", mu=mu)
end
2 changes: 1 addition & 1 deletion src/IsoMu/datalink.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function isodata(ds::Vector{DataLink})
mc = mean_and_std(dists, 2)
ndists = (dists .- mc[1]) ./ mc[2]

data = mapreduce((x,y)->hcat.(x,y), 1:length(inds1)) do i
data = mapreduce(ISOKANN.joindata, 1:length(inds1)) do i
rng = inds1[i]:inds2[i]
ISOKANN.data_from_trajectory(@view(ndists[:, rng]); reverse)
end
Expand Down

0 comments on commit 2dcd5b6

Please sign in to comment.