[gmx-users] K channel set up

Bright LomSak slphyx at netscape.net
Wed Jun 5 14:35:39 CEST 2002


Sawasdee(hello)

I try to set up the system of K+ channel. I don't know why I can not make the tpr file. 
Here are what I do.

Protein
-download 1BL8.pdb from Protein Data bank www.rcsb.org/pdb/
-Repair protein structure by SwissPdbViewer ---> save as kcsa.pdb
-editconf -f kcsa.pdb -o kcsa_A.pdb -rotate 0 20 0

Lipid Bilayer
-download popc128a.pdb, popc.itp, lipid.itp from http://indigo1.biop.ox.ac.th/tieleman/download.html

convert pdb to gro by editconf 
-editconf -f popc128a.pdb -o popc128a.gro
-pdb2gmx -f kcsa_A.pdb -o kcsa_A.gro -p topol.top (I select 1 for protein only)
-editconf -f kcsa_A.gro -o kcsa.gro -box 6.23910 6.17970 6.91950

protein insertion
substract protein from lipid bilayers by subtract program (p2cb)
-p2cb kcsa.gro popc128a.gro subpopc.gro 0.25(p2cb is a program for substract protein from bilayer. If it's not true please tell me.)
-delete the last line of subpopc.gro and first two lines of kcsa.gro
-cat subpopc.gro kcsa.gro > sys.gro
-fill the number of system atoms in the second line of sys.gro

-make the MD parameters file --> md.mdp 
-make the system topology file --> sys.top

Make the tpr file by grompp
-grompp -f md.mdp -c sys.gro -p sys.top -o sys.tpr


Thank you
Mr.Sompob Saralamba (M.Sc. student)
Department of Physics
Mahidol University Thailand



-------------------------------------------
sys.top
#include "ffgmx.itp"
#include "ffgmx2.itp"
#include "lipid.itp"
#include "popc.itp"
#include "topol_A.itp"

#ifdef FLEX_SPC
#include "flexspc.itp"
#else
#include "spc.itp"
#endif

[ system ]
; name
KcsA +  popc

[ molecules ]
; name  number
Protein 4
POPC    52
SOL     2098



-------------------------------------------
p2cb.c
#include<stdio.h>
#include<stdlib.h>

#define sqr(x)  ((x)*(x))
#define SIZE 20000  /*system size*/
#define YES 1
#define NO 0


main(argc,argv)
int argc;
char *argv[];
{
    int residuenr,atomnr;
    int chk,i,j,k,kept;
    int lipidatom,proatom,cline,grp,grptmp[SIZE];
    FILE *lipid,*pro,*out;
    char line[100],linetmp[100],residuename[8],atomname[8];
    float x,y,z,vx,vy,vz,vdwr;
    float proxmin,proxmax,proymin,proymax,prozmin,prozmax;
    float protx[SIZE],proty[SIZE],protz[SIZE];
    char *BUFF[SIZE],BOX[100];

        if(argc !=5){
        printf("BILAYER - PROTEIN\n");
        printf("usage:%s pro.gro lipid.gro out.gro vwd_radius\n",argv[0]);
        exit(1);
        }

        if((pro=fopen(argv[1],"r"))==NULL){
        printf("Can't open %s\n",argv[1]);exit(1);}
        if((lipid=fopen(argv[2],"r"))==NULL){
        printf("Can't open %s\n",argv[2]);exit(1);}
        if((out=fopen(argv[3],"w"))==NULL){
        printf("Can't write %s\n",argv[3]);exit(1);}

/*read VDW Radius */
        printf("\nVWD Radius: ");
        vdwr=atof(argv[4]);
        printf("%.3f nm\n",vdwr);

/*read PROTEIN*/
//count line
        cline=0;
        while(fgets(line,sizeof(line),pro)!=NULL&&line[0]!='\n')
                cline=cline+1;

        printf("\n%s\n",argv[1]);
        printf("Read: %d lines\n",cline);
        printf("=====Protein=====\n");

        rewind(pro);

        fgets(line,sizeof(line),pro); /*show title*/
        fputs(line,stdout);
        fgets(line,sizeof(line),pro);/*show number of atoms*/
        sscanf(line,"%d",&proatom);
        printf("Read: %d atoms\n",proatom);

        /*find max min*/
        fgets(line,sizeof(line),pro);
sscanf(line,"%5d%5s%5s%5d%8f%8f%8f%8f%8f%8f",
    &residuenr,residuename,atomname,&atomnr,&x,&y,&z,&vx,&vy,&vz);
        protx[0]=x;proty[0]=y;protz[0]=z;
        proxmin=x;proymin=y;prozmin=z;
        proxmax=x;proymax=y;prozmax=z;

for(i=1;i<cline-3;i++){
        fgets(line,sizeof(line),pro);
sscanf(line,"%5d%5s%5s%5d%8f%8f%8f%8f%8f%8f",
    &residuenr,residuename,atomname,&atomnr,&x,&y,&z,&vx,&vy,&vz);

        protx[i]=x;proty[i]=y;protz[i]=z;

        if(x<proxmin)
                proxmin=x;
        if(x>proxmax)
                proxmax=x;
        if(y<proymin)
                proymin=y;
        if(z<prozmin)
                prozmin=z;
        if(z>prozmax)
                prozmax=z;
}
printf("xmin=%.3f ymin=%.3f zmin=%.3f\n",proxmin,proymin,prozmin);
printf("xmax=%.3f ymax=%.3f zmax=%.3f\n",proxmax,proymax,prozmax);

/* read lipid bilayer */
//count line
        cline=0;
        while(fgets(line,sizeof(line),lipid)!=NULL&&line[0]!='\n')
                cline=cline+1;
                
        printf("\n%s\n",argv[2]);
        printf("Read: %d lines\n",cline);
        
        rewind(lipid);

        printf("=====Lipid bilayer=====\n");
        fgets(line,sizeof(line),lipid); /*show lipids title*/
        fputs(line,stdout);
        fgets(line,sizeof(line),lipid);/*show number of atoms*/
        sscanf(line,"%d",&lipidatom);
        printf("Read: %d atoms\n",lipidatom);

/*check*/     
k=0;
for(i=2;i<cline-1;i++)
{
    fgets(line,sizeof(line),lipid);
sscanf(line,"%5d%5s%5s%5d%8f%8f%8f%8f%8f%8f",
    &residuenr,residuename,atomname,&atomnr,&x,&y,&z,&vx,&vy,&vz);

  if((x>proxmin&&x<proxmax)||(y>proymin&&y<proymax)||(z>prozmin&&z<prozmax))
  {
    for(j=0;j<proatom;j++){
    if(sqr(vdwr)>(sqr(protx[j]-x)+sqr(proty[j]-y)+sqr(protz[j]-z))){
                grptmp[k]=residuenr;
        k++;  
                break;
    }
    }
  }

}
    fgets(BOX,sizeof(BOX),lipid);


   rewind(lipid);
   fprintf(out,"##%s-%s##\n",argv[2],argv[1]);
   fgets(line,sizeof(line),lipid);
   fprintf(out,"\n");
   fgets(line,sizeof(line),lipid);
   
/* write data */
kept=0;
   for(i=2;i<cline-1;i++){
        chk=YES;
        fgets(line,sizeof(line),lipid);
sscanf(line,"%5d%5s%5s%5d%8f%8f%8f%8f%8f%8f",
    &residuenr,residuename,atomname,&atomnr,&x,&y,&z,&vx,&vy,&vz);

        for(j=0;j<k;j++){
                if(grptmp[j]==residuenr){
                        chk=NO;
                        break;
                }
        }
        if(chk==YES){
                fputs(line,out);
        kept++;
    }
   }

        fputs(BOX,out);

    
printf("Keep %5d atoms \n",kept);


fclose(pro);fclose(lipid);fclose(out);

return 0;
}
------------------------------------------------------





__________________________________________________________________
Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop at Netscape! http://shopnow.netscape.com/

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/




More information about the gromacs.org_gmx-users mailing list