<commit_before>##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
#         Molecular Dynamics Trajectories.
# Copyright 2012-2014 Stanford University and the Authors
#
# Authors: <NAME>
# Contributors: <NAME>, <NAME>, <NAME>
#
# MDTraj is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 2.1
# of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with MDTraj. If not, see <http://www.gnu.org/licenses/>.
#############################################################################

"""
This file contains scripts for calculating scalar (J) Couplings from backbone dihedrals.
"""

##############################################################################
# Imports
##############################################################################

import numpy as np
import pandas as pd
from mdtraj.geometry import compute_phi


J3_HN_HA_coefficients = {
"Ruterjans1999": dict(phi0=-60 * np.pi/180., A=7.09, B=-1.42, C=1.55),
"Bax2007": dict(phi0=-60 * np.pi/180., A=7.09, B=-1.42, C=1.55),
"Bax1997": dict(phi0=-60 * np.pi/180., A=7.09, B=-1.42, C=1.55),
}

J3_HN_HA_uncertainties = pd.Series({  # Values in [Hz]
"Ruterjans1999":0.25, "Bax2007":0.36, "Bax1997":0.39
})



def _J3_lambda_function(A, B, C, phi0):
    """Return a lambda function that calculates scalar couplings with a given choice of karplus coefficients.  USES RADIANS!"""
    return lambda phi: A * np.cos(phi + phi0) ** 2. + B * np.cos(phi + phi0) + C


def J3_HN_HA_from_phi(phi, model="Bax2007"):<commit_msg>Added other 2 models and provenence info.<commit_after>##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
#         Molecular Dynamics Trajectories.
# Copyright 2012-2014 Stanford University and the Authors
#
# Authors: <NAME>
# Contributors: <NAME>, <NAME>, <NAME>
#
# MDTraj is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 2.1
# of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with MDTraj. If not, see <http://www.gnu.org/licenses/>.
#############################################################################

"""
This file contains scripts for calculating scalar (J) Couplings from backbone dihedrals.
"""

##############################################################################
# Imports
##############################################################################

import numpy as np
import pandas as pd
from mdtraj.geometry import compute_phi


J3_HN_HA_coefficients = {
"Ruterjans1999": dict(phi0=-60 * np.pi/180., A=7.90, B=-1.05, C=0.65),  # From Table 1. in paper
"Bax2007": dict(phi0=-60 * np.pi/180., A=8.4, B=-1.36, C=0.33),  # From Table 1. in paper
"Bax1997": dict(phi0=-60 * np.pi/180., A=7.09, B=-1.42, C=1.55),  # From Table 2. in paper
}

J3_HN_HA_uncertainties = pd.Series({  # Values in [Hz]
"Ruterjans1999":0.25, "Bax2007":0.36, "Bax1997":0.39
})



def _J3_lambda_function(A, B, C, phi0):
    """Return a lambda function that calculates scalar couplings with a given choice of karplus coefficients.  USES RADIANS!"""
    return lambda phi: A * np.cos(phi + phi0) ** 2. + B * np.cos(phi + phi0) + C


def J3_HN_HA_from_phi(phi, model="Bax2007"):
{'fraction_non_alphanumeric': 0.24695776664280603, 'fraction_numerical': 0.048437127177284656, 'mean_word_length': 5.005730659025788, 'pattern_counts': {'":': 12, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6587650', 'n_tokens_mistral': 1387, 'n_tokens_neox': 1211, 'n_words': 448}