Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dorado ability to use Remora model trained on multiple motifs of the same canonical base #490

Open
Mathias-Boulanger opened this issue Nov 29, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@Mathias-Boulanger
Copy link

Mathias-Boulanger commented Nov 29, 2023

Dear Dorado developer team,

We are currently calling methylation using Remora homemade trained models and bonito base caller. We would like to switch for Dorado for production mainly due to the huge increase in the speed of the algorithm.
However, we are using pytorch Remora models trained to detect methylation on CG and GC contexts which is impossible so far to convert into a single model compatible with Dorado (see error log below).
As already discuss in this Remora issue, it would be a nice improvement of Dorado to be able to handle this kind of model. Especially for researchers that would like to finely tune models for their purpose.

Do you think this is visible in the future releases?
Is that possible to use two models simultaneously with Dorado trained separately for different motifs on the same canonical base?

Thank you for your help.

Error log

remora model export train_results_CpG_GpC/model_best.pt [email protected]_5mC_CG_GC_krebsLab@v1           
[23:10:57.468] Loading model                                                                                                                                            
[23:10:57.726] Loaded a torchscript model                                                                                                                               
[23:10:57.727] Exporting model to dorado format                                                                                                                         
[23:10:57.921] [email protected]_5mC_CG_GC_krebsLab@v1/sig_conv1.weight.tensor                            
[23:10:57.928] [email protected]_5mC_CG_GC_krebsLab@v1/sig_conv1.bias.tensor                              
[23:10:57.936] [email protected]_5mC_CG_GC_krebsLab@v1/sig_conv2.weight.tensor                            
[23:10:57.942] [email protected]_5mC_CG_GC_krebsLab@v1/sig_conv2.bias.tensor                              
[23:10:57.949] [email protected]_5mC_CG_GC_krebsLab@v1/sig_conv3.weight.tensor                            
[23:10:57.954] [email protected]_5mC_CG_GC_krebsLab@v1/sig_conv3.bias.tensor                              
[23:10:57.961] [email protected]_5mC_CG_GC_krebsLab@v1/seq_conv1.weight.tensor                            
[23:10:57.966] [email protected]_5mC_CG_GC_krebsLab@v1/seq_conv1.bias.tensor                              
[23:10:57.973] [email protected]_5mC_CG_GC_krebsLab@v1/seq_conv2.weight.tensor                            
[23:10:57.979] [email protected]_5mC_CG_GC_krebsLab@v1/seq_conv2.bias.tensor                              
[23:10:57.998] [email protected]_5mC_CG_GC_krebsLab@v1/merge_conv1.weight.tensor                          
[23:10:58.004] [email protected]_5mC_CG_GC_krebsLab@v1/merge_conv1.bias.tensor                            
[23:10:58.012] [email protected]_5mC_CG_GC_krebsLab@v1/lstm1.weight_ih_l0.tensor                          
[23:10:58.018] [email protected]_5mC_CG_GC_krebsLab@v1/lstm1.weight_hh_l0.tensor                          
[23:10:58.024] [email protected]_5mC_CG_GC_krebsLab@v1/lstm1.bias_ih_l0.tensor                            
[23:10:58.030] [email protected]_5mC_CG_GC_krebsLab@v1/lstm1.bias_hh_l0.tensor                            
[23:10:58.036] [email protected]_5mC_CG_GC_krebsLab@v1/lstm2.weight_ih_l0.tensor                          
[23:10:58.042] [email protected]_5mC_CG_GC_krebsLab@v1/lstm2.weight_hh_l0.tensor                          
[23:10:58.048] [email protected]_5mC_CG_GC_krebsLab@v1/lstm2.bias_ih_l0.tensor                            
[23:10:58.054] [email protected]_5mC_CG_GC_krebsLab@v1/lstm2.bias_hh_l0.tensor                            
[23:10:58.060] [email protected]_5mC_CG_GC_krebsLab@v1/fc.weight.tensor                                   
[23:10:58.091] [email protected]_5mC_CG_GC_krebsLab@v1/fc.bias.tensor                                     
[23:10:58.103] [email protected]_5mC_CG_GC_krebsLab@v1/refine_kmer_levels.tensor                          
Traceback (most recent call last):                                                                                                                                      
  File "/miniconda3/envs/remora_train/bin/remora", line 8, in <module>                                                                                
    sys.exit(run())                                                                                                                                                     
  File "/miniconda3/envs/remora_train/lib/python3.10/site-packages/remora/main.py", line 71, in run                                                   
    cmd_func(args)                                                                                                                                                      
  File "miniconda3/envs/remora_train/lib/python3.10/site-packages/remora/parsers.py", line 939, in run_model_export                                  
    export_model_dorado(ckpt, model, args.output_path)                                                                                                                  
  File "/miniconda3/envs/remora_train/lib/python3.10/site-packages/remora/model_util.py", line 213, in export_model_dorado                            
    raise RemoraError("Dorado only supports models with a single motif")                                                                                                
remora.RemoraError: Dorado only supports models with a single motif 
@vellamike
Copy link
Collaborator

Hi @Mathias-Boulanger, thank you for the feedback - It will be possible for us to add this feature to Dorado (supporting multiple motifs for the same model). We will add it to Dorado for a future release.

@HalfPhoton HalfPhoton added the enhancement New feature or request label Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants