def main(): """ """ ARGS = IO() #Load the Hinge Information filename = ARGS.filename chain = ARGS.chain dr = float(ARGS.dr) power = float(ARGS.power) #File loading mol = molecule.load_structure(filename) if (chain is not None): calpha = [i for i in mol[0][chain].get_calpha()] else: calpha = [i for i in mol[0].get_calpha()] Model = ANM([i.get_location() for i in calpha], atoms=calpha, dr=dr, power=power) Model.calculate_hessian() Model.calculate_decomposition() for i in range(6, 17, 1): Model.calculate_movie(i, scale=2, n=20) return True
def main(): """ """ ARGS = IO() #Load the Hinge Information filename = ARGS.filename chain = ARGS.chain dr = float(ARGS.dr) power = float(ARGS.power) #File loading mol = molecule.load_structure(filename) #Chain, if specified, if not, default (Box) if (chain is not None): calpha = [i for i in mol[0][chain].get_calpha() if i is not None] else: calpha = [i for i in mol[0].get_calpha() if i is not None] Model = hdANM(calpha, dr=dr, power=power, hng_file=ARGS.hngfile) #Model.calculate_hessian(mass_type='unit') #Model.calculate_hessian(mass_type='atom') Model.calculate_hessian(mass_type='residue') Model.calculate_decomposition() for i in range(6, 17, 1): Model.calculate_movie(i, scale=20, n=10) #Model.calculate_fluctuations() return True
def main(): ARGS = IO() filename = ARGS.filename chain = ARGS.chain alpha_start = float(ARGS.begin) alpha_stop = float(ARGS.end) step_size = float(ARGS.step_size) if(ARGS.outfilename=='output.hng'): output_file = open(filename+'.hng', 'w', encoding='UTF-8') else: output_file = open(ARGS.outfilename, 'w', encoding='UTF-8') mol = molecule.load_structure(filename) if(chain==None): for i in [i.get_id() for i in mol[0].get_chains()]: backbone = [k for j in mol[0][i].get_backbone() for k in j if k is not None] output=hinge_scanner(backbone,filename,alpha_start,alpha_stop,step_size) for j in output:output_file.write(j) else: backbone = [j for i in mol[0][chain].get_backbone() for j in i if j is not None] output=hinge_scanner(backbone,filename,alpha_start,alpha_stop,step_size) for i in output:output_file.write(i) output_file.flush() output_file.close() return True
def main(): """ """ ARGS = IO() #Load the Hinge Information filename = ARGS.filename chain = ARGS.chain dr = ARGS.dr power = ARGS.power HNGinfo = {} for i in open(ARGS.hngfile): line = i.strip().split() HNGinfo[line[0] + '_' + line[1]] = [float(j) for j in line[2].split(':')] #File loading mol = molecule.load_structure(filename) if (chain is not None): calpha = [i for i in mol[0][chain].get_atoms()] else: calpha = [i for i in mol[0].get_atoms()] Model = RDANM(calpha, dr=dr, power=power, HNGinfo=HNGinfo) #Model.calculate_coarse_grained_hessian(mass_type='unit') Model.calculate_coarse_grained_hessian(mass_type='atom') #Model.calculate_coarse_grained_hessian(mass_type='residue') Model.calculate_decomposition() for i in range(6, 17, 1): Model.calculate_movie(i, scale=0.5, n=20) #Model.calculate_fluctuations() return True
from packman.utilities import superimporse from packman.molecule import load_structure mol1 = load_structure('1K20/1k20.pdb') mol2 = load_structure('1K20/1k23.pdb') superimporse(mol1[0]['A'], mol2[0]['A'], use='backbone')
def main(): """ """ ARGS = IO() try: #Load the Hinge Information filename = ARGS.filename chain = ARGS.chain dr = float(ARGS.dr) power = float(ARGS.power) ##@ResearchIT PAGE/ SECTION 1 (Title: Input File) #@ResearchIT, this is the part where we give user an option to either download or upload the file so next line will be optional if user selects to upload the file. if (ARGS.pdbid is not None): mol = molecule.download_structure(ARGS.pdbid, filename) mol = molecule.load_structure(filename) #@ResearchIT Chain, if specified, if not, All #Message on the website: This server allows C-alpha atoms only because of the computational constraints; however, the all-atom model can run using PACKMAN - hdANM API on the user's computer. Please refer to the following page. #https://py-packman.readthedocs.io/en/latest/tutorials/hdANM.html#tutorials-hdanm if (chain is not None): calpha = [i for i in mol[0][chain].get_calpha() if i is not None] else: calpha = [i for i in mol[0].get_calpha() if i is not None] ##@ResearchIT PAGE/ SECTION 2 #Arguments #dr= cutoff value (float) #power = Power of Distance (float) #Mass = Unit or Molecular Weight of the Residue (only two options so dropdown miight work) #Message of the website: hdANM also requires the user to provide the .hng file containing the information about which parts of the protein are hinges and which parts are rigid domains. This information can be obtained from the PACKMAN’s hinge prediction algorithm. Please read the following for more details: https://packman.bb.iastate.edu/ #Hinge Information file format (.hng) Example: #Code block: #1exr.pdb_A D1 1:70 #1exr.pdb_A H1 71:90 #1exr.pdb_A D2 91:148 #The first column in the .hng file is Filename_ChainID, the second column is Domain/Hinge ID, and the third column is the residues in the particular domain/hinge. The .hng file is tab-separated. (Tabs separate columns) #@ResearchIT, is it possible to give an optino to add hinge and domains from the interface line by line (optional to the file upload) #eg... user given dropdown box saying 'add new hinge'/ 'add new domain'. If user selects 'add new hinge', they will get two text boxes asking for filename_chainID (first column) and residue range (last column) whereas hinge id will be calculated automatically H1,H2.... so on. and same for the domain. Model = hdANM(calpha, dr=dr, power=power, hng_file=ARGS.hngfile) Model.calculate_hessian(mass_type=ARGS.mass) Model.calculate_decomposition() numpy.savetxt("eigenvalues.csv", Model.get_eigenvalues(), delimiter=",") numpy.savetxt("eigenvectors.csv", Model.get_eigenvectors(), delimiter=",") ##@ResearchIT PAGE/ SECTION 3 #For more details on the curvilinear projection (movie) please read: #parameters here #ARGS.modes: How many modes do you want to get a curvilinear projection (movie)? (Note: First non-rigid mode is 6.pdb; Second non-rigid mode is 67.pdb and so on) #Scale: Scale for the movie #Frames: Number of frames you want in the movies. #Message on Website: Eigenvalues and Eigenvector indecies start from 0 (includes rigid body motion) for i in range(6, 6 + ARGS.modes, 1): Model.calculate_movie(i, scale=ARGS.scale, n=ARGS.frames) if ARGS.nodeid is not None: urllib.request.urlopen(ARGS.callbackurl + '/' + str(ARGS.nodeid) + "/0") except Exception: if ARGS.nodeid is not None: urllib.request.urlopen(ARGS.callbackurl + '/' + str(ARGS.nodeid) + "/1") return True
import sklearn #with open('namestring.txt', 'r') as f: #namestring=f.read().split(",") #leng=len(namestring) #names=[] ''' for i in range(0,leng): #print(namestring[i]) molecule.download_structure(namestring[i],(namestring[i]+'.pdb')) ''' #molecule.download_structure('4KXV','4KXV.pdb') mol=molecule.load_structure('4KXV.pdb') restricted_res=['ALA','GLY'] ang_dist=() tl=[] name=[] Data={} for i in mol[0].get_residues(): for j in mol[0].get_residues(): if(i.get_id() < j.get_id() and i.get_name() not in restricted_res and j.get_name() not in restricted_res): res1_vec=i.get_calpha().get_location() - i.get_tip().get_location()