示例#1
0
def deleteModelHierarchy(model_filename):

	doc = SbmlDocument()
	doc.readSbmlFromFile(model_filename)
	path = dirname(model_filename)

	if doc.useCompPackage:
		for dependency in doc.getExternalDocumentDependencies():
			deleteModelHierarchy(join(path, dependency))

	remove(model_filename)
示例#2
0
def deleteModelHierarchy(model_filename):

    doc = SbmlDocument()
    doc.readSbmlFromFile(model_filename)
    path = dirname(model_filename)

    if doc.useCompPackage:
        for dependency in doc.getExternalDocumentDependencies():
            deleteModelHierarchy(join(path, dependency))

    remove(model_filename)
示例#3
0
def getModelHierarchy(model_filename):

	doc = SbmlDocument()
	doc.readSbmlFromFile(model_filename)
	path = dirname(model_filename)
	deps = []
	if doc.useCompPackage:
		for dependency in doc.getExternalDocumentDependencies():
			deps.append(dependency)
			deps += getModelHierarchy(join(path, dependency))

	return deps
示例#4
0
def getModelHierarchy(model_filename):

    doc = SbmlDocument()
    doc.readSbmlFromFile(model_filename)
    path = dirname(model_filename)
    deps = []
    if doc.useCompPackage:
        for dependency in doc.getExternalDocumentDependencies():
            deps.append(dependency)
            deps += getModelHierarchy(join(path, dependency))

    return deps
示例#5
0
def copyModelHierarchy(model_filename):

	doc = SbmlDocument()
	doc.readSbmlFromFile(model_filename)
	path = dirname(model_filename)
	master_filename = new_model_filename()

	if doc.useCompPackage:
		deps = doc.getExternalDocumentDependencies()
		new_deps = {}
		for dependency in deps:
			new_deps.update({dependency: copyModelHierarchy(join(path, dependency))})

		doc.renameExternalDocumentDependencies(new_deps)

	doc.writeSbmlToFile(join(path, master_filename))
	return master_filename
示例#6
0
def copyModelHierarchy(model_filename):

    doc = SbmlDocument()
    doc.readSbmlFromFile(model_filename)
    path = dirname(model_filename)
    master_filename = new_model_filename()

    if doc.useCompPackage:
        deps = doc.getExternalDocumentDependencies()
        new_deps = {}
        for dependency in deps:
            new_deps.update(
                {dependency: copyModelHierarchy(join(path, dependency))})

        doc.renameExternalDocumentDependencies(new_deps)

    doc.writeSbmlToFile(join(path, master_filename))
    return master_filename