From ae9146a5b01fc352999b893fd9ee8a6de5ab9c3c Mon Sep 17 00:00:00 2001 From: YaoYinYing <33014714+YaoYinYing@users.noreply.github.com> Date: Sat, 17 Aug 2024 18:43:53 +0800 Subject: [PATCH] copy of license --- apps/protein_folding/helixfold3/FOLDING.md | 7 ++++ .../helixfold3/helixfold/LICENSE | 36 +++++++++++++++++++ .../helixfold/common/all_atom_pdb_save.py | 12 +++++-- .../helixfold3/helixfold/inference.py | 2 +- 4 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 apps/protein_folding/helixfold3/FOLDING.md create mode 100644 apps/protein_folding/helixfold3/helixfold/LICENSE diff --git a/apps/protein_folding/helixfold3/FOLDING.md b/apps/protein_folding/helixfold3/FOLDING.md new file mode 100644 index 00000000..17dc6ebc --- /dev/null +++ b/apps/protein_folding/helixfold3/FOLDING.md @@ -0,0 +1,7 @@ +# FOLD GUIDE + +## Quick example +```shell +LD_LIBRARY_PATH=/mnt/data/envs/conda_env/envs/helixfold/lib/:$LD_LIBRARY_PATH helixfold input=/repo/PaddleHelix/apps/protein_folding/helixfold3/data/demo_8ecx.json output=. CONFIG_DIFFS.preset=allatom_demo + +``` \ No newline at end of file diff --git a/apps/protein_folding/helixfold3/helixfold/LICENSE b/apps/protein_folding/helixfold3/helixfold/LICENSE new file mode 100644 index 00000000..fb84eeb3 --- /dev/null +++ b/apps/protein_folding/helixfold3/helixfold/LICENSE @@ -0,0 +1,36 @@ +# Terms of Use Agreement +The HelixFold 3 open-source code and any derivative works are only available for non-commercial use by individuals and non-commercial organizations (universities, non-profit organizations and research institutes, educational and government bodies), or for journalism. + + +# Usage Restrictions: +The use of the HelixFold 3 open-source code is subject to the following conditions and restrictions: + 1. Commercial Use Prohibited: The code and its outputs shall not be used by or for commercial entities, nor in any context related to commercial activities, including conducting research for commercial purposes or conferring any rights to commercial entities to use the outputs. + + 2. Integration with Automated Systems: The open-source code shall not be incorporated into any unauthorized automated systems, including, but not limited to, workflows for the screening or design of biomolecules. + + 3. Attribution Requirement: In any academic publication derived from the use of the open-source code, proper attribution to the original authors must be given in the manner specified, including the retention of the author's name, copyright notice, and a link to the license agreement, as well as a statement indicating whether modifications were made to the materials. + + 4. Share-Alike Obligation: If you modify or adapt the materials (e.g., through translation or rewriting), you must distribute your derivative works under the same "Attribution-NonCommercial-ShareAlike" license. This ensures that others may use your adapted work under identical terms. + + 5. Prohibition on Illegal or Malicious Use: The code shall not be used to facilitate or engage in activities that are illegal, dangerous, or malicious. + +For commercial use, you must contact the authors to obtain a commercial license.\ +**Disclaimers:** + +The HelixFold 3 open-source code any derivative works are only for theoretical modelling. These are not intended, validated, or approved for clinical use. + +**Governing Law and Dispute Resolution:** \ +This agreement is governed by the laws of the People's Republic of China. In the event of a dispute arising from the execution of this agreement, the parties shall attempt to resolve it through amicable consultation. If consultation fails, either party may submit the dispute to the People's Court of Haidian District, Beijing for adjudication. + +**Termination:** + - **Automatic Termination:** The rights granted under this license will automatically terminate if you violate any of its terms. Rights may be reinstated upon rectification of the violation or with the licensor's express consent. + + - **Surviving Provisions:** Certain provisions, including disclaimers and liability limitations, shall remain in effect even after the termination of this license. + + + +**Miscellaneous Provisions:** + - **No Additional Restrictions:** You may not impose any additional restrictions on the use of the materials, such as implementing technical protection measures (e.g., encryption), as doing so would contravene the spirit of this license. + - **Interpretation Authority:** Baidu reserves the right to make reasonable interpretations of this open-source service. + +Should any provision of this agreement be deemed invalid or unenforceable, the remaining provisions shall continue to be in full force and effect. diff --git a/apps/protein_folding/helixfold3/helixfold/common/all_atom_pdb_save.py b/apps/protein_folding/helixfold3/helixfold/common/all_atom_pdb_save.py index 92e7d225..abc33ef6 100644 --- a/apps/protein_folding/helixfold3/helixfold/common/all_atom_pdb_save.py +++ b/apps/protein_folding/helixfold3/helixfold/common/all_atom_pdb_save.py @@ -184,6 +184,10 @@ def prediction_to_mmcif(pred_atom_pos: Union[np.ndarray, paddle.Tensor], print('Launching subprocess "%s"', ' '.join(cmd)) + if os.path.exists('maxit.log'): + os.remove('maxit.log') + + process = subprocess.Popen( cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=os.environ.copy()) @@ -194,8 +198,10 @@ def prediction_to_mmcif(pred_atom_pos: Union[np.ndarray, paddle.Tensor], if retcode: # Logs have a 15k character limit, so log HHblits error line by line. - print('maxit failed. HHblits stderr begin:') - raise RuntimeError('HHblits failed\nstdout:\n%s\n\nstderr:\n%s\n' % ( - stdout.decode('utf-8'), stderr[:500_000].decode('utf-8'))) + print('Maxit failed. Maxit stderr begin:') + raise RuntimeError(f'Maxit failed\nstdout:\n{stdout.decode("utf-8")}\n\n' + f'stderr:\n{stderr[:500_000].decode("utf-8")}\n' + f'logfile:\n{open("maxit.log", "r").read().strip() if os.path.isfile("maxit.log") else ""}\n' + f'Env:\n{os.environ.copy()}') return mmcif_path \ No newline at end of file diff --git a/apps/protein_folding/helixfold3/helixfold/inference.py b/apps/protein_folding/helixfold3/helixfold/inference.py index 97ae415c..5a883094 100644 --- a/apps/protein_folding/helixfold3/helixfold/inference.py +++ b/apps/protein_folding/helixfold3/helixfold/inference.py @@ -461,7 +461,7 @@ def main(cfg: DictConfig): ## check maxit binary path maxit_binary=resolve_bin_path(cfg.other.maxit_binary,'maxit') - RCSBROOT=os.path.dirname(maxit_binary) + RCSBROOT=os.path.join(os.path.dirname(maxit_binary), '..') os.environ['RCSBROOT']=RCSBROOT ## check obabel