コード例 #1
0
if len(sys.argv) > 1:
    filename = sys.argv[1]
    resultfile = None
    if filename in autopack.RECIPES:
        n = filename
        v = sys.argv[2]
        filename = autopack.RECIPES[n][v]["setupfile"]
        resultfile = autopack.RECIPES[n][v]["resultfile"]
    else:
        resultfile = sys.argv[2]
    setupfile = autopack.retrieveFile(filename, cache="recipes")
    print("ok use ", setupfile, filename, resultfile)
    fileName, fileExtension = os.path.splitext(setupfile)
    n = os.path.basename(fileName)
    h = Environment(name=n)
    h.loadRecipe(setupfile)
    h.setupfile = filename
    if resultfile is not None:
        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(
コード例 #2
0
helper = autopack.helper
if helper is None and not NOGUI:
    import upy
    helperClass = upy.getHelperClass()
    helper = helperClass()
else:
    import upy
    helperClass = upy.getHelperClass()
    helper = helperClass(vi="nogui")
autopack.helper = helper
recipe = "D:\\Data\\cellPACK_data\\cellPACK_database_1.1.0\\recipes\\HIV_VLP.1.1.json"  #127
filename = recipe  #"/Users/ludo/DEV/autopack_git/autoPACK_database_1.0.0/recipes/NM_Analysis_FigureA1.0.xml"
fileName, fileExtension = os.path.splitext(filename)
n = os.path.basename(fileName)
h = Environment(name=n)
#h.helper = helper
recipe = n
h.loadRecipe(filename)
#recenter ingredient position according center.
#should manually do the mesh ?
for c in h.compartments:
    for ingr in c.surfaceRecipe.ingredients:
        ingr.positions = np.array(ingr.positions) - np.array(ingr.offset)
        ingr.sphereFile = None
#save the recipe
h.version = "1.2"
h.saveRecipe(
    "D:\\Data\\cellPACK_data\\cellPACK_database_1.1.0\\recipes\\HIV_VLP.1.2.json",
    useXref=False,
    format_output="json")
コード例 #3
0
resultfile = "D:\\Data\\cellPACK_data\\Mycoplasma\\Mpn_Results_H" + tr + ".json"  # or Tr
workingdir = "D:\\Data\\cellPACK_data\\Mycoplasma\\"

workingdir = "D:\\Data\\cellPACK_data_git\\influenza\Influenza\\"
recipefile = "Influenza_3.json"
resultfile = ""

#workingdir ="C:\Users\ludov\OneDrive\Documents\cellVIEW-i\Data\\"
#recipefile="christmas.json"

fileName, fileExtension = os.path.splitext(recipefile)
n = os.path.basename(fileName)
h = Environment(name=n)
#h.helper = helper
recipe = n
h.loadRecipe(workingdir + recipefile)

# save a full recipe no Xref
#"nbMol": nbmol,
#"molarity" : ingr.molarity,
#"source": ingr.source,
#"positions":ingr.positions,
#"radii":ingr.radii}

rname = workingdir + "recipes\\BloodHIVMycoRB_full.1.0.json"
rname = workingdir + "recipes\\Mycoplasma1.7.json"
rname = workingdir + recipefile
#h.saveRecipe(rname,useXref=False,mixed=True,
#                     kwds=["source","name","nbMol","molarity","positions","radii"],result=True,
#                   grid=False,packing_options=False,indent=False,quaternion=True)
if resultfile != "":