Skip to content

Commit d6cb0e0

Browse files
committed
Add ProteinMPNN support and tests
1 parent af5fc05 commit d6cb0e0

File tree

3 files changed

+75
-4
lines changed

3 files changed

+75
-4
lines changed

src/executor.rs

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,27 @@ pub fn run(
128128
Image("rosettacommons/rfdiffusion".into()),
129129
{
130130
//app_args.insert(0, "inference.output_prefix=/w".into()); // /motifscaffolding
131-
app_args.extend([
132-
"inference.output_prefix=/w/".into(),
133-
"inference.model_directory_path=/app/RFdiffusion/models".into(),
134-
]);
131+
app_args.splice(
132+
0..0,
133+
[
134+
"inference.output_prefix=/w/".into(),
135+
"inference.model_directory_path=/app/RFdiffusion/models".into(),
136+
],
137+
);
135138
app_args
136139
},
137140
Some("/app/RFdiffusion/schedules".into()),
138141
),
142+
143+
App::Proteinmpnn => (
144+
Image("rosettacommons/proteinmpnn".into()),
145+
{
146+
//app_args.extend(["--out_folder=/w/".into()]);
147+
app_args.splice(0..0, ["--out_folder=/w/".into()]);
148+
app_args
149+
},
150+
None,
151+
),
139152
//_ => todo!(),
140153
};
141154

src/main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ enum App {
8585
/// Run the RFdiffusion command https://github.com/RosettaCommons/RFdiffusion
8686
#[value(aliases = ["Rfdiffusion"])]
8787
Rfdiffusion,
88+
89+
/// Run the RFdiffusion command https://github.com/RosettaCommons/RFdiffusion
90+
#[value(aliases = ["ProteinMPNN"])]
91+
Proteinmpnn,
8892
}
8993

9094
fn main() -> Result<()> {

tests/proteinmpnn.rs

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
use assert_cmd::{assert::OutputAssertExt, cargo::cargo_bin_cmd};
2+
use assert_fs::TempDir;
3+
4+
mod common;
5+
6+
common::engine_tests!(proteinmpnn);
7+
8+
fn proteinmpnn(engine: &str) {
9+
use assert_fs::assert::PathAssert;
10+
11+
let root = std::path::PathBuf::from("target/proteinmpnn").join(engine);
12+
std::fs::create_dir_all(&root).expect("create engine testing dir");
13+
let work_dir = TempDir::new_in(root).expect("create temp dir");
14+
15+
let pdb_id = "3htn";
16+
let pdb_file = pdb_id.to_string() + ".pdb";
17+
18+
let pdb_path = work_dir.path().join(&pdb_file);
19+
std::fs::write(
20+
pdb_path,
21+
reqwest::blocking::get(format!("https://files.rcsb.org/download/{pdb_file}"))
22+
.unwrap()
23+
.bytes()
24+
.unwrap(),
25+
)
26+
.unwrap();
27+
28+
let cmd = cargo_bin_cmd!()
29+
.args([
30+
"run",
31+
"--container-engine",
32+
engine,
33+
"-w",
34+
work_dir.path().to_str().unwrap(),
35+
"proteinmpnn",
36+
"--pdb_path",
37+
&pdb_file,
38+
"--pdb_path_chains",
39+
"A B",
40+
])
41+
.unwrap();
42+
cmd.assert().success();
43+
44+
use assert_fs::prelude::PathChild;
45+
46+
work_dir
47+
.child(".0000.rc.log")
48+
.assert(predicates::path::exists());
49+
50+
let o_pdb = work_dir.child("seqs/3htn.fa");
51+
o_pdb.assert(predicates::path::exists());
52+
53+
// std::thread::sleep(std::time::Duration::from_secs(60));
54+
}

0 commit comments

Comments
 (0)