From b1ac4ec5292a0d8ddcc3ad64e27a5ab3a4febe39 Mon Sep 17 00:00:00 2001 From: Cezary Czaplewski Date: Fri, 1 Apr 2016 21:25:39 +0200 Subject: [PATCH] first and last GLY in seq gives correct energy in unres and wham Conflicts: source/cluster/wham/src-M/readrtns.F --- source/cluster/wham/src-M/readrtns.F | 13 +++++++++++++ source/cluster/wham/src/readrtns.F | 4 ++-- source/unres/src_MD/readrtns.F | 4 ++-- source/wham/src/energy_p_new.F | 1 + source/wham/src/molread_zs.F | 4 ++-- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/source/cluster/wham/src-M/readrtns.F b/source/cluster/wham/src-M/readrtns.F index 4c15495..666754f 100644 --- a/source/cluster/wham/src-M/readrtns.F +++ b/source/cluster/wham/src-M/readrtns.F @@ -206,6 +206,19 @@ C Convert sequence to numeric code do i=1,nres itype(i)=rescode(i,sequence(i),iscode) enddo + if (itype(2).eq.10.and.itype(1).eq.ntyp1) then + write (iout,*) + & "Glycine is the first full residue, initial dummy deleted" + do i=1,nres + itype(i)=itype(i+1) + enddo + nres=nres-1 + endif + if (itype(nres-1).eq.10.and.itype(nres).eq.ntyp1) then + write (iout,*) + & "Glycine is the last full residue, terminal dummy deleted" + nres=nres-1 + endif print *,nres print '(20i4)',(itype(i),i=1,nres) diff --git a/source/cluster/wham/src/readrtns.F b/source/cluster/wham/src/readrtns.F index 037eb1f..435cdb6 100644 --- a/source/cluster/wham/src/readrtns.F +++ b/source/cluster/wham/src/readrtns.F @@ -275,7 +275,7 @@ C Convert sequence to numeric code do i=1,nres itype(i)=rescode(i,sequence(i),iscode) enddo - if (itype(2).eq.10) then + if (itype(2).eq.10.and.itype(1).eq.ntyp1) then write (iout,*) & "Glycine is the first full residue, initial dummy deleted" do i=1,nres @@ -283,7 +283,7 @@ C Convert sequence to numeric code enddo nres=nres-1 endif - if (itype(nres).eq.10) then + if (itype(nres-1).eq.10.and.itype(nres).eq.ntyp1) then write (iout,*) & "Glycine is the last full residue, terminal dummy deleted" nres=nres-1 diff --git a/source/unres/src_MD/readrtns.F b/source/unres/src_MD/readrtns.F index 622d68a..74ba3d8 100644 --- a/source/unres/src_MD/readrtns.F +++ b/source/unres/src_MD/readrtns.F @@ -997,7 +997,7 @@ C Convert sequence to numeric code do i=1,nres itype(i)=rescode(i,sequence(i),iscode) enddo - if (itype(2).eq.10) then + if (itype(2).eq.10.and.itype(1).eq.ntyp1) then write (iout,*) & "Glycine is the first full residue, initial dummy deleted" do i=1,nres @@ -1005,7 +1005,7 @@ C Convert sequence to numeric code enddo nres=nres-1 endif - if (itype(nres).eq.10) then + if (itype(nres-1).eq.10.and.itype(nres).eq.ntyp1) then write (iout,*) & "Glycine is the last full residue, terminal dummy deleted" nres=nres-1 diff --git a/source/wham/src/energy_p_new.F b/source/wham/src/energy_p_new.F index 81abea5..78be320 100644 --- a/source/wham/src/energy_p_new.F +++ b/source/wham/src/energy_p_new.F @@ -5228,6 +5228,7 @@ c write (iout,*) "EBACK_SC_COR",itau_start,itau_end,nterm_sccor esccor=0.0D0 do i=itau_start,itau_end esccor_ii=0.0D0 + if ((itype(i-2).eq.ntyp1).or.(itype(i-1).eq.ntyp1)) cycle isccori=isccortyp(itype(i-2)) isccori1=isccortyp(itype(i-1)) phii=phi(i) diff --git a/source/wham/src/molread_zs.F b/source/wham/src/molread_zs.F index 9c999cc..5ddff14 100644 --- a/source/wham/src/molread_zs.F +++ b/source/wham/src/molread_zs.F @@ -57,7 +57,7 @@ C Convert sequence to numeric code do i=1,nres itype(i)=rescode(i,sequence(i),iscode) enddo - if (itype(2).eq.10) then + if (itype(2).eq.10.and.itype(1).eq.ntyp1) then write (iout,*) & "Glycine is the first full residue, initial dummy deleted" do i=1,nres @@ -65,7 +65,7 @@ C Convert sequence to numeric code enddo nres=nres-1 endif - if (itype(nres).eq.10) then + if (itype(nres-1).eq.10.and.itype(nres).eq.ntyp1) then write (iout,*) & "Glycine is the last full residue, terminal dummy deleted" nres=nres-1 -- 1.7.9.5