Skip to content

Commit d38dc25

Browse files
committed
Rename package to ESMFold
1 parent b07424b commit d38dc25

File tree

9 files changed

+44
-47
lines changed

9 files changed

+44
-47
lines changed

.github/workflows/CI.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@ jobs:
6161
shell: julia --project=docs --color=yes {0}
6262
run: |
6363
using Documenter: DocMeta, doctest
64-
using ESMEmbed
65-
DocMeta.setdocmeta!(ESMEmbed, :DocTestSetup, :(using ESMEmbed); recursive=true)
66-
doctest(ESMEmbed)
64+
using ESMFold
65+
DocMeta.setdocmeta!(ESMFold, :DocTestSetup, :(using ESMFold); recursive=true)
66+
doctest(ESMFold)

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name = "ESMEmbed"
2-
uuid = "92fcdd77-1b6e-4cb4-a5ce-af12488bb353"
1+
name = "ESMFold"
2+
uuid = "992ade7d-a23b-44e1-bfa9-f18d3a6e7567"
33
authors = ["Ben Murrell"]
44
version = "1.0.0-DEV"
55

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ A Julia port of the **full ESMFold model**: ESM2 embeddings + folding trunk + st
44
This repo runs end‑to‑end folding on CPU, and will run on GPU when you move the model/tensors
55
to the GPU.
66

7-
Note: the module name is currently `ESMEmbed` for compatibility.
8-
97
## Quickstart (single sequence)
108

119
```julia
12-
using ESMEmbed
10+
using ESMFold
1311

1412
# Download weights from Hugging Face and build the full folding model
1513
model = load_ESMFold()
@@ -25,7 +23,7 @@ println(pdb)
2523
## Batch Folding
2624

2725
```julia
28-
using ESMEmbed
26+
using ESMFold
2927

3028
model = load_ESMFold()
3129
seqs = ["ELLKKLLEELKG", "ACDEFGHIKLMNPQRSTVWY"]

docs/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[deps]
22
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3-
ESMEmbed = "92fcdd77-1b6e-4cb4-a5ce-af12488bb353"
3+
ESMFold = "992ade7d-a23b-44e1-bfa9-f18d3a6e7567"

docs/make.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
using ESMEmbed
1+
using ESMFold
22
using Documenter
33

4-
DocMeta.setdocmeta!(ESMEmbed, :DocTestSetup, :(using ESMEmbed); recursive=true)
4+
DocMeta.setdocmeta!(ESMFold, :DocTestSetup, :(using ESMFold); recursive=true)
55

66
makedocs(;
7-
modules=[ESMEmbed],
7+
modules=[ESMFold],
88
authors="Ben Murrell",
9-
sitename="ESMEmbed.jl",
9+
sitename="ESMFold.jl",
1010
format=Documenter.HTML(;
11-
canonical="https://MurrellGroup.github.io/ESMEmbed.jl",
11+
canonical="https://MurrellGroup.github.io/ESMFold.jl",
1212
edit_link="main",
1313
assets=String[],
1414
),
@@ -18,6 +18,6 @@ makedocs(;
1818
)
1919

2020
deploydocs(;
21-
repo="github.com/MurrellGroup/ESMEmbed.jl",
21+
repo="github.com/MurrellGroup/ESMFold.jl",
2222
devbranch="main",
2323
)

docs/src/index.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,41 @@
11
```@meta
2-
CurrentModule = ESMEmbed
2+
CurrentModule = ESMFold
33
```
44

5-
# ESMEmbed
5+
# ESMFold
66

7-
A lightweight Julia port of the ESMFold sequence embedding stack.
7+
A Julia port of the **full ESMFold model**: ESM2 embeddings + folding trunk + structure module.
88

99
## Quickstart
1010

1111
```julia
12-
using ESMEmbed
12+
using ESMFold
1313

14-
model = load_ESM()
15-
emb = model("ACDEFGHIK")
14+
model = load_ESMFold()
15+
output = infer(model, "ACDEFGHIK")
16+
pdb = output_to_pdb(output)[1]
1617
```
1718

1819
## Outputs
1920

20-
The embedding output is returned in **C × L × B** order (Julia‑native layout):
21+
`infer` returns a dictionary with structure + confidence outputs, including:
2122

22-
- `C` = embedding width (`c_s`, typically 384)
23-
- `L` = sequence length (after padding)
24-
- `B` = batch size
23+
- `positions`, `frames`, `angles`, `states`
24+
- `plddt`, `mean_plddt`, `ptm`, and `predicted_aligned_error`
2525

26-
If you request pair features with `return_pair=true` and `use_esm_attn_map=true`, the
27-
pair tensor is returned as **C_z × L × L × B**. Otherwise `pair = nothing`.
26+
Use `output_to_pdb` to export PDBs.
2827

2928
## Input Modes
3029

3130
- `AbstractMatrix{Int}` shaped `(B, L)`
3231
- `Vector{Vector{Int}}` (auto‑padded)
3332
- `Vector{String}` or a single `String`
3433

35-
See the README for more usage examples.
34+
See the README for more usage examples and batch folding.
3635

3736
```@index
3837
```
3938

4039
```@autodocs
41-
Modules = [ESMEmbed]
40+
Modules = [ESMFold]
4241
```

scripts/test.jl

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using Pkg
22
Pkg.activate(joinpath(@__DIR__, ".."); io=devnull)
33

4-
using ESMEmbed
4+
using ESMFold
55

66
seq = "ELLKKLLEELKG"
77
expected_path = joinpath(@__DIR__, "output_ELLKKLLEELKG.pdb")
@@ -10,7 +10,7 @@ generated_path = joinpath(@__DIR__, "output_ELLKKLLEELKG.generated.pdb")
1010
function _load_model()
1111
weights_path = joinpath(@__DIR__, "..", "weights", "esm.safetensors")
1212
if isfile(weights_path)
13-
reader = ESMEmbed.SafeTensors.Reader(weights_path)
13+
reader = ESMFold.SafeTensors.Reader(weights_path)
1414
(
1515
num_layers,
1616
embed_dim,
@@ -22,18 +22,18 @@ function _load_model()
2222
position_bins,
2323
num_blocks,
2424
lddt_head_hid_dim,
25-
) = ESMEmbed._infer_esmfold_full_config(reader)
25+
) = ESMFold._infer_esmfold_full_config(reader)
2626

