Skip to content

Commit

Permalink
flatten the ligandmpnn flder (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
zachcp authored Dec 20, 2024
1 parent f1d94bb commit 00059e9
Show file tree
Hide file tree
Showing 16 changed files with 45 additions and 41 deletions.
2 changes: 1 addition & 1 deletion ferritin-plms/src/amplify/amplify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,4 @@ impl AMPLIFY {
Tokenizer::from_bytes(tokenizer_bytes)
.map_err(|e| candle_core::Error::Msg(format!("Failed to load tokenizer: {}", e)))
}
}
}
2 changes: 1 addition & 1 deletion ferritin-plms/src/amplify/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ pub mod encoder;
pub mod outputs;
pub mod rotary;
// pub mod loss;
//
//
9 changes: 5 additions & 4 deletions ferritin-plms/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ pub use amplify::config::AMPLIFYConfig;
pub use amplify::outputs::ModelOutput;
pub use esm::models::esmc::{ESMCConfig, ESMC};
pub use esm2::models::esm2::{ESM2Config, ESM2};
pub use ligandmpnn::ligandmpnn::configs::ProteinMPNNConfig;
pub use ligandmpnn::ligandmpnn::model::ProteinMPNN;
pub use ligandmpnn::ligandmpnn::proteinfeatures::LMPNNFeatures;
pub use ligandmpnn::configs::ProteinMPNNConfig;
pub use ligandmpnn::model::ProteinMPNN;
pub use ligandmpnn::proteinfeatures::LMPNNFeatures;

pub mod amplify;
//pub mod amplify;
pub mod esm;
pub mod esm2;
pub mod ligandmpnn;
mod amplify;
22 changes: 22 additions & 0 deletions ferritin-plms/src/ligandmpnn/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,25 @@

The initial development sought to create a CLI-equivalent for LigandmMPNN. As of Dec 16 2024, I am no longer pursuing that effort. I'm leavin ghte code here
as an artifact in case it becomes interesting again.


# LigandMPNN-Rust

Rust port of Ligand MPNN.


```sh
bash get_model_params.sh "./model_params"
python scripts/convert_to_safetensor.py
python scripts/convert_to_json.py
#cargo install json_to_rust
#json_to_rust data/pdb_data.json > src/proteintypes.rs
#cat data/pdb_data.json| json_to_rust -j json_object -n MyStruct > out.rs
npm install -g quicktype
quicktype data/pdb_data.json -o output.rs -l rust
```

## Resources

- [Candle](https://github.com/huggingface/candle)
- [Candle Tutorial](https://github.com/ToluClassics/candle-tutorial)
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
//!
//! ** work in progress **
//!
use super::commands;
use super::ligandmpnn::configs::{
use crate::ligandmpnn::commands;
use crate::ligandmpnn::configs::{
AABiasConfig, LigandMPNNConfig, MembraneMPNNConfig, ModelTypes, MultiPDBConfig, ResidueControl,
RunConfig,
};
Expand Down
2 changes: 1 addition & 1 deletion ferritin-plms/src/ligandmpnn/commands/featurize.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::ligandmpnn::ligandmpnn::proteinfeatures::LMPNNFeatures;
use crate::ligandmpnn::proteinfeatures::LMPNNFeatures;
use candle_core;
use ferritin_core::AtomCollection;
use pdbtbx;
Expand Down
1 change: 1 addition & 0 deletions ferritin-plms/src/ligandmpnn/commands/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pub mod featurize;
pub mod run;
mod cli;
3 changes: 2 additions & 1 deletion ferritin-plms/src/ligandmpnn/commands/run.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::ligandmpnn::ligandmpnn::configs::{

use crate::ligandmpnn::configs::{
AABiasConfig, LigandMPNNConfig, MPNNExecConfig, MembraneMPNNConfig, ModelTypes, MultiPDBConfig,
ResidueControl, RunConfig,
};
Expand Down
File renamed without changes.
20 changes: 0 additions & 20 deletions ferritin-plms/src/ligandmpnn/ligandmpnn/Readme.md

This file was deleted.

5 changes: 0 additions & 5 deletions ferritin-plms/src/ligandmpnn/ligandmpnn/mod.rs

This file was deleted.

14 changes: 9 additions & 5 deletions ferritin-plms/src/ligandmpnn/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
//! - utilities to convert sequence formats (PDB; mmcif) to ML-ready tensors.
//! - CLI to handle the above.
//!
mod cli;
mod commands;
pub mod ligandmpnn;

pub use ligandmpnn::proteinfeatures::LMPNNFeatures;
pub use ligandmpnn::model::ProteinMPNN;
pub use ligandmpnn::configs::ProteinMPNNConfig;
pub mod configs;
pub mod proteinfeatures;
pub mod model;
mod proteinfeaturesmodel;
mod utilities;

pub use proteinfeatures::LMPNNFeatures;
pub use model::ProteinMPNN;
pub use configs::ProteinMPNNConfig;
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ define_residues! {
#[cfg(test)]
mod tests {
use super::*;
use crate::ligandmpnn::ligandmpnn::proteinfeatures::LMPNNFeatures;
use crate::ligandmpnn::proteinfeatures::LMPNNFeatures;
use ferritin_core::AtomCollection;
use ferritin_test_data::TestFile;
use pdbtbx;
Expand Down

0 comments on commit 00059e9

Please sign in to comment.