(L,pair_type)
| 114 | |
| 115 | # Define the d0 functions for numbers and arrays; minimum value = 1.0; from Yang and Skolnick, PROTEINS: Structure, Function, and Bioinformatics 57:702–710 (2004) |
| 116 | def calc_d0(L,pair_type): |
| 117 | L=float(L) |
| 118 | min_value=1.0 |
| 119 | if pair_type=='nucleic_acid': min_value=2.0 |
| 120 | if L>27: |
| 121 | d0=1.24*(L-15)**(1.0/3.0) - 1.8 |
| 122 | else: |
| 123 | d0=1.0 |
| 124 | return max(min_value, d0) |
| 125 | |
| 126 | def calc_d0_array(L, pair_type): |
| 127 | # Convert L to a NumPy array if it isn't already one (enables flexibility in input types) |