27-
alphabet = ESMEmbed.Alphabet_from_architecture("ESM-1b")
28-
esm = ESMEmbed.ESM2(
27+
alphabet = ESMFold.Alphabet_from_architecture("ESM-1b")
28+
esm = ESMFold.ESM2(
2929
num_layers,
3030
embed_dim,
3131
attention_heads;
3232
alphabet = alphabet,
3333
token_dropout = true,
3434
)
3535

36-
trunk_cfg = ESMEmbed.FoldingTrunkConfig(
36+
trunk_cfg = ESMFold.FoldingTrunkConfig(
3737
num_blocks,
3838
c_s,
3939
c_z,
@@ -45,21 +45,21 @@ function _load_model()
4545
false,
4646
4,
4747
nothing,
48-
ESMEmbed.StructureModuleConfig(),
48+
ESMFold.StructureModuleConfig(),
4949
)
5050

51-
cfg = ESMEmbed.ESMFoldConfig(; trunk=trunk_cfg, lddt_head_hid_dim=lddt_head_hid_dim, use_esm_attn_map=false)
52-
model = ESMEmbed.ESMFold(esm; cfg=cfg)
53-
ESMEmbed.load_esmfold_safetensors!(model, reader)
51+
cfg = ESMFold.ESMFoldConfig(; trunk=trunk_cfg, lddt_head_hid_dim=lddt_head_hid_dim, use_esm_attn_map=false)
52+
model = ESMFold.ESMFold(esm; cfg=cfg)
53+
ESMFold.load_esmfold_safetensors!(model, reader)
5454
return model
5555
end
5656

57-
return ESMEmbed.load_ESMFold()
57+
return ESMFold.load_ESMFold()
5858
end
5959

6060
model = _load_model()
61-
output = ESMEmbed.infer(model, seq)
62-
pdb = ESMEmbed.output_to_pdb(output)[1]
61+
output = ESMFold.infer(model, seq)
62+
pdb = ESMFold.output_to_pdb(output)[1]
6363
open(generated_path, "w") do io
6464
write(io, pdb)
6565
end
@@ -81,7 +81,7 @@ if expected != pdb
8181
error("PDB does not match expected output.")
8282
end
8383

84-
metrics = ESMEmbed.confidence_metrics(output)
84+
metrics = ESMFold.confidence_metrics(output)
8585
println("PDB matches: ", expected_path)
8686
println("mean_plddt: ", metrics.mean_plddt)
8787
println("ptm: ", metrics.ptm)

src/ESMEmbed.jl renamed to src/ESMFold.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module ESMEmbed
1+
module ESMFold
22

33
using LinearAlgebra
44
using Statistics

test/runtests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using Test
2-
using ESMEmbed
2+
using ESMFold
33

44
@testset "Alphabet" begin
55
alphabet = Alphabet_from_architecture("ESM-1b")
@@ -15,7 +15,7 @@ end
1515

1616
@testset "Padding helper" begin
1717
seqs = [[0, 1, 2], [3]]
18-
aa, mask = ESMEmbed._pad_batch(seqs; pad_value = 0)
18+
aa, mask = ESMFold._pad_batch(seqs; pad_value = 0)
1919
@test size(aa) == (2, 3)
2020
@test size(mask) == (2, 3)
2121
@test aa[2, 2] == 0

0 commit comments

Comments
 (0)