Code Monkey home page Code Monkey logo

flowsite's Introduction

๐Ÿ‘‹ Feel free to reach out to me about any project!

I am happy to chat about research or anything else. Find my email and other ways to reach me on my website!

flowsite's People

Contributors

hannesstark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

flowsite's Issues

About the processed data

Hi Hannes!

Your work is exciting and we want to follow up.
But the link of the processed data (pdbbind-zenodo) seems to be broken recently.

Could you please help to fix it?

Looking forward to your reply.

Issues with the options --wandb, --ns 48 --nv 12, and with the GPU version of torch

Amazing Job Hannes!

I tried to test the code with the linked packages installed via "pip", but there are some issues on some options:

  1. Activating the -wandb option, it tells that wandb has to be inizialized first (I thought that it may expect a training step before inference from provided weights)

File "/home/marco/miniconda3/envs/flowsite/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/home/marco/miniconda3/envs/flowsite/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/marco/Scrivania/FlowSite/inference.py", line 75, in
main_function()
File "/home/marco/Scrivania/FlowSite/inference.py", line 69, in main_function
if args.wandb: wandb.log({'numel': numel, 'trainer/global_step': 0})
File "/home/marco/miniconda3/envs/flowsite/lib/python3.10/site-packages/wandb/sdk/lib/preinit.py", line 36, in preinit_wrapper
raise wandb.Error(f"You must call wandb.init() before {name}()")
wandb.errors.Error: You must call wandb.init() before wandb.log()

  1. The options --ns 48 and --nv 12 raised many model shape errors (i.e., "copying a param with shape torch.Size([128, 96]) from checkpoint, the shape in current model is torch.Size([128, 144])"). Using --ns 32 and --nv 8, as in the training script, solved the problem

  2. The CUDA GPU is detected, but the following torch problem was raised:


