コード例 #1
0
        h.resultfile = resultfile
    fileName, fileExtension = os.path.splitext(setupfile)
    if export_json:
        print("expot json recipe ", fileName)
        h.saveRecipe(fileName + ".json", useXref=useXref, indent=True)
    if check_result:
        rfile = h.resultfile
        resultfilename = autopack.retrieveFile(rfile, cache="results")
        if resultfilename is None:
            print("no result for " + n + " " + h.version + " " + rfile)
            sys.exit()
        print("get the result file from ", resultfilename)
        result, orgaresult, freePoint = h.loadResult(
            resultfilename=resultfilename, restore_grid=False,
            backward=True)  #load text ?#this will restore the grid
        ingredients = h.restore(result, orgaresult, freePoint)
#        print ("json ?",h.result_json)
#        if export_json :
#            fileName, fileExtension = os.path.splitext(resultfilename)
#            h.store_asJson(n+"_result.json",indent=False)#fileName+"1.json",indent=False)
#            print ("ok ",n+"_result.json",fileName+".json")
    if mixedJson and export_json:
        #special case for HIV
        import json
        import numpy
        if HIV:
            with open("/home/ludo/biomthiv.json",
                      'r') as fp:  #doesnt work with symbol link ?
                jsondic = json.load(fp)  #,indent=4, separators=(',', ': ')
            matrices = jsondic.values()  #3*4
            newm = []
コード例 #2
0
from autopack.Environment import Environment

filename = "/home/ludo/hivexp/BloodHIV1.0.json"
#filename ="/home/ludo/hivexp/HIVimature1.0.json"
fileName, fileExtension = os.path.splitext(filename)
n = os.path.basename(fileName)
h = Environment(name=n)
#h.helper = helper
recipe = n
h.loadRecipe(filename)
#previousresult = "/home/ludo/hivexp/BloodHIV1.0_mixed.json"
#previousresult = "/home/ludo/hivexp/BloodHIV1.0_centered.json"
previousresult = "/home/ludo/hivexp/BloodHIV1.0_mixed_tr.json"
r = h.loadResult(previousresult, transpose=True)  #
ingredients = h.restore(*r)

from autopack.lipids import lipidsCG
#generate the membrane
lcg = lipidsCG()
comp = h.compartments[0]
lcg.coverShape(comp.vertices, comp.vnormals)
#remove lipids overlaping
posrot = lcg.arrayOfBeads
#save again with lipids ?

#fix HIV1_CA_mono_0_1_0
#center is [405.609,1000.253,377.306]
# if apply the center on all instance ? meanings rotate the center and apply it

#h.saveRecipe("/home/ludo/hivexp/BloodHIV1.0_noref.json",useXref=False,mixed=True,result=False,grid=False,packing_options=True,indent=True,quaternion=True)