Пример #1
0
            trj = "{0}{1}".format(base_path, trajectoryFile[idx])
            print "Reading PSF: " + psf
            print "Reading DCD: " + trj
            u = Universe(psf, trj)
            print "{0} is done!".format(idx)

            # read based on frame
            for ts in u.trajectory:
                # tclock = cnt;
                cnt = cnt + 1
                if (cnt % frmInt) == 0:
                    # ======= Centeralization =========
                    if cntQry != "no":
                        # print "Centeralization..."
                        # stanalyzer.centerByCOM(ts, u, cntQry);
                        stanalyzer.centerByRes2(ts, u, cntQry, 1, cntAxs)
                        # 1st residue is always chosen for centering membrane
                        # print "DONE!"
                        # ==================================

                    tmp_time = float(cnt) * float(num_ps) - float(num_ps)
                    STMP.append(tmp_time)
                    print "[{0}ps]selecting atoms...".format(tmp_time)
                    selAtoms = u.selectAtoms(selQry)
                    print "DONE!"
                    if len(selAtoms) > 1:
                        # get coordinates
                        CRDs = selAtoms.coordinates()
                        MASS = selAtoms.masses()
                        ELEC = stanalyzer.getAtomNumber(selAtoms.names())
Пример #2
0
	    for ts in u.trajectory:
		# flag for top and bottom leaflet
		top_flag = 0; btm_flag = 0;
		
		cnt = cnt + 1;
		
		if (cnt % ST_frmInt) == 0:
		    num_frm = num_frm + 1.0;
		    
		    #######################################################
		    ############## Write your code below ##################
		    #######################################################
		    
		    #======= Centeralization =========
		    if (cntQry != 'no') :
			stanalyzer.centerByRes2(ts, u, cntQry, 1, cntAxs); # 1st residue is always chosen for centering membrane
		    #==================================
    
		    #############################################
		    #### Calculating top and bottom layer #######
		    #############################################
		    ####################
		    #----> top leaflet
		    ####################
		    #print "#top_selQry = {}".format(top_selQry);
		    top_Atoms = u.selectAtoms(top_selQry);
		    top_Res = top_Atoms.resnames();
		    top_IDs = top_Atoms.resids();
		    if len(top_Res) > 0:
			top_flag = top_flag + 1;
			for i in range(len(top_Res)):
Пример #3
0
	    
	    # reading trajectory
	    trj = '{0}{1}'.format(base_path, trajectoryFile[idx]);
	    print 'Reading PSF: ' + psf
	    print 'Reading DCD: ' + trj
	    u = Universe(psf, trj);
	    
	    # read based on frame
	    for ts in u.trajectory:
		cnt = cnt + 1;
		if (cnt % frmInt) == 0:
		    #======= Centeralization =========
		    if (cntQry != 'no') :
			#print "Centeralization..."
			#stanalyzer.centerByCOM(ts, u, cntQry);
			stanalyzer.centerByRes2(ts, u, cntQry, 1, cntAxs); # 1st residue is always chosen for centering membrane
			#print "DONE!"
		    #==================================
		    
		    tmp_time = float(cnt) * float(num_ps) - float(num_ps);
		    STMP.append(tmp_time);
		    #print "[{0}ps]selecting atoms...".format(tmp_time);
		    selAtoms = u.selectAtoms(selQry);
		    CRDs = selAtoms.coordinates();
		    #print "DONE!"
		    posZ = [];
		    negZ = [];
		    if len(selAtoms) > 1:
			# finding 'P' haivng positive value in 'z' axis
			for p_idx in CRDs:
			    z = p_idx[2];
            allCRDs = allAtoms.coordinates()
            print '{0} is done!'.format(idx)

            # read based on frame
            for ts in u.trajectory:

                # reading system size at each frame
                sysX = ts.dimensions[0]
                sysY = ts.dimensions[1]
                sysZ = ts.dimensions[2]

                #======= Centeralization =========
                if (cntQry != 'no'):
                    #print "Centeralization..."
                    #stanalyzer.centerByCOM(ts, u, cntQry);
                    stanalyzer.centerByRes2(ts, u, cntQry, 1, cntAxs)
                    # 1st residue is always chosen for centering membrane
                    #print "DONE!"
                #==================================
                tmp_time = float(cnt) * float(num_ps) - float(num_ps)

                # defining unit vector
                if taxis == 'X':
                    top_cut = sysX * 0.165
                    btm_cut = -1.0 * top_cut
                    top_selQry = "segid {} and resname {} and (prop x > {})".format(
                        segID, resName, top_cut)
                    btm_selQry = "segid {} and resname {} and (prop x < {})".format(
                        segID, resName, btm_cut)

                elif taxis == 'Y':