WryBin / DRECT

3 stars 0 forks source link

Question from the DRILT reviewer #1

Closed DRILTreviewer closed 11 months ago

DRILTreviewer commented 1 year ago

Hello,

I am reviewing your paper entitled: "High-quality Reconstruction for Laplace NMR based on Deep Learning" I think, it is a beautiful and well-documented work and I think, that the paper could be accepted with very minor changes. However, I am not able to run the code. I have to test it before I provide a verdict. The instructions on github (https://github.com/WryBin/DRILT) allow me to create a virtual environment and run Test.ipynb but it crashes with the message below. The same happens on nmrbox. Could you help to solve this? I would recommend to make instructions how to make the program run on nmrbox.org platform (create venv and so on...). Many NMR users perform processing on nmrbox and having it there would make your program popular.


UnpicklingError Traceback (most recent call last) Input In [2], in <cell line: 7>() 15 else: 16 with torch.no_grad(): ---> 17 module = Transformer.load_from_checkpoint("Result/DOSY/last.ckpt") 18 module.cpu() 19 module.eval()

File myvenv/lib/python3.9/site-packages/pytorch_lightning/core/saving.py:134, in ModelIO.load_from_checkpoint(cls, checkpoint_path, map_location, hparams_file, strict, **kwargs) 132 checkpoint = pl_load(checkpoint_path, map_location=map_location) 133 else: --> 134 checkpoint = pl_load(checkpoint_path, map_location=lambda storage, loc: storage) 136 if hparams_file is not None: 137 extension = hparams_file.split(".")[-1]

File myvenv/lib/python3.9/site-packages/pytorch_lightning/utilities/cloud_io.py:38, in load(path_or_url, map_location) 36 fs = get_filesystem(path_or_url) 37 with fs.open(path_or_url, "rb") as f: ---> 38 return torch.load(f, map_location=map_location)

File myvenv/lib/python3.9/site-packages/torch/serialization.py:713, in load(f, map_location, pickle_module, pickle_load_args) 711 return torch.jit.load(opened_file) 712 return _load(opened_zipfile, map_location, pickle_module, pickle_load_args) --> 713 return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)

File myvenv/lib/python3.9/site-packages/torch/serialization.py:920, in _legacy_load(f, map_location, pickle_module, pickle_load_args) 914 if not hasattr(f, 'readinto') and (3, 8, 0) <= sys.version_info < (3, 8, 2): 915 raise RuntimeError( 916 "torch.load does not work with file-like objects that do not implement readinto on Python 3.8.0 and 3.8.1. " 917 f"Received object of type \"{type(f)}\". Please update to Python 3.8.2 or newer to restore this " 918 "functionality.") --> 920 magic_number = pickle_module.load(f, pickle_load_args) 921 if magic_number != MAGIC_NUMBER: 922 raise RuntimeError("Invalid magic number; corrupt file?")

UnpicklingError: invalid load key, 'v'.

WryBin commented 1 year ago

Hello,

I am reviewing your paper entitled: "High-quality Reconstruction for Laplace NMR based on Deep Learning" I think, it is a beautiful and well-documented work and I think, that the paper could be accepted with very minor changes. However, I am not able to run the code. I have to test it before I provide a verdict. The instructions on github (https://github.com/WryBin/DRILT) allow me to create a virtual environment and run Test.ipynb but it crashes with the message below. The same happens on nmrbox. Could you help to solve this? I would recommend to make instructions how to make the program run on nmrbox.org platform (create venv and so on...). Many NMR users perform processing on nmrbox and having it there would make your program popular.

UnpicklingError Traceback (most recent call last) Input In [2], in <cell line: 7>() 15 else: 16 with torch.no_grad(): ---> 17 module = Transformer.load_from_checkpoint("Result/DOSY/last.ckpt") 18 module.cpu() 19 module.eval()

File myvenv/lib/python3.9/site-packages/pytorch_lightning/core/saving.py:134, in ModelIO.load_from_checkpoint(cls, checkpoint_path, map_location, hparams_file, strict, **kwargs) 132 checkpoint = pl_load(checkpoint_path, map_location=map_location) 133 else: --> 134 checkpoint = pl_load(checkpoint_path, map_location=lambda storage, loc: storage) 136 if hparams_file is not None: 137 extension = hparams_file.split(".")[-1]

File myvenv/lib/python3.9/site-packages/pytorch_lightning/utilities/cloud_io.py:38, in load(path_or_url, map_location) 36 fs = get_filesystem(path_or_url) 37 with fs.open(path_or_url, "rb") as f: ---> 38 return torch.load(f, map_location=map_location)

File myvenv/lib/python3.9/site-packages/torch/serialization.py:713, in load(f, map_location, pickle_module, pickle_load_args) 711 return torch.jit.load(opened_file) 712 return _load(opened_zipfile, map_location, pickle_module, pickle_load_args) --> 713 return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)

File myvenv/lib/python3.9/site-packages/torch/serialization.py:920, in _legacy_load(f, map_location, pickle_module, pickle_load_args) 914 if not hasattr(f, 'readinto') and (3, 8, 0) <= sys.version_info < (3, 8, 2): 915 raise RuntimeError( 916 "torch.load does not work with file-like objects that do not implement readinto on Python 3.8.0 and 3.8.1. " 917 f"Received object of type "{type(f)}". Please update to Python 3.8.2 or newer to restore this " 918 "functionality.") --> 920 magic_number = pickle_module.load(f, pickle_load_args) 921 if magic_number != MAGIC_NUMBER: 922 raise RuntimeError("Invalid magic number; corrupt file?")

UnpicklingError: invalid load key, 'v'.