File "/home/marco/miniconda3/envs/flowsite/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/home/marco/miniconda3/envs/flowsite/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/marco/Scrivania/FlowSite/inference.py", line 76, in
main_function()
File "/home/marco/Scrivania/FlowSite/inference.py", line 73, in main_function
trainer.predict(model=model_module, dataloaders=predict_loader, ckpt_path=args.checkpoint)
File "/home/marco/miniconda3/envs/flowsite/lib/python3.10/site-packages/lightning/pytorch/trainer/trainer.py", line 865, in predict
return call._call_and_handle_interrupt(
File "/home/marco/miniconda3/envs/flowsite/lib/python3.10/site-packages/lightning/pytorch/trainer/call.py", line 44, in _call_and_handle_interrupt
return trainer_fn(*args, **kwargs)
File "/home/marco/miniconda3/envs/flowsite/lib/python3.10/site-packages/lightning/pytorch/trainer/trainer.py", line 904, in _predict_impl
results = self._run(model, ckpt_path=ckpt_path)
File "/home/marco/miniconda3/envs/flowsite/lib/python3.10/site-packages/lightning/pytorch/trainer/trainer.py", line 990, in _run
results = self._run_stage()
File "/home/marco/miniconda3/envs/flowsite/lib/python3.10/site-packages/lightning/pytorch/trainer/trainer.py", line 1031, in _run_stage
return self.predict_loop.run()
File "/home/marco/miniconda3/envs/flowsite/lib/python3.10/site-packages/lightning/pytorch/loops/utilities.py", line 181, in _decorator
return loop_run(self, *args, **kwargs)
File "/home/marco/miniconda3/envs/flowsite/lib/python3.10/site-packages/lightning/pytorch/loops/prediction_loop.py", line 122, in run
self._predict_step(batch, batch_idx, dataloader_idx, dataloader_iter)
File "/home/marco/miniconda3/envs/flowsite/lib/python3.10/site-packages/lightning/pytorch/loops/prediction_loop.py", line 250, in _predict_step
predictions = call._call_strategy_hook(trainer, "predict_step", *step_args)
File "/home/marco/miniconda3/envs/flowsite/lib/python3.10/site-packages/lightning/pytorch/trainer/call.py", line 309, in _call_strategy_hook
output = fn(*args, **kwargs)
File "/home/marco/miniconda3/envs/flowsite/lib/python3.10/site-packages/lightning/pytorch/strategies/strategy.py", line 429, in predict_step
return self.lightning_module.predict_step(*args, **kwargs)
File "/home/marco/Scrivania/FlowSite/lightning_modules/flowsite_module.py", line 510, in predict_step
designed_seqs.append([np.array(RESTYPES)[designed_seq.cpu().numpy()][torch.where(full_prot_bid == i)] for i in range(len(batch.pdb_id))])
File "/home/marco/Scrivania/FlowSite/lightning_modules/flowsite_module.py", line 510, in
designed_seqs.append([np.array(RESTYPES)[designed_seq.cpu().numpy()][torch.where(full_prot_bid == i)] for i in range(len(batch.pdb_id))])
File "/home/marco/miniconda3/envs/flowsite/lib/python3.10/site-packages/torch/_tensor.py", line 1030, in array
return self.numpy()
TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first

The CPU version of torch works fine

pocket_residue_cutoff needed to run examples

Hi,

First of all, thanks for the code, it is very cool!

I was tyring to run the examples you provide in the repo:

CUDA_VISIBLE_DEVICES="0" python -m inference --num_inference 10 --out_dir data/inference_out --csv_file data/inference_csv_example.csv --batch_size 16 --checkpoint pocket_gen/lf5t55w4/checkpoints/best.ckpt --run_test --run_name inference1 --wandb  --layer_norm --fake_constant_dur 100000 --fake_decay_dur 10 --fake_ratio_start 0.2 --fake_ratio_end 0.2 --residue_loss_weight 0.2 --use_tfn --use_inv --time_condition_tfn --correct_time_condition --time_condition_inv --time_condition_repeat --flow_matching --flow_matching_sigma 0.5 --prior_scale 1 --num_angle_pred 5 --ns 48 --nv 12 --batch_norm --self_condition_x --self_condition_inv --no_tfn_self_condition_inv --self_fancy_init

And:

CUDA_VISIBLE_DEVICES="0" python -m inference --num_inference 10 --out_dir data/inference_out2 --design_residues "A60-65,A232,A233,A212-215,A325" --ligand data/2fc2_HEM_HBI_HAR_NO.mol2 --protein data/2fc2_unit1_protein.pdb --batch_size 16 --pocket_def_ligand data/2fc2_HEM_HBI_HAR_NO.mol2 --checkpoint pocket_gen/lf5t55w4/checkpoints/best.ckpt --run_test --run_name inference1 --wandb  --layer_norm --fake_constant_dur 100000 --fake_decay_dur 10 --fake_ratio_start 0.2 --fake_ratio_end 0.2 --residue_loss_weight 0.2 --use_tfn --use_inv --time_condition_tfn --correct_time_condition --time_condition_inv --time_condition_repeat --flow_matching --flow_matching_sigma 0.5 --prior_scale 1 --num_angle_pred 5 --ns 48 --nv 12 --batch_norm --self_condition_x --self_condition_inv --no_tfn_self_condition_inv --self_fancy_init

However, both error with the following message:

  File "/home/michaelcarter/DD_tools/FlowSite/datasets/inference_dataset.py", line 106, in get
    assert self.args.pocket_residue_cutoff is not None, 'distance pocket requires a pocket_resiudue_cutoff'
AssertionError: distance pocket requires a pocket_resiudue_cutoff

To solve this, I needed to set a --pocket_residue_cutoff 8 in order for the examples to run. Out of curisoity is 8 the minimum cutoff value? As when I try to set it lower it seems to fail.

Many Thanks,
Mike

error when loading model

Hi Hannes,

There is an error when running the test code (the recently released version) of FlowSite as follows:

RuntimeError: Error(s) in loading state_dict for FlowSiteModule:
        Missing key(s) in state_dict: "model.inv_embedder.virtual_atoms"

I think this may be caused by the modification of model codes in the recently released version.
And the first version of your code works well.

Not an issue but is there a way to output sidechain conformation to visualize the prediction?

Hi Stark,

Thank you for the amazing work! I have been using your work for my job of redesigning an enzyme active site. I watched your youtube video explaining FlowSite and that was helpful too but I am having trouble interpreting the result since there is no output structure to understand the conformation of the ligand and the residues around it. In the youtube video and the paper you had some figures that illustrates the output therefore I am asking how did you come up with that?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.