Example #1
0
                    center_c = np.array(data) - np.average(data,axis=0)
                    np.savetxt(data_folder+os.sep+pdbname+"_cl.txt",data)
                else :
                    data=np.loadtxt(pdb_directory+os.sep+pdbname+"_cl.txt")
                    center_c = data - np.average(data,0)  
            pointscloud, mesh_pts = helper.PointCloudObject("atoms_"+name,
                                        vertices=center_c,parent=parent)
            if os.path.isfile(pdb_directory+os.sep+pdbname+"_kmeans15.txt") : 
                cluster = np.loadtxt(pdb_directory+os.sep+pdbname+"_kmeans15.txt")
                if (cluster.shape==(3,)) :
                    cluster = [cluster,]
                pointscloud, mesh_pts = helper.PointCloudObject("cluster_"+name,
                                        vertices=cluster,parent=parent)
#h.loopThroughIngr(doIngredientVOX)
print h.totalNBBeads/22.0#avg nbbeads*total ninstance ~ 40000
h.loopThroughIngr(dsClusterAtoms)


#execfile("C:\\Users\\ludov\\OneDrive\\Documents\\autoPACK\\autopack\\scripts\\sblSphereTree.py")
#DEBUG VISUAL
#BUILD ATOMcLOUD FOR SPHERETREE AND ATOMCOORDAINTES FOR EVERY INGREDIENTS


#from autopack.IOutils import serializedRecipe, saveResultBinary
#djson = serializedRecipe(h, False, True, lefthand = True)
#f=open("/opt/data/dev/cellPACK/cellPACK_data_git/cellPACK_database_1.1.0/recipes/Mycoplasma1.6_serialized.json", "w")
#f.write(djson[0])
#f.close()

#h.saveRecipe("/home/ludo/hivexp/BloodHIV1.0.full.json", useXref=False, mixed=True, kwds=["source","name"], result=False, grid=True, packing_options=True, indent=False, quaternion=True)
#h.saveRecipe("/opt/data/dev/cellPACK/cellPACK_data_git/cellPACK_database_1.1.0/recipes/Mycoplasma1.6_full.json", useXref=False, mixed=True, result=False, grid=True, packing_options=True, indent=False, quaternion=True)
Example #2
0
    ingr.jitterMax =[ingr.encapsulatingRadius,ingr.encapsulatingRadius,0.0]
#    if ingr.packingMode != "gradient":
#        ingr.molarity = 0.0
#        ingr.nbMol = 0
#        print ingr.name
def setCompartment(ingr):
#    ingr.checkCompartment=True
#    ingr.compareCompartment=True#slow down a little.
#    ingr.nbMol*=2
    ingr.rejectionThreshold=100#[1,1,0]#
#    ingr.jitterMax =[ingr.encapsulatingRadius/(25.*1.1547),ingr.encapsulatingRadius/(25.*1.1547),0.0]
#    ingr.cutoff_boundary=ingr.encapsulatingRadius
#    ingr.cutoff_boundary=500+ingr.encapsulatingRadius
    ingr.nbJitter = 6
#   
h.loopThroughIngr(setCompartment)
#setJitter
#raw_input()
if ANALYSIS:
#    h.placeMethod="RAPID"
    h.encapsulatingGrid=0
    autopack.testPeriodicity = False
    analyse = AnalyseAP(env=h, viewer=afviewer, result_file=None)
    output="/Users/ludo/DEV/autoPACKresults/NM_Analysis_C2"
    analyse.g.Resolution = 1.0
    h.boundingBox=numpy.array(h.boundingBox)
    fbox_bb=numpy.array(h.boundingBox)
#    h.boundingBox[0]-=numpy.array([500.0,500.0,0.0])    
#    h.boundingBox[1]+=numpy.array([500.0,500.0,0.0])
    d=analyse.doloop(1000,h.boundingBox,wrkDir,output,rdf=True,
                     render=False,twod=TWOD,use_file=True)#,fbox_bb=fbox_bb)
Example #3
0
    d=analyse.doloop(5,h.boundingBox,wrkDir,output,rdf=True,
                     render=False,twod=TWOD,use_file=True)#,fbox_bb=fbox_bb)
#    if not NOGUI :
#        afviewer.displayFill() 
else :
    autopack.testPeriodicity = False
    gridfile = "D:\\Data\\cellPACK_data\\Mycoplasma\\grid_store"
    h.placeMethod="RAPID"
    h.saveResult = True
    resultfilename = h.resultfile = "D:\\Data\\cellPACK_data\\Mycoplasma\\Mpn_Results_july"
    h.innerGridMethod = "trimesh" 
    h.smallestProteinSize = 80.0
    h.freePtsUpdateThrehod=0.0
    #remove HUE,RIBO,DNAPOLY,PEPTIDE,RNA,DNA,Lipo
    filterOutFiber(h)        
    h.loopThroughIngr(setJitter)
    h.buildGrid(boundingBox=h.boundingBox,gridFileIn=gridfile,rebuild=True ,gridFileOut=gridfile,previousFill=False)
    h.fill5(verbose = 0,usePP=usePP)
    h.collectResultPerIngredient()
    h.saveRecipe("D:\\Data\\cellPACK_data\\Mycoplasma\\Mpn_Results_H_1.json",useXref=False,mixed=True, kwds=["source","name"],result=True, transpose = True,  grid=False,packing_options=False,indent=False,quaternion=True) 
    h.saveRecipe("D:\\Data\\cellPACK_data\\Mycoplasma\\Mpn_Results_H_2.json",useXref=False,mixed=True, kwds=["source","name"],result=True, transpose = False, grid=False,packing_options=False,indent=False,quaternion=True) 

    from autopack.IOutils import serializedRecipe, saveResultBinary, toBinary
    djson, all_pos, all_rot = serializedRecipe(h,False,True,True,True)#transpose, use_quaternion, result=False, lefthand=False
    with open("D:\\Data\\cellPACK_data\\Mycoplasma\\Mpn_Results_serialized.json","w") as f:
        f.write(djson)
    
    from autopack.Serializable import sCompartment,sIngredientGroup,sIngredient,sIngredientFiber
    sCompartment.static_id = 0;sIngredientFiber.static_id = 0;sIngredient.static_id = [0, 0, 0];sIngredientGroup.static_id= 0;djson, all_pos1, all_rot1 = serializedRecipe(h,True,True,True,True);toBinary(all_pos1, all_rot1,"C:\\Users\\ludov\\OneDrive\\Documents\\OnlinePacking_Tobias\\cellVIEW-OP\\Data\\Mpn_2.0_serializedTR_L.bin")     
    sCompartment.static_id = 0;sIngredientFiber.static_id = 0;sIngredient.static_id = [0, 0, 0];sIngredientGroup.static_id= 0;djson, all_pos2, all_rot2 = serializedRecipe(h,False,True,True,True);toBinary(all_pos2, all_rot2,"C:\\Users\\ludov\\OneDrive\\Documents\\OnlinePacking_Tobias\\cellVIEW-OP\\Data\\Mpn_2.0_serialized_L.bin")     
    sCompartment.static_id = 0;sIngredientFiber.static_id = 0;sIngredient.static_id = [0, 0, 0];sIngredientGroup.static_id= 0;djson, all_pos3, all_rot3 = serializedRecipe(h,False,True,True,False);toBinary(all_pos3, all_rot3,"C:\\Users\\ludov\\OneDrive\\Documents\\OnlinePacking_Tobias\\cellVIEW-OP\\Data\\Mpn_2.0_serialized.bin")