|
| end end get env | env_index (i) |
| |
| | num_res_env (res_index(i), env_index(i)) |
| |
| | if (ai >NAA) continue end for j |
| |
| | if (aj >NAA) continue end if(env_index(i) |
| |
| | surf_surf_th1 (ai, aj, :, :)+ |
| |
| i, j, :, : | th1_table () |
| |
| | surf_core_th1 (ai, aj, :, :)+ |
| |
| end else | if (env_index(j)==1) %c-s core_surf_th1(ai |
| |
| end else | core_surf_th1 (ai, aj, :, :)+ |
| |
| | core_core_th1 (ai, aj, :, :)+ |
| |
| id | beta () |
| |
| surf_surf_th1, NAA | pre_fill_dfire_2D () |
| |
| | surf_surf_th1 (i, j,:,:) |
| |
| | surf_core_th1 (i, j,:,:) |
| |
| | core_surf_th1 (i, j,:,:) |
| |
| | core_core_th1 (i, j,:,:) |
| |
| | if (i!=j) % surf_surf_th1(j |
| |
| | surf_core_th1 (j, i,:,:) |
| |
| | core_surf_th1 (j, i,:,:) |
| |
| | core_core_th1 (j, i,:,:) |
| |
| NAA, 30, 16 | zeros () |
| |
| sum(surf_surf_th1, 2 | squeeze () |
| |
| id | i: (aasurf_surf_da1(i,:,:) calc_NtoP) |
| |
| | aasurf_core_da1 (i,:,:) |
| |
| | aacore_surf_da1 (i,:,:) |
| |
| | aacore_core_da1 (i,:,:) |
| |
| | aasurf_surf_da2 (i,:,:) |
| |
| | aacore_surf_da2 (i,:,:) |
| |
| | aasurf_core_da2 (i,:,:) |
| |
| | aacore_core_da2 (i,:,:) |
| |
| end | p_a_r_ang1 (ii, kk,:) |
| |
| | p_a_r_ang2 (ii, kk,:) |
| |
| end | p_r_ang (kk,:) |
| |
| | set (f, "visible", "off") else fp_ang |
| |
| end if | exist ("iii", "var") % iii %else % iii |
| |
| debug if debug | printf ("score_w(%d,%d): max=%f, min=%f\n", iii, jjj, max(max(score)), min(min(score))) |
| |
| | contourf (xx, yy, score) |
| |
| | print (fname, "-dpng") else fprintf(fp_ang |
| |
| ANGLE1 | reslist (iii,:) |
| |
| ANGLE1 | reslist (jjj,:)) |
| |
| end | fprintf (fp_ang, "\n") |
| |
| end | fprintf (fp_ang, "%.6f ", score(xx, 16)) |
| |
| end end end if debug | printf ("Done!\n") |
| |
| | set (f, "visible", "on") else fclose(fp_ang) |
| |
| end debug | subplot (2, 1, 1) %[xx |
| |
| | contourf (xx, yy, score_w) |
| |
| | plot (1:16, p_ii_w(30,:), 1:16, squeeze(p_ii(1, 30,:)), 1:16, squeeze(aa_surf_da1(4, 30,:))/sum(squeeze(aa_surf_da1(4, 30,:))), 1:16, squeeze(aa_core_da1(4, 30,:))/sum(squeeze(aa_core_da1(4, 30,:)))) %subplot(2 |
| |
| plot(1:16, score(24,:),"r", 1:16, score_w(24,:),"b") %axis([1 16 -0.2 0.2]) %plot(1 | contourf (xx, yy, Na1_r_surf_surf) %subplot(4 |
| |
| plot(1:16, score(24,:),"r", 1:16, score_w(24,:),"b") %axis([1 16 -0.2 0.2]) %plot(1 | contourf (xx, yy, Na2_r_surf_surf) %subplot(4 |
| |
| plot(1:16, score(24,:),"r", 1:16, score_w(24,:),"b") %axis([1 16 -0.2 0.2]) %plot(1 | contourf (xx, yy, Na1_r_core_surf) %subplot(4 |
| |
| plot(1:16, score(24,:),"r", 1:16, score_w(24,:),"b") %axis([1 16 -0.2 0.2]) %plot(1 | contourf (xx, yy, Na2_r_surf_core) %subplot(4 |
| |
| plot(1:16, score(24,:),"r", 1:16, score_w(24,:),"b") %axis([1 16 -0.2 0.2]) %plot(1 | contourf (xx, yy, Na1_r_surf_core) %subplot(4 |
| |
| plot(1:16, score(24,:),"r", 1:16, score_w(24,:),"b") %axis([1 16 -0.2 0.2]) %plot(1 | contourf (xx, yy, Na2_r_core_surf) %subplot(4 |
| |
| plot(1:16, score(24,:),"r", 1:16, score_w(24,:),"b") %axis([1 16 -0.2 0.2]) %plot(1 | contourf (xx, yy, Na1_r_core_core) %subplot(4 |
| |
|
| | debug = 0 |
| |
| | reslist |
| |
| | CYS |
| |
| | ASP |
| |
| | GLU |
| |
| | PHE |
| |
| | TRP |
| |
| | HIS |
| |
| | ILE |
| |
| | LYS |
| |
| | LEU |
| |
| | MET |
| |
| | ASN |
| |
| | VAL |
| |
| | GLN |
| |
| | ARG |
| |
| | SER |
| |
| | THR |
| |
| | PRO |
| |
| | ALA |
| |
| | GLY |
| |
| should not contain ALA GLY PRO | NAA = 17 |
| |
| | Rcut = 12 |
| |
| | Bcut = 24 |
| |
| buildlist | res_index = zeros(40,1) |
| |
| | env_index = zeros(40,1) |
| |
| | num_res_env = zeros(NAA,2) |
| |
| for | i |
| |
| | break |
| |
| end split | surf_surf_th1 =zeros(NAA,NAA,30,16) |
| |
| | surf_core_th1 =zeros(NAA,NAA,30,16) |
| |
| | core_surf_th1 =zeros(NAA,NAA,30,16) |
| |
| | core_core_th1 =zeros(NAA,NAA,30,16) |
| |
| end else | aj |
| |
| end else | j |
| |
| | smoothed = smooth_2D(surf_core_th1(i,j,:,:), [15, 0.1, 2], [360, 40, 2]) |
| |
| | __pad0__ |
| |
| | __pad1__ |
| |
| | __pad2__ |
| |
| | __pad3__ |
| |
| end end end sum symm | aasurf_surf_da1 =zeros(NAA,30,16) |
| |
| | aacore_surf_da1 =squeeze(sum(core_surf_th1,2)) |
| |
| | aasurf_core_da1 =squeeze(sum(surf_core_th1,2)) |
| |
| | aacore_core_da1 =squeeze(sum(core_core_th1,2)) |
| |
| | aasurf_surf_da2 =squeeze(sum(surf_surf_th1)) |
| |
| | aacore_surf_da2 =squeeze(sum(surf_core_th1)) |
| |
| | aasurf_core_da2 =squeeze(sum(core_surf_th1)) |
| |
| | aacore_core_da2 =squeeze(sum(core_core_th1)) |
| |
| | Na1_r_surf_surf = squeeze(sum(aasurf_surf_da1)) |
| |
| | Na1_r_surf_core = squeeze(sum(aasurf_core_da1)) |
| |
| | Na1_r_core_surf = squeeze(sum(aacore_surf_da1)) |
| |
| | Na1_r_core_core = squeeze(sum(aacore_core_da1)) |
| |
| | Na2_r_surf_surf = squeeze(sum(aasurf_surf_da2)) |
| |
| | Na2_r_surf_core = squeeze(sum(aasurf_core_da2)) |
| |
| | Na2_r_core_surf = squeeze(sum(aacore_surf_da2)) |
| |
| | Na2_r_core_core = squeeze(sum(aacore_core_da2)) |
| |
| | aa_aa_th1 = (surf_surf_th1 + surf_core_th1 + core_surf_th1 + core_core_th1) |
| |
| NAAaa to NAAaa cal | ntype = NAA |
| |
| | dat_a_a_r_ang = aa_aa_th1 |
| |
| old way | sum_a_a_r = sum(dat_a_a_r_ang,4) |
| |
| sum over ang | dat_a_r_ang1 = squeeze(sum(dat_a_a_r_ang, 2)) |
| |
| sum over the second aa | sum_a1_r = sum(dat_a_r_ang1, 3) |
| |
| sum over ang | dat_a_r_ang2 = squeeze(sum(dat_a_a_r_ang)) |
| |
| sum over the first aa | sum_a2_r = sum(dat_a_r_ang2, 3) |
| |
| sum over ang | dat_r_ang = squeeze(sum(dat_a_r_ang1)) |
| |
| sum over all aa | sum_r = sum(dat_r_ang,2) |
| |
| sum over ang | p_a_a_r_ang = zeros(ntype, ntype, 30, 16) |
| |
| | p_a_r_ang1 = zeros(ntype, 30, 16) |
| |
| | p_a_r_ang2 = zeros(ntype, 30, 16) |
| |
| | p_r_ang = zeros(30, 16) |
| |
| for | kk |
| |
| end shift | shift = zeros(30,16) |
| |
| end debug if debug | f = figure() |
| |
| | wj = num_res_env(jjj,1)/sum(num_res_env(jjj,:)) |
| |
| | p_ii_jj = squeeze(p_a_a_r_ang( iii, jjj, :, : )) |
| |
| | p_ii = p_a_r_ang1(iii, :, :) |
| |
| | p_ii_w = calc_Pi_ang_sc(aasurf_surf_da1(iii,:,:), aasurf_core_da1(iii,:,:), aacore_surf_da1(iii,:,:), aacore_core_da1(iii,:,:), wi, wj) |
| |
| | p_jj = p_a_r_ang2(jjj, :, :) |
| |
| | p_jj_w = calc_Pi_ang_sc(aasurf_surf_da2(jjj,:,:), aasurf_core_da2(jjj,:,:), aacore_surf_da2(jjj,:,:), aacore_core_da2(jjj,:,:), wj, wi) |
| |
| | p_ii_p_jj = squeeze(p_ii .* p_jj) |
| |
| | p_ii_p_jj_w = squeeze(p_ii_w .* p_jj_w) |
| |
| | p = (p_ii_jj .* p_r_ang) ./ (p_ii_p_jj) |
| |
| | p_r_ang_w = calc_Pi_ang_sc(Na1_r_surf_surf, Na1_r_surf_core, Na1_r_core_surf, Na1_r_core_core, wi, wj) |
| |
| | p_w = (p_ii_jj .* p_r_ang_w + shift) ./ (p_ii_p_jj_w + shift) |
| |
| | score = -log(p) |
| |
| | score_w = -log(p_w) |
| |
| | fname = [ "score_", int2str(iii), "_", int2str(jjj), ".png" ] |
| |
| ANGLE1 | __pad4__ |
| |
| for | yy |
| |
| for | xx |
| |