Sorry for the delay in addressing the issue you raised on the GitHub platform. We should have checked the GitHub issues more often, and we will definitely improve that. We are pleased to inform you that we have successfully replicated and resolved the issue. The root cause of the problem was attributed to git-lfs, a service responsible for storing large files. It is very likely that the pre-trained model (e.g., Result/DOSY/last.ckpt, occupying 141 MB) did not download completely to your local machine, which is why you encountered difficulties in running the test.ipynb file. It should be noted that the parameters of the pre-trained neural network are stored in the ckpt file, which is large since the deep neural network usually contains millions (or even more) of parameters. To address this issue, we have taken the necessary steps and uploaded the complete pre-trained model to Google Drive. We recommend that you download the ckpt file again from the new link (https://drive.google.com/drive/folders/1B-OZLdKW9k4eDrqzUU9UySQUqVvSripd?usp=share_link) and replace the incomplete local pre-trained model, such as the "Result/DOSY/last.ckpt" file, to ensure successful execution of the test.ipynb file. Thank you for your recommendations regarding NMRbox, which will help us improve our work. We have already registered an account with NMRbox, and it will take several days for the account to validate. If the registration is successful, we will promptly deploy our code to NMRbox. Thank you for bringing this issue to our attention. Please do not hesitate to contact us with any further questions or concerns. And we will update the information on the GitHub page if we find some better way to resolve the git-lfs issue.

DRILTreviewer commented 1 year ago

Hello,

I am able to run the program now and reproduce your results. Thanks!

However, I don't know how to run it on my own data. The manual says that I have to preprocess it using DOSYtoolbox. I do this and get .nmr file that, however, has different variables...

Could you prepare a step-by-step guide how to deal with .nmr file produced by DOSYtoolbox? Your variables (b, idx_peaks,ppm,S) are not present in their structure.

Thanks in advance for your help!

------- Original Message ------- wtorek, 7 marca 2023 2:37 PM, WryBin @.***> napisał(a):

Hello,

I am reviewing your paper entitled: "High-quality Reconstruction for Laplace NMR based on Deep Learning" I think, it is a beautiful and well-documented work and I think, that the paper could be accepted with very minor changes. However, I am not able to run the code. I have to test it before I provide a verdict. The instructions on github (https://github.com/WryBin/DRILT) allow me to create a virtual environment and run Test.ipynb but it crashes with the message below. The same happens on nmrbox. Could you help to solve this? I would recommend to make instructions how to make the program run on nmrbox.org platform (create venv and so on...). Many NMR users perform processing on nmrbox and having it there would make your program popular.

UnpicklingError Traceback (most recent call last) Input In [2], in <cell line: 7>() 15 else: 16 with torch.no_grad(): ---> 17 module = Transformer.load_from_checkpoint("Result/DOSY/last.ckpt") 18 module.cpu() 19 module.eval()

File myvenv/lib/python3.9/site-packages/pytorch_lightning/core/saving.py:134, in ModelIO.load_from_checkpoint(cls, checkpoint_path, map_location, hparams_file, strict, **kwargs) 132 checkpoint = pl_load(checkpoint_path, map_location=map_location) 133 else: --> 134 checkpoint = pl_load(checkpoint_path, map_location=lambda storage, loc: storage) 136 if hparams_file is not None: 137 extension = hparams_file.split(".")[-1]

File myvenv/lib/python3.9/site-packages/pytorch_lightning/utilities/cloud_io.py:38, in load(path_or_url, map_location) 36 fs = get_filesystem(path_or_url) 37 with fs.open(path_or_url, "rb") as f: ---> 38 return torch.load(f, map_location=map_location)

File myvenv/lib/python3.9/site-packages/torch/serialization.py:713, in load(f, map_location, pickle_module, pickle_load_args) 711 return torch.jit.load(opened_file) 712 return _load(opened_zipfile, map_location, pickle_module, pickle_load_args) --> 713 return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)

File myvenv/lib/python3.9/site-packages/torch/serialization.py:920, in _legacy_load(f, map_location, pickle_module, pickle_load_args) 914 if not hasattr(f, 'readinto') and (3, 8, 0) <= sys.version_info < (3, 8, 2): 915 raise RuntimeError( 916 "torch.load does not work with file-like objects that do not implement readinto on Python 3.8.0 and 3.8.1. " 917 f"Received object of type "{type(f)}". Please update to Python 3.8.2 or newer to restore this " 918 "functionality.") --> 920 magic_number = pickle_module.load(f, pickle_load_args) 921 if magic_number != MAGIC_NUMBER: 922 raise RuntimeError("Invalid magic number; corrupt file?")

UnpicklingError: invalid load key, 'v'.

Sorry for the delay in addressing the issue you raised on the GitHub platform. We should have checked the GitHub issues more often, and we will definitely improve that. We are pleased to inform you that we have successfully replicated and resolved the issue. The root cause of the problem was attributed to git-lfs, a service responsible for storing large files. It is very likely that the pre-trained model (e.g., Result/DOSY/last.ckpt, occupying 141 MB) did not download completely to your local machine, which is why you encountered difficulties in running the test.ipynb file. It should be noted that the parameters of the pre-trained neural network are stored in the ckpt file, which is large since the deep neural network usually contains millions (or even more) of parameters. To address this issue, we have taken the necessary steps and uploaded the complete pre-trained model to Google Drive. We recommend that you download the ckpt file again from the new link (https://drive.google.com/drive/folders/1B-OZLdKW9k4eDrqzUU9UySQUqVvSripd?usp=share_link) and replace the incomplete local pre-trained model, such as the "Result/DOSY/last.ckpt" file, to ensure successful execution of the test.ipynb file. Thank you for your recommendations regarding NMRbox, which will help us improve our work. We have already registered an account with NMRbox, and it will take several days for the account to validate. If the registration is successful, we will promptly deploy our code to NMRbox. Thank you for bringing this issue to our attention. Please do not hesitate to contact us with any further questions or concerns. And we will update the information on the GitHub page if we find some better way to resolve the git-lfs issue.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

WryBin commented 1 year ago

Hello, I am able to run the program now and reproduce your results. Thanks! However, I don't know how to run it on my own data. The manual says that I have to preprocess it using DOSYtoolbox. I do this and get .nmr file that, however, has different variables... Could you prepare a step-by-step guide how to deal with .nmr file produced by DOSYtoolbox? Your variables (b, idx_peaks,ppm,S) are not present in their structure. Thanks in advance for your help! ------- Original Message ------- wtorek, 7 marca 2023 2:37 PM, WryBin @.***> napisał(a):

Hello, > > I am reviewing your paper entitled: "High-quality Reconstruction for Laplace NMR based on Deep Learning" I think, it is a beautiful and well-documented work and I think, that the paper could be accepted with very minor changes. However, I am not able to run the code. I have to test it before I provide a verdict. The instructions on github (https://github.com/WryBin/DRILT) allow me to create a virtual environment and run Test.ipynb but it crashes with the message below. The same happens on nmrbox. Could you help to solve this? I would recommend to make instructions how to make the program run on nmrbox.org platform (create venv and so on...). Many NMR users perform processing on nmrbox and having it there would make your program popular. > > UnpicklingError Traceback (most recent call last) Input In [2], in <cell line: 7>() 15 else: 16 with torch.no_grad(): ---> 17 module = Transformer.load_from_checkpoint("Result/DOSY/last.ckpt") 18 module.cpu() 19 module.eval() > > File myvenv/lib/python3.9/site-packages/pytorch_lightning/core/saving.py:134, in ModelIO.load_from_checkpoint(cls, checkpoint_path, map_location, hparams_file, strict, kwargs) 132 checkpoint = pl_load(checkpoint_path, map_location=map_location) 133 else: --> 134 checkpoint = pl_load(checkpoint_path, map_location=lambda storage, loc: storage) 136 if hparams_file is not None: 137 extension = hparams_file.split(".")[-1] > > File myvenv/lib/python3.9/site-packages/pytorch_lightning/utilities/cloud_io.py:38, in load(path_or_url, map_location) 36 fs = get_filesystem(path_or_url) 37 with fs.open(path_or_url, "rb") as f: ---> 38 return torch.load(f, map_location=map_location) > > File myvenv/lib/python3.9/site-packages/torch/serialization.py:713, in load(f, map_location, pickle_module, pickle_load_args) 711 return torch.jit.load(opened_file) 712 return _load(opened_zipfile, map_location, pickle_module, pickle_load_args) --> 713 return _legacy_load(opened_file, map_location, pickle_module, pickle_load_args) > > File myvenv/lib/python3.9/site-packages/torch/serialization.py:920, in _legacy_load(f, map_location, pickle_module, pickle_load_args) 914 if not hasattr(f, 'readinto') and (3, 8, 0) <= sys.version_info < (3, 8, 2): 915 raise RuntimeError( 916 "torch.load does not work with file-like objects that do not implement readinto on Python 3.8.0 and 3.8.1. " 917 f"Received object of type "{type(f)}". Please update to Python 3.8.2 or newer to restore this " 918 "functionality.") --> 920 magic_number = pickle_module.load(f, pickle_load_args) 921 if magic_number != MAGIC_NUMBER: 922 raise RuntimeError("Invalid magic number; corrupt file?") > > UnpicklingError: invalid load key, 'v'. Sorry for the delay in addressing the issue you raised on the GitHub platform. We should have checked the GitHub issues more often, and we will definitely improve that. We are pleased to inform you that we have successfully replicated and resolved the issue. The root cause of the problem was attributed to git-lfs, a service responsible for storing large files. It is very likely that the pre-trained model (e.g., Result/DOSY/last.ckpt, occupying 141 MB) did not download completely to your local machine, which is why you encountered difficulties in running the test.ipynb file. It should be noted that the parameters of the pre-trained neural network are stored in the ckpt file, which is large since the deep neural network usually contains millions (or even more) of parameters. To address this issue, we have taken the necessary steps and uploaded the complete pre-trained model to Google Drive. We recommend that you download the ckpt file again from the new link (https://drive.google.com/drive/folders/1B-OZLdKW9k4eDrqzUU9UySQUqVvSripd?usp=share_link) and replace the incomplete local pre-trained model, such as the "Result/DOSY/last.ckpt" file, to ensure successful execution of the test.ipynb file. Thank you for your recommendations regarding NMRbox, which will help us improve our work. We have already registered an account with NMRbox, and it will take several days for the account to validate. If the registration is successful, we will promptly deploy our code to NMRbox. Thank you for bringing this issue to our attention. Please do not hesitate to contact us with any further questions or concerns. And we will update the information on the GitHub page if we find some better way to resolve the git-lfs issue. — Reply to this email directly, [view it on GitHub](#1 (comment)), or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

Hello,

Regarding the NMR files, we usually modify their suffix to ".mat" (or directly export the .mat file from DOSYToolbox) and process them using the "Solve_data.m" file located in the specific folder (e.g., DRILT/MATLAB/Data/GSP/Solve_data.m). Currently, only the GSP, QGC, and VD folders contain pre-processing code. Regrettably, we are unable to publicly provide code for other data due to our lack of authorization. Therefore, for these particular data, we have extracted only basic information on variables such as "b," "idx_peaks," "ppm," and "S" to generate result graphs.

Now we upload the generic pre-processing code to Github named "Generic_Solve_data.m" under the folder "DRILT/MATLAB/", which can assist you with data pre-processing and transforming into the network-input style. Additionally, you may choose to download this file through Google Drive(https://drive.google.com/drive/folders/1B-OZLdKW9k4eDrqzUU9UySQUqVvSripd?usp=share_link). To effectively execute this code with your personal data, it is important that you make necessary adjustments to specific parameters, such as the file path.

Thank you for bringing this matter to our attention. Your inquiry has greatly assisted us in improving our code. We are also working on a Python code for pre-processing the NMR data and will update the GitHub page later.

DRILTreviewer commented 1 year ago

Hello,

Thanks. I think I am getting the result now. However, it is not easy to watch it. Could you also prepare a short MATLAB code ploting the resulting Z matrix with a proper scale in ppm (allowing me to compare the result with other programs)

------- Original Message ------- środa, 8 marca 2023 3:08 PM, WryBin @.***> napisał(a):

Hello, I am able to run the program now and reproduce your results. Thanks! However, I don't know how to run it on my own data. The manual says that I have to preprocess it using DOSYtoolbox. I do this and get .nmr file that, however, has different variables... Could you prepare a step-by-step guide how to deal with .nmr file produced by DOSYtoolbox? Your variables (b, idx_peaks,ppm,S) are not present in their structure. Thanks in advance for your help! ------- Original Message ------- wtorek, 7 marca 2023 2:37 PM, WryBin @.***> napisał(a):

Hello, > > I am reviewing your paper entitled: "High-quality Reconstruction for Laplace NMR based on Deep Learning" I think, it is a beautiful and well-documented work and I think, that the paper could be accepted with very minor changes. However, I am not able to run the code. I have to test it before I provide a verdict. The instructions on github (https://github.com/WryBin/DRILT) allow me to create a virtual environment and run Test.ipynb but it crashes with the message below. The same happens on nmrbox. Could you help to solve this? I would recommend to make instructions how to make the program run on nmrbox.org platform (create venv and so on...). Many NMR users perform processing on nmrbox and having it there would make your program popular. > > UnpicklingError Traceback (most recent call last) Input In [2], in <cell line: 7>() 15 else: 16 with torch.no_grad(): ---> 17 module = Transformer.load_from_checkpoint("Result/DOSY/last.ckpt") 18 module.cpu() 19 module.eval() > > File myvenv/lib/python3.9/site-packages/pytorch_lightning/core/saving.py:134, in ModelIO.load_from_checkpoint(cls, checkpoint_path, map_location, hparams_file, strict, kwargs) 132 checkpoint = pl_load(checkpoint_path, map_location=map_location) 133 else: --> 134 checkpoint = pl_load(checkpoint_path, map_location=lambda storage, loc: storage) 136 if hparams_file is not None: 137 extension = hparams_file.split(".")[-1] > > File myvenv/lib/python3.9/site-packages/pytorch_lightning/utilities/cloud_io.py:38, in load(path_or_url, map_location) 36 fs = get_filesystem(path_or_url) 37 with fs.open(path_or_url, "rb") as f: ---> 38 return torch.load(f, map_location=map_location) > > File myvenv/lib/python3.9/site-packages/torch/serialization.py:713, in load(f, map_location, pickle_module, pickle_load_args) 711 return torch.jit.load(opened_file) 712 return _load(opened_zipfile, map_location, pickle_module, pickle_load_args) --> 713 return _legacy_load(opened_file, map_location, pickle_module, pickle_load_args) > > File myvenv/lib/python3.9/site-packages/torch/serialization.py:920, in _legacy_load(f, map_location, pickle_module, *pickle_load_args) 914 if not hasattr(f, 'readinto') and (3, 8, 0) <= sys.version_info < (3, 8, 2): 915 raise RuntimeError( 916 "torch.load does not work with file-like objects that do not implement readinto on Python 3.8.0 and 3.8.1. " 917 f"Received object of type "{type(f)}". Please update to Python 3.8.2 or newer to restore this " 918 "functionality.") --> 920 magic_number = pickle_module.load(f, pickle_load_args) 921 if magic_number != MAGIC_NUMBER: 922 raise RuntimeError("Invalid magic number; corrupt file?") > > UnpicklingError: invalid load key, 'v'. Sorry for the delay in addressing the issue you raised on the GitHub platform. We should have checked the GitHub issues more often, and we will definitely improve that. We are pleased to inform you that we have successfully replicated and resolved the issue. The root cause of the problem was attributed to git-lfs, a service responsible for storing large files. It is very likely that the pre-trained model (e.g., Result/DOSY/last.ckpt, occupying 141 MB) did not download completely to your local machine, which is why you encountered difficulties in running the test.ipynb file. It should be noted that the parameters of the pre-trained neural network are stored in the ckpt file, which is large since the deep neural network usually contains millions (or even more) of parameters. To address this issue, we have taken the necessary steps and uploaded the complete pre-trained model to Google Drive. We recommend that you download the ckpt file again from the new link (https://drive.google.com/drive/folders/1B-OZLdKW9k4eDrqzUU9UySQUqVvSripd?usp=share_link) and replace the incomplete local pre-trained model, such as the "Result/DOSY/last.ckpt" file, to ensure successful execution of the test.ipynb file. Thank you for your recommendations regarding NMRbox, which will help us improve our work. We have already registered an account with NMRbox, and it will take several days for the account to validate. If the registration is successful, we will promptly deploy our code to NMRbox. Thank you for bringing this issue to our attention. Please do not hesitate to contact us with any further questions or concerns. And we will update the information on the GitHub page if we find some better way to resolve the git-lfs issue. — Reply to this email directly, [view it on GitHub](#1 (comment)), or unsubscribe. You are receiving this because you authored the thread.Message ID: @.>

Hello,

Regarding the NMR files, we usually modify their suffix to ".mat" (or directly export the .mat file from DOSYToolbox) and process them using the "Solve_data.m" file located in the specific folder (e.g., DRILT/MATLAB/Data/GSP/Solve_data.m). Currently, only the GSP, QGC, and VD folders contain pre-processing code. Regrettably, we are unable to publicly provide code for other data due to our lack of authorization. Therefore, for these particular data, we have extracted only basic information on variables such as "b," "idx_peaks," "ppm," and "S" to generate result graphs.

Now we upload the generic pre-processing code to Github named "Generic_Solve_data.m" under the folder "DRILT/MATLAB/", which can assist you with data pre-processing and transforming into the network-input style. Additionally, you may choose to download this file through Google Drive(https://drive.google.com/drive/folders/1B-OZLdKW9k4eDrqzUU9UySQUqVvSripd?usp=share_link). To effectively execute this code with your personal data, it is important that you make necessary adjustments to specific parameters, such as the file path.

Thank you for bringing this matter to our attention. Your inquiry has greatly assisted us in improving our code. We are also working on a Python code for pre-processing the NMR data and will update the GitHub page later.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

WryBin commented 1 year ago

Hello, Thanks. I think I am getting the result now. However, it is not easy to watch it. Could you also prepare a short MATLAB code ploting the resulting Z matrix with a proper scale in ppm (allowing me to compare the result with other programs) ------- Original Message ------- środa, 8 marca 2023 3:08 PM, WryBin @.***> napisał(a):

Hello, I am able to run the program now and reproduce your results. Thanks! However, I don't know how to run it on my own data. The manual says that I have to preprocess it using DOSYtoolbox. I do this and get .nmr file that, however, has different variables... Could you prepare a step-by-step guide how to deal with .nmr file produced by DOSYtoolbox? Your variables (b, idx_peaks,ppm,S) are not present in their structure. Thanks in advance for your help! > > ------- Original Message ------- wtorek, 7 marca 2023 2:37 PM, WryBin @.> napisał(a): > >> Hello, > > I am reviewing your paper entitled: "High-quality Reconstruction for Laplace NMR based on Deep Learning" I think, it is a beautiful and well-documented work and I think, that the paper could be accepted with very minor changes. However, I am not able to run the code. I have to test it before I provide a verdict. The instructions on github (https://github.com/WryBin/DRILT) allow me to create a virtual environment and run Test.ipynb but it crashes with the message below. The same happens on nmrbox. Could you help to solve this? I would recommend to make instructions how to make the program run on nmrbox.org platform (create venv and so on...). Many NMR users perform processing on nmrbox and having it there would make your program popular. > > UnpicklingError Traceback (most recent call last) Input In [2], in <cell line: 7>() 15 else: 16 with torch.no_grad(): ---> 17 module = Transformer.load_from_checkpoint("Result/DOSY/last.ckpt") 18 module.cpu() 19 module.eval() > > File myvenv/lib/python3.9/site-packages/pytorch_lightning/core/saving.py:134, in ModelIO.load_from_checkpoint(cls, checkpoint_path, map_location, hparams_file, strict, kwargs) 132 checkpoint = pl_load(checkpoint_path, map_location=map_location) 133 else: --> 134 checkpoint = pl_load(checkpoint_path, map_location=lambda storage, loc: storage) 136 if hparams_file is not None: 137 extension = hparams_file.split(".")[-1] > > File myvenv/lib/python3.9/site-packages/pytorch_lightning/utilities/cloud_io.py:38, in load(path_or_url, map_location) 36 fs = get_filesystem(path_or_url) 37 with fs.open(path_or_url, "rb") as f: ---> 38 return torch.load(f, map_location=map_location) > > File myvenv/lib/python3.9/site-packages/torch/serialization.py:713, in load(f, map_location, pickle_module, pickle_load_args) 711 return torch.jit.load(opened_file) 712 return _load(opened_zipfile, map_location, pickle_module, pickle_load_args) --> 713 return _legacy_load(opened_file, map_location, pickle_module, pickle_load_args) > > File myvenv/lib/python3.9/site-packages/torch/serialization.py:920, in _legacy_load(f, map_location, pickle_module, pickle_load_args) 914 if not hasattr(f, 'readinto') and (3, 8, 0) <= sys.version_info < (3, 8, 2): 915 raise RuntimeError( 916 "torch.load does not work with file-like objects that do not implement readinto on Python 3.8.0 and 3.8.1. " 917 f"Received object of type "{type(f)}". Please update to Python 3.8.2 or newer to restore this " 918 "functionality.") --> 920 magic_number = pickle_module.load(f, pickle_load_args) 921 if magic_number != MAGIC_NUMBER: 922 raise RuntimeError("Invalid magic number; corrupt file?") > > UnpicklingError: invalid load key, 'v'. Sorry for the delay in addressing the issue you raised on the GitHub platform. We should have checked the GitHub issues more often, and we will definitely improve that. We are pleased to inform you that we have successfully replicated and resolved the issue. The root cause of the problem was attributed to git-lfs, a service responsible for storing large files. It is very likely that the pre-trained model (e.g., Result/DOSY/last.ckpt, occupying 141 MB) did not download completely to your local machine, which is why you encountered difficulties in running the test.ipynb file. It should be noted that the parameters of the pre-trained neural network are stored in the ckpt file, which is large since the deep neural network usually contains millions (or even more) of parameters. To address this issue, we have taken the necessary steps and uploaded the complete pre-trained model to Google Drive. We recommend that you download the ckpt file again from the new link (https://drive.google.com/drive/folders/1B-OZLdKW9k4eDrqzUU9UySQUqVvSripd?usp=share_link) and replace the incomplete local pre-trained model, such as the "Result/DOSY/last.ckpt" file, to ensure successful execution of the test.ipynb file. Thank you for your recommendations regarding NMRbox, which will help us improve our work. We have already registered an account with NMRbox, and it will take several days for the account to validate. If the registration is successful, we will promptly deploy our code to NMRbox. Thank you for bringing this issue to our attention. Please do not hesitate to contact us with any further questions or concerns. And we will update the information on the GitHub page if we find some better way to resolve the git-lfs issue. — Reply to this email directly, [view it on GitHub]([#1 (comment)](#1 (comment))), or unsubscribe. You are receiving this because you authored the thread.Message ID: @.> Hello, Regarding the NMR files, we usually modify their suffix to ".mat" (or directly export the .mat file from DOSYToolbox) and process them using the "Solve_data.m" file located in the specific folder (e.g., DRILT/MATLAB/Data/GSP/Solve_data.m). Currently, only the GSP, QGC, and VD folders contain pre-processing code. Regrettably, we are unable to publicly provide code for other data due to our lack of authorization. Therefore, for these particular data, we have extracted only basic information on variables such as "b," "idx_peaks," "ppm," and "S" to generate result graphs. Now we upload the generic pre-processing code to Github named "Generic_Solve_data.m" under the folder "DRILT/MATLAB/", which can assist you with data pre-processing and transforming into the network-input style. Additionally, you may choose to download this file through Google Drive(https://drive.google.com/drive/folders/1B-OZLdKW9k4eDrqzUU9UySQUqVvSripd?usp=share_link). To effectively execute this code with your personal data, it is important that you make necessary adjustments to specific parameters, such as the file path. Thank you for bringing this matter to our attention. Your inquiry has greatly assisted us in improving our code. We are also working on a Python code for pre-processing the NMR data and will update the GitHub page later. — Reply to this email directly, [view it on GitHub](#1 (comment)), or unsubscribe. You are receiving this because you authored the thread.Message ID: **@.***>

Hello,

We apologize for our oversight in only providing the display code for the comparative results of the paper (DRILT/MATLAB/Result/Results_Graph_Paper.mlx). To facilitate user convenience and verification, an example of how to draw your results graph has been added to the "DRILT/MATLAB/Result/Results_Graph.m" file. It is worth noting that you can achieve optimal display results by adjusting the contour_level parameter or by adjusting the parameters in preprocessing for better model output.

Our pre-trained model may not be able to work well on all kinds of DOSY data. For example, the pre-trained model (DRILT/Result/DOSY/last.ckpt) does not work well on this VD data, which contains two diffusion components that are very close to each other. So we generated a particular training dataset and obtained another pre-trained model (DRILT/Result/VD/last.ckpt) for this VD data. If you encounter any problems, please feel free to communicate with us anytime so we can continuously improve DRILT. We will improve the instructions in the README file. Finally, thank you again for your care and help in our work.

DRILTreviewer commented 1 year ago

Thanks for the file. Now I am able to display the data. I tested the program on the DOSYToolbox example data from Manchester website (mat files attached, data is here http://nmr.chemistry.manchester.ac.uk/sites/default/files/TestData_12Jul2016.zip see folder DOSY/D_-_Fructose_propan-1-ol_TSP_D2O). The sample contains: TSP, fructose, isopropanol and water. The results for TSP, fructose and isopropanol are very good (better than e.g. Mnova processing). However, the water D coefficient is completely off (strange, because other programs can deal with it). Is it outside the training parameters? I don't think so and it should not be. Can you check what is happening?Since the results are quite OK, as for version 1.0, I could already recommend the paper for publication. However, I would strongly recommend you to check this, before I do this. The peak interest in your work will be just after the publication. If version 1.0 has bugs or imperfections (like cumbersome display or input preparation) some potential users may get discouraged.

------- Original Message ------- czwartek, 9 marca 2023 2:37 AM, WryBin @.***> napisał(a):

Hello, Thanks. I think I am getting the result now. However, it is not easy to watch it. Could you also prepare a short MATLAB code ploting the resulting Z matrix with a proper scale in ppm (allowing me to compare the result with other programs) ------- Original Message ------- środa, 8 marca 2023 3:08 PM, WryBin @.***> napisał(a):

Hello, I am able to run the program now and reproduce your results. Thanks! However, I don't know how to run it on my own data. The manual says that I have to preprocess it using DOSYtoolbox. I do this and get .nmr file that, however, has different variables... Could you prepare a step-by-step guide how to deal with .nmr file produced by DOSYtoolbox? Your variables (b, idx_peaks,ppm,S) are not present in their structure. Thanks in advance for your help! > > ------- Original Message ------- wtorek, 7 marca 2023 2:37 PM, WryBin @.*> napisał(a): > >> Hello, > > I am reviewing your paper entitled: "High-quality Reconstruction for Laplace NMR based on Deep Learning" I think, it is a beautiful and well-documented work and I think, that the paper could be accepted with very minor changes. However, I am not able to run the code. I have to test it before I provide a verdict. The instructions on github (https://github.com/WryBin/DRILT) allow me to create a virtual environment and run Test.ipynb but it crashes with the message below. The same happens on nmrbox. Could you help to solve this? I would recommend to make instructions how to make the program run on nmrbox.org platform (create venv and so on...). Many NMR users perform processing on nmrbox and having it there would make your program popular. > > UnpicklingError Traceback (most recent call last) Input In [2], in <cell line: 7>() 15 else: 16 with torch.no_grad(): ---> 17 module = Transformer.load_from_checkpoint("Result/DOSY/last.ckpt") 18 module.cpu() 19 module.eval() > > File myvenv/lib/python3.9/site-packages/pytorch_lightning/core/saving.py:134, in ModelIO.load_from_checkpoint(cls, checkpoint_path, map_location, hparams_file, strict, kwargs) 132 checkpoint = pl_load(checkpoint_path, map_location=map_location) 133 else: --> 134 checkpoint = pl_load(checkpoint_path, map_location=lambda storage, loc: storage) 136 if hparams_file is not None: 137 extension = hparams_file.split(".")[-1] > > File myvenv/lib/python3.9/site-packages/pytorch_lightning/utilities/cloud_io.py:38, in load(path_or_url, map_location) 36 fs = get_filesystem(path_or_url) 37 with fs.open(path_or_url, "rb") as f: ---> 38 return torch.load(f, map_location=map_location) > > File myvenv/lib/python3.9/site-packages/torch/serialization.py:713, in load(f, map_location, pickle_module, pickle_load_args) 711 return torch.jit.load(opened_file) 712 return _load(opened_zipfile, map_location, pickle_module, pickle_load_args) --> 713 return _legacy_load(opened_file, map_location, pickle_module, pickle_load_args) > > File myvenv/lib/python3.9/site-packages/torch/serialization.py:920, in _legacy_load(f, map_location, pickle_module, pickle_load_args) 914 if not hasattr(f, 'readinto') and (3, 8, 0) <= sys.version_info < (3, 8, 2): 915 raise RuntimeError( 916 "torch.load does not work with file-like objects that do not implement readinto on Python 3.8.0 and 3.8.1. " 917 f"Received object of type "{type(f)}". Please update to Python 3.8.2 or newer to restore this " 918 "functionality.") --> 920 magic_number = pickle_module.load(f, pickle_load_args) 921 if magic_number != MAGIC_NUMBER: 922 raise RuntimeError("Invalid magic number; corrupt file?") > > UnpicklingError: invalid load key, 'v'. Sorry for the delay in addressing the issue you raised on the GitHub platform. We should have checked the GitHub issues more often, and we will definitely improve that. We are pleased to inform you that we have successfully replicated and resolved the issue. The root cause of the problem was attributed to git-lfs, a service responsible for storing large files. It is very likely that the pre-trained model (e.g., Result/DOSY/last.ckpt, occupying 141 MB) did not download completely to your local machine, which is why you encountered difficulties in running the test.ipynb file. It should be noted that the parameters of the pre-trained neural network are stored in the ckpt file, which is large since the deep neural network usually contains millions (or even more) of parameters. To address this issue, we have taken the necessary steps and uploaded the complete pre-trained model to Google Drive. We recommend that you download the ckpt file again from the new link (https://drive.google.com/drive/folders/1B-OZLdKW9k4eDrqzUU9UySQUqVvSripd?usp=share_link) and replace the incomplete local pre-trained model, such as the "Result/DOSY/last.ckpt" file, to ensure successful execution of the test.ipynb file. Thank you for your recommendations regarding NMRbox, which will help us improve our work. We have already registered an account with NMRbox, and it will take several days for the account to validate. If the registration is successful, we will promptly deploy our code to NMRbox. Thank you for bringing this issue to our attention. Please do not hesitate to contact us with any further questions or concerns. And we will update the information on the GitHub page if we find some better way to resolve the git-lfs issue. — Reply to this email directly, [view it on GitHub]([#1 (comment)](#1 (comment))), or unsubscribe. You are receiving this because you authored the thread.Message ID: @.> Hello, Regarding the NMR files, we usually modify their suffix to ".mat" (or directly export the .mat file from DOSYToolbox) and process them using the "Solve_data.m" file located in the specific folder (e.g., DRILT/MATLAB/Data/GSP/Solve_data.m). Currently, only the GSP, QGC, and VD folders contain pre-processing code. Regrettably, we are unable to publicly provide code for other data due to our lack of authorization. Therefore, for these particular data, we have extracted only basic information on variables such as "b," "idx_peaks," "ppm," and "S" to generate result graphs. Now we upload the generic pre-processing code to Github named "Generic_Solve_data.m" under the folder "DRILT/MATLAB/", which can assist you with data pre-processing and transforming into the network-input style. Additionally, you may choose to download this file through Google Drive(https://drive.google.com/drive/folders/1B-OZLdKW9k4eDrqzUU9UySQUqVvSripd?usp=share_link). To effectively execute this code with your personal data, it is important that you make necessary adjustments to specific parameters, such as the file path. Thank you for bringing this matter to our attention. Your inquiry has greatly assisted us in improving our code. We are also working on a Python code for pre-processing the NMR data and will update the GitHub page later. — Reply to this email directly, [view it on GitHub](#1 (comment)), or unsubscribe. You are receiving this because you authored the thread.Message ID: @.>

Hello,

We apologize for our oversight in only providing the display code for the comparative results of the paper (DRILT/MATLAB/Result/Results_Graph_Paper.mlx). To facilitate user convenience and verification, an example of how to draw your results graph has been added to the "DRILT/MATLAB/Result/Results_Graph.m" file. It is worth noting that you can achieve optimal display results by adjusting the contour_level parameter or by adjusting the parameters in preprocessing for better model output.

Our pre-trained model may not be able to work well on all kinds of DOSY data. For example, the pre-trained model (DRILT/Result/DOSY/last.ckpt) does not work well on this VD data, which contains two diffusion components that are very close to each other. So we generated a particular training dataset and obtained another pre-trained model (DRILT/Result/VD/last.ckpt) for this VD data. If you encounter any problems, please feel free to communicate with us anytime so we can continuously improve DRILT. We will improve the instructions in the README file. Finally, thank you again for your care and help in our work.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

WryBin commented 1 year ago

Thanks for the file. Now I am able to display the data. I tested the program on the DOSYToolbox example data from Manchester website (mat files attached, data is here http://nmr.chemistry.manchester.ac.uk/sites/default/files/TestData_12Jul2016.zip see folder DOSY/D_-_Fructose_propan-1-ol_TSP_D2O). The sample contains: TSP, fructose, isopropanol and water. The results for TSP, fructose and isopropanol are very good (better than e.g. Mnova processing). However, the water D coefficient is completely off (strange, because other programs can deal with it). Is it outside the training parameters? I don't think so and it should not be. Can you check what is happening?Since the results are quite OK, as for version 1.0, I could already recommend the paper for publication. However, I would strongly recommend you to check this, before I do this. The peak interest in your work will be just after the publication. If version 1.0 has bugs or imperfections (like cumbersome display or input preparation) some potential users may get discouraged. ------- Original Message ------- czwartek, 9 marca 2023 2:37 AM, WryBin @.***> napisał(a):

Hello, Thanks. I think I am getting the result now. However, it is not easy to watch it. Could you also prepare a short MATLAB code ploting the resulting Z matrix with a proper scale in ppm (allowing me to compare the result with other programs) > > ------- Original Message ------- środa, 8 marca 2023 3:08 PM, WryBin @.> napisał(a): > >> Hello, I am able to run the program now and reproduce your results. Thanks! However, I don't know how to run it on my own data. The manual says that I have to preprocess it using DOSYtoolbox. I do this and get .nmr file that, however, has different variables... Could you prepare a step-by-step guide how to deal with .nmr file produced by DOSYtoolbox? Your variables (b, idx_peaks,ppm,S) are not present in their structure. Thanks in advance for your help! > > ------- Original Message ------- wtorek, 7 marca 2023 2:37 PM, WryBin @.> napisał(a): > >> Hello, > > I am reviewing your paper entitled: "High-quality Reconstruction for Laplace NMR based on Deep Learning" I think, it is a beautiful and well-documented work and I think, that the paper could be accepted with very minor changes. However, I am not able to run the code. I have to test it before I provide a verdict. The instructions on github (https://github.com/WryBin/DRILT) allow me to create a virtual environment and run Test.ipynb but it crashes with the message below. The same happens on nmrbox. Could you help to solve this? I would recommend to make instructions how to make the program run on nmrbox.org platform (create venv and so on...). Many NMR users perform processing on nmrbox and having it there would make your program popular. > > UnpicklingError Traceback (most recent call last) Input In [2], in <cell line: 7>() 15 else: 16 with torch.no_grad(): ---> 17 module = Transformer.load_from_checkpoint("Result/DOSY/last.ckpt") 18 module.cpu() 19 module.eval() > > File myvenv/lib/python3.9/site-packages/pytorch_lightning/core/saving.py:134, in ModelIO.load_from_checkpoint(cls, checkpoint_path, map_location, hparams_file, strict, kwargs) 132 checkpoint = pl_load(checkpoint_path, map_location=map_location) 133 else: --> 134 checkpoint = pl_load(checkpoint_path, map_location=lambda storage, loc: storage) 136 if hparams_file is not None: 137 extension = hparams_file.split(".")[-1] > > File myvenv/lib/python3.9/site-packages/pytorch_lightning/utilities/cloud_io.py:38, in load(path_or_url, map_location) 36 fs = get_filesystem(path_or_url) 37 with fs.open(path_or_url, "rb") as f: ---> 38 return torch.load(f, map_location=map_location) > > File myvenv/lib/python3.9/site-packages/torch/serialization.py:713, in load(f, map_location, pickle_module, pickle_load_args) 711 return torch.jit.load(opened_file) 712 return _load(opened_zipfile, map_location, pickle_module, pickle_load_args) --> 713 return _legacy_load(opened_file, map_location, pickle_module, pickle_load_args) > > File myvenv/lib/python3.9/site-packages/torch/serialization.py:920, in _legacy_load(f, map_location, pickle_module, pickle_load_args) 914 if not hasattr(f, 'readinto') and (3, 8, 0) <= sys.version_info < (3, 8, 2): 915 raise RuntimeError( 916 "torch.load does not work with file-like objects that do not implement readinto on Python 3.8.0 and 3.8.1. " 917 f"Received object of type "{type(f)}". Please update to Python 3.8.2 or newer to restore this " 918 "functionality.") --> 920 magic_number = pickle_module.load(f, pickle_load_args) 921 if magic_number != MAGIC_NUMBER: 922 raise RuntimeError("Invalid magic number; corrupt file?") > > UnpicklingError: invalid load key, 'v'. Sorry for the delay in addressing the issue you raised on the GitHub platform. We should have checked the GitHub issues more often, and we will definitely improve that. We are pleased to inform you that we have successfully replicated and resolved the issue. The root cause of the problem was attributed to git-lfs, a service responsible for storing large files. It is very likely that the pre-trained model (e.g., Result/DOSY/last.ckpt, occupying 141 MB) did not download completely to your local machine, which is why you encountered difficulties in running the test.ipynb file. It should be noted that the parameters of the pre-trained neural network are stored in the ckpt file, which is large since the deep neural network usually contains millions (or even more) of parameters. To address this issue, we have taken the necessary steps and uploaded the complete pre-trained model to Google Drive. We recommend that you download the ckpt file again from the new link (https://drive.google.com/drive/folders/1B-OZLdKW9k4eDrqzUU9UySQUqVvSripd?usp=share_link) and replace the incomplete local pre-trained model, such as the "Result/DOSY/last.ckpt" file, to ensure successful execution of the test.ipynb file. Thank you for your recommendations regarding NMRbox, which will help us improve our work. We have already registered an account with NMRbox, and it will take several days for the account to validate. If the registration is successful, we will promptly deploy our code to NMRbox. Thank you for bringing this issue to our attention. Please do not hesitate to contact us with any further questions or concerns. And we will update the information on the GitHub page if we find some better way to resolve the git-lfs issue. — Reply to this email directly, [view it on GitHub]([#1 (comment)]([#1 (comment)](#1 (comment)))), or unsubscribe. You are receiving this because you authored the thread.Message ID: @.> Hello, Regarding the NMR files, we usually modify their suffix to ".mat" (or directly export the .mat file from DOSYToolbox) and process them using the "Solve_data.m" file located in the specific folder (e.g., DRILT/MATLAB/Data/GSP/Solve_data.m). Currently, only the GSP, QGC, and VD folders contain pre-processing code. Regrettably, we are unable to publicly provide code for other data due to our lack of authorization. Therefore, for these particular data, we have extracted only basic information on variables such as "b," "idx_peaks," "ppm," and "S" to generate result graphs. Now we upload the generic pre-processing code to Github named "Generic_Solve_data.m" under the folder "DRILT/MATLAB/", which can assist you with data pre-processing and transforming into the network-input style. Additionally, you may choose to download this file through Google Drive(https://drive.google.com/drive/folders/1B-OZLdKW9k4eDrqzUU9UySQUqVvSripd?usp=share_link). To effectively execute this code with your personal data, it is important that you make necessary adjustments to specific parameters, such as the file path. Thank you for bringing this matter to our attention. Your inquiry has greatly assisted us in improving our code. We are also working on a Python code for pre-processing the NMR data and will update the GitHub page later. — Reply to this email directly, [view it on GitHub]([#1 (comment)](#1 (comment))), or unsubscribe. You are receiving this because you authored the thread.Message ID: @.> Hello, We apologize for our oversight in only providing the display code for the comparative results of the paper (DRILT/MATLAB/Result/Results_Graph_Paper.mlx). To facilitate user convenience and verification, an example of how to draw your results graph has been added to the "DRILT/MATLAB/Result/Results_Graph.m" file. It is worth noting that you can achieve optimal display results by adjusting the contour_level parameter or by adjusting the parameters in preprocessing for better model output. Our pre-trained model may not be able to work well on all kinds of DOSY data. For example, the pre-trained model (DRILT/Result/DOSY/last.ckpt) does not work well on this VD data, which contains two diffusion components that are very close to each other. So we generated a particular training dataset and obtained another pre-trained model (DRILT/Result/VD/last.ckpt) for this VD data. If you encounter any problems, please feel free to communicate with us anytime so we can continuously improve DRILT. We will improve the instructions in the README file. Finally, thank you again for your care and help in our work. — Reply to this email directly, [view it on GitHub](#1 (comment)), or unsubscribe. You are receiving this because you authored the thread.Message ID: **@.***>

We sincerely appreciate your careful review of our work before its formal publication. We acknowledge your observation that the water peak's diffusion coefficient, as computed by our pre-trained model, exceeded the preset range. The reason is as follows.

During the DRILT training phase, we set the parameter "b" (eq. S6 in the SI) of the simulated data as a fixed vector ranging from 0 to 0.8 with 30 points, and the range of diffusion coefficient D to (0, 14) uniformly. As the mathematical model of DOSY, each decaying signal along the chemical shift dimension conforms to exp(-b*D). However, the distribution of parameter b in various DOSY data varies considerably due to different settings of gradient and experimental parameters. To ensure consistency in the input DOSY data's decaying pattern with the training data, we interpolated each decaying signal according to b=linspace(0, b_max, 30) during data preprocessing (as explained in S3.1 of the SI). As a result, the DRILT-calculated diffusion coefficient requires multiplication by a scaling factor (0.8/b_max) to obtain the correct value (as explained in S3.2 of the SI). Specifically, the maximum value of the diffusion coefficient that DRILT can compute is (14*0.8/b_max) under the preset training parameters. As the data you provide has b_max = 0.9448, the maximum diffusion coefficient is 11.8546 (×10^(-10) m^2/s).

But if we want the pre-trained network to output a larger range of diffusion coefficient, we can simply adjust the range by incorporating a new parameter called “scale”. Based on the mathematical model of the decaying signal exp(-b*D), we know that amplifying b by "scale" (b_new=b*scale) yields a calculated diffusion coefficient of D_new=D/scale. Consequently, we can multiply b by "scale" before interpolating the original b, thereby changing the maximum value of the diffusion coefficient that DRILT can compute to (14*0.8/b_max)*scale. In your tested DOSY data, the value of parameter "scale" can be set to 1.05, sufficient to obtain the ideal result, which closely approximates the mono-exponential fitting results. The updated versions of the "Test.ipynb" file and the "Results_Graph.m" file, which include the newly added parameter "scale", have been uploaded to GitHub.

Now we have optimized our code further to enable DRILT to calculate automatically the maximum D value range that can be displayed after adjusting the parameter "scale". Also, we have made a file named "Data Processing and Reconstruction" to clearly show the pre-processing and post-processing procedures, with instructions on how to change the calculated diffusion coefficient range. We have uploaded this file to GitHub for your information (the equations are better presented in that file).

Finally, thank you for your support of DRILT. We are committed to further optimizing DRILT, not only for the purpose of enhancing DOSY reconstruction results but also for extending its capabilities to include Multi-dimensional Laplace NMR reconstruction tasks.

DRILTreviewer commented 1 year ago

OK, great, thank you. It works. I will recommend the paper for publication. The program still requires a lot of improvements to make it user-friendly, but I see its potential. Good luck!

------- Original Message ------- piątek, 10 marca 2023 6:08 AM, WryBin @.***> napisał(a):

Thanks for the file. Now I am able to display the data. I tested the program on the DOSYToolbox example data from Manchester website (mat files attached, data is here http://nmr.chemistry.manchester.ac.uk/sites/default/files/TestData_12Jul2016.zip see folder DOSY/D_-_Fructose_propan-1-ol_TSP_D2O). The sample contains: TSP, fructose, isopropanol and water. The results for TSP, fructose and isopropanol are very good (better than e.g. Mnova processing). However, the water D coefficient is completely off (strange, because other programs can deal with it). Is it outside the training parameters? I don't think so and it should not be. Can you check what is happening?Since the results are quite OK, as for version 1.0, I could already recommend the paper for publication. However, I would strongly recommend you to check this, before I do this. The peak interest in your work will be just after the publication. If version 1.0 has bugs or imperfections (like cumbersome display or input preparation) some potential users may get discouraged. ------- Original Message ------- czwartek, 9 marca 2023 2:37 AM, WryBin @.***> napisał(a):

Hello, Thanks. I think I am getting the result now. However, it is not easy to watch it. Could you also prepare a short MATLAB code ploting the resulting Z matrix with a proper scale in ppm (allowing me to compare the result with other programs) > > ------- Original Message ------- środa, 8 marca 2023 3:08 PM, WryBin @.> napisał(a): > >> Hello, I am able to run the program now and reproduce your results. Thanks! However, I don't know how to run it on my own data. The manual says that I have to preprocess it using DOSYtoolbox. I do this and get .nmr file that, however, has different variables... Could you prepare a step-by-step guide how to deal with .nmr file produced by DOSYtoolbox? Your variables (b, idx_peaks,ppm,S) are not present in their structure. Thanks in advance for your help! > > ------- Original Message ------- wtorek, 7 marca 2023 2:37 PM, WryBin @.> napisał(a): > >> Hello, > > I am reviewing your paper entitled: "High-quality Reconstruction for Laplace NMR based on Deep Learning" I think, it is a beautiful and well-documented work and I think, that the paper could be accepted with very minor changes. However, I am not able to run the code. I have to test it before I provide a verdict. The instructions on github (https://github.com/WryBin/DRILT) allow me to create a virtual environment and run Test.ipynb but it crashes with the message below. The same happens on nmrbox. Could you help to solve this? I would recommend to make instructions how to make the program run on nmrbox.org platform (create venv and so on...). Many NMR users perform processing on nmrbox and having it there would make your program popular. > > UnpicklingError Traceback (most recent call last) Input In [2], in <cell line: 7>() 15 else: 16 with torch.no_grad(): ---> 17 module = Transformer.load_from_checkpoint("Result/DOSY/last.ckpt") 18 module.cpu() 19 module.eval() > > File myvenv/lib/python3.9/site-packages/pytorch_lightning/core/saving.py:134, in ModelIO.load_from_checkpoint(cls, checkpoint_path, map_location, hparams_file, strict, *kwargs) 132 checkpoint = pl_load(checkpoint_path, map_location=map_location) 133 else: --> 134 checkpoint = pl_load(checkpoint_path, map_location=lambda storage, loc: storage) 136 if hparams_file is not None: 137 extension = hparams_file.split(".")[-1] > > File myvenv/lib/python3.9/site-packages/pytorch_lightning/utilities/cloud_io.py:38, in load(path_or_url, map_location) 36 fs = get_filesystem(path_or_url) 37 with fs.open(path_or_url, "rb") as f: ---> 38 return torch.load(f, map_location=map_location) > > File myvenv/lib/python3.9/site-packages/torch/serialization.py:713, in load(f, map_location, pickle_module, pickle_load_args) 711 return torch.jit.load(opened_file) 712 return _load(opened_zipfile, map_location, pickle_module, pickle_load_args) --> 713 return _legacy_load(opened_file, map_location, pickle_module, pickle_load_args) > > File myvenv/lib/python3.9/site-packages/torch/serialization.py:920, in _legacy_load(f, map_location, pickle_module, pickle_load_args) 914 if not hasattr(f, 'readinto') and (3, 8, 0) <= sys.version_info < (3, 8, 2): 915 raise RuntimeError( 916 "torch.load does not work with file-like objects that do not implement readinto on Python 3.8.0 and 3.8.1. " 917 f"Received object of type "{type(f)}". Please update to Python 3.8.2 or newer to restore this " 918 "functionality.") --> 920 magic_number = pickle_module.load(f, pickle_load_args) 921 if magic_number != MAGIC_NUMBER: 922 raise RuntimeError("Invalid magic number; corrupt file?") > > UnpicklingError: invalid load key, 'v'. Sorry for the delay in addressing the issue you raised on the GitHub platform. We should have checked the GitHub issues more often, and we will definitely improve that. We are pleased to inform you that we have successfully replicated and resolved the issue. The root cause of the problem was attributed to git-lfs, a service responsible for storing large files. It is very likely that the pre-trained model (e.g., Result/DOSY/last.ckpt, occupying 141 MB) did not download completely to your local machine, which is why you encountered difficulties in running the test.ipynb file. It should be noted that the parameters of the pre-trained neural network are stored in the ckpt file, which is large since the deep neural network usually contains millions (or even more) of parameters. To address this issue, we have taken the necessary steps and uploaded the complete pre-trained model to Google Drive. We recommend that you download the ckpt file again from the new link (https://drive.google.com/drive/folders/1B-OZLdKW9k4eDrqzUU9UySQUqVvSripd?usp=share_link) and replace the incomplete local pre-trained model, such as the "Result/DOSY/last.ckpt" file, to ensure successful execution of the test.ipynb file. Thank you for your recommendations regarding NMRbox, which will help us improve our work. We have already registered an account with NMRbox, and it will take several days for the account to validate. If the registration is successful, we will promptly deploy our code to NMRbox. Thank you for bringing this issue to our attention. Please do not hesitate to contact us with any further questions or concerns. And we will update the information on the GitHub page if we find some better way to resolve the git-lfs issue. — Reply to this email directly, [view it on GitHub]([#1 (comment)]([#1 (comment)](#1 (comment)))), or unsubscribe. You are receiving this because you authored the thread.Message ID: @.> Hello, Regarding the NMR files, we usually modify their suffix to ".mat" (or directly export the .mat file from DOSYToolbox) and process them using the "Solve_data.m" file located in the specific folder (e.g., DRILT/MATLAB/Data/GSP/Solve_data.m). Currently, only the GSP, QGC, and VD folders contain pre-processing code. Regrettably, we are unable to publicly provide code for other data due to our lack of authorization. Therefore, for these particular data, we have extracted only basic information on variables such as "b," "idx_peaks," "ppm," and "S" to generate result graphs. Now we upload the generic pre-processing code to Github named "Generic_Solve_data.m" under the folder "DRILT/MATLAB/", which can assist you with data pre-processing and transforming into the network-input style. Additionally, you may choose to download this file through Google Drive(https://drive.google.com/drive/folders/1B-OZLdKW9k4eDrqzUU9UySQUqVvSripd?usp=share_link). To effectively execute this code with your personal data, it is important that you make necessary adjustments to specific parameters, such as the file path. Thank you for bringing this matter to our attention. Your inquiry has greatly assisted us in improving our code. We are also working on a Python code for pre-processing the NMR data and will update the GitHub page later. — Reply to this email directly, [view it on GitHub]([#1 (comment)](#1 (comment))), or unsubscribe. You are receiving this because you authored the thread.Message ID: @.> Hello, We apologize for our oversight in only providing the display code for the comparative results of the paper (DRILT/MATLAB/Result/Results_Graph_Paper.mlx). To facilitate user convenience and verification, an example of how to draw your results graph has been added to the "DRILT/MATLAB/Result/Results_Graph.m" file. It is worth noting that you can achieve optimal display results by adjusting the contour_level parameter or by adjusting the parameters in preprocessing for better model output. Our pre-trained model may not be able to work well on all kinds of DOSY data. For example, the pre-trained model (DRILT/Result/DOSY/last.ckpt) does not work well on this VD data, which contains two diffusion components that are very close to each other. So we generated a particular training dataset and obtained another pre-trained model (DRILT/Result/VD/last.ckpt) for this VD data. If you encounter any problems, please feel free to communicate with us anytime so we can continuously improve DRILT. We will improve the instructions in the README file. Finally, thank you again for your care and help in our work. — Reply to this email directly, [view it on GitHub](#1 (comment)), or unsubscribe. You are receiving this because you authored the thread.Message ID: @.>

We sincerely appreciate your careful review of our work before its formal publication. We acknowledge your observation that the water peak's diffusion coefficient, as computed by our pre-trained model, exceeded the preset range. The reason is as follows.

During the DRILT training phase, we set the parameter "b" (eq. S6 in the SI) of the simulated data as a fixed vector ranging from 0 to 0.8 with 30 points, and the range of diffusion coefficient D to (0, 14) uniformly. As the mathematical model of DOSY, each decaying signal along the chemical shift dimension conforms to exp(-bD). However, the distribution of parameter b in various DOSY data varies considerably due to different settings of gradient and experimental parameters. To ensure consistency in the input DOSY data's decaying pattern with the training data, we interpolated each decaying signal according to b=linspace(0, b_max, 30) during data preprocessing (as explained in S3.1 of the SI). As a result, the DRILT-calculated diffusion coefficient requires multiplication by a scaling factor (0.8/b_max) to obtain the correct value (as explained in S3.2 of the SI). Specifically, the maximum value of the diffusion coefficient that DRILT can compute is (140.8/b_max) under the preset training parameters. As the data you provide has b_max = 0.9448, the maximum diffusion coefficient is 11.8546 (×10^(-10) m^2/s).

But if we want the pre-trained network to output a larger range of diffusion coefficient, we can simply adjust the range by incorporating a new parameter called “scale”. Based on the mathematical model of the decaying signal exp(-bD), we know that amplifying b by "scale" (b_new=bscale) yields a calculated diffusion coefficient of D_new=D/scale. Consequently, we can multiply b by "scale" before interpolating the original b, thereby changing the maximum value of the diffusion coefficient that DRILT can compute to (140.8/b_max)scale. In your tested DOSY data, the value of parameter "scale" can be set to 1.05, sufficient to obtain the ideal result, which closely approximates the mono-exponential fitting results. The updated versions of the "Test.ipynb" file and the "Results_Graph.m" file, which include the newly added parameter "scale", have been uploaded to GitHub.

Now we have optimized our code further to enable DRILT to calculate automatically the maximum D value range that can be displayed after adjusting the parameter "scale". Also, we have made a file named "Data Processing and Reconstruction" to clearly show the pre-processing and post-processing procedures, with instructions on how to change the calculated diffusion coefficient range. We have uploaded this file to GitHub for your information (the equations are better presented in that file).

Finally, thank you for your support of DRILT. We are committed to further optimizing DRILT, not only for the purpose of enhancing DOSY reconstruction results but also for extending its capabilities to include Multi-dimensional Laplace NMR reconstruction tasks.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

WryBin commented 1 year ago

Thanks a lot for your invaluable help and precious suggestions once again! One of our ongoing objectives has been to make this program more user-friendly, so that more experimenters who are not very proficient in programming can easily use it. We are truly grateful for all the contributions you have made towards achieving this goal.