Commit 0205044a authored by Davide Lagoa's avatar Davide Lagoa
Browse files

params to file

parent e3f95ea4
......@@ -77,14 +77,11 @@ def submit():
"Model": "Model must be in .xml format or a list of metabolites in .txt format (one metabolite per line)",
"Taxonomy ID": "Input must only contain digits"}), 406
logger.info("Taxonomy identifier: " + taxonomyId)
logger.info("Database: " + dbs)
logger.info("Ontologies: " + ontologies)
return run(files, taxonomyId, dbs, ontologies, False)
@app.route("/submitMerlinPlugin/<taxonomyId>", methods=["POST"])
def submitMerlinPlugin(taxonomyId):
@app.route("/submitMerlinPlugin/<taxonomyId>/<dbs>/<ontologies>", methods=["POST"])
def submitMerlinPlugin(taxonomyId, dbs, ontologies):
logger.info('Merlin plugin submission')
files = request.files.getlist("file")
......@@ -97,11 +94,14 @@ def submitMerlinPlugin(taxonomyId):
"Model": "Model must be in .xml format or a list of metabolites in .txt format (one metabolite per line)",
"Taxonomy ID": "Input must only contain digits"}), 406
return run(files, taxonomyId, True)
return run(files, taxonomyId, dbs, ontologies, True)
def run(files, taxonomyId, dbs, ontologies, isRest):
logger.debug('New submission in progress...')
logger.info('New submission in progress...')
logger.info("Taxonomy identifier: " + taxonomyId)
logger.info("Database: " + dbs)
logger.info("Ontologies: " + ontologies)
total = len(os.listdir(SUBMISSIONS_PATH))
......@@ -152,15 +152,19 @@ def run(files, taxonomyId, dbs, ontologies, isRest):
logger.info("taxID -> " + taxonomyId)
logger.info("inputCheck -> " + str(inputCheck))
with open("/".join([submission_path, "databases.txt"]), "w") as dbsFile:
dbsFile.write(dbs) # write databases file
# taxonomy = taxonomy + '#' + dbs + '#' + ontologies
# with open("/".join([submission_path, "databases.txt"]), "w") as dbsFile:
# dbsFile.write(dbs) # write databases file
with open("/".join([submission_path, "ontologies.txt"]), "w") as ontoFile:
ontoFile.write(ontologies) # write ontologies file
# with open("/".join([submission_path, "ontologies.txt"]), "w") as ontoFile:
# ontoFile.write(ontologies) # write ontologies file
if inputCheck in validInputs:
with open("/".join([submission_path, "taxID.txt"]), "w") as taxFile:
taxFile.write(taxonomyId) # write TaxonomyID file
with open("/".join([submission_path, "params.txt"]), "w") as paramsFile:
paramsFile.write(taxonomy) # write TaxonomyID to file
paramsFile.write(dbs) # write databases to file
paramsFile.write(ontologies) # write ontologies to file
else:
return jsonify({"Genome": "Input genome must be in .faa or .fasta format",
......
......@@ -95,10 +95,10 @@
<div class="input-group">
<span class="input-group-addon">Database</span>
<select name="database" class="selectpicker form-control">
<option value="metacyc">MetaCyc</option>
<option value="modelseed">ModelSEED</option>
<option value="kegg">KEGG</option>
<option value="bigg">BiGG</option>
<option value="modelseed">ModelSEED</option>
<option value="metacyc">MetaCyc</option>
</select>
</div>
</div>
......
from neo4jPythonDriver import neo4jPythonDriver
def database_retriever_by_id(id):
url = 'bolt://palsson.di.uminho.pt:7688'
url = 'bolt://palsson.di.uminho.pt:7687'
user = 'neo4j'
password = 'password'
......
......@@ -82,7 +82,7 @@ def run():
files = {
'model': open(processingPath + modelFile, 'rb'),
'taxonomyId': open(processingPath + 'taxID.txt', 'rb'),
'params': open(processingPath + 'paramsID.txt', 'rb'),
'genome': open(processingPath + 'genome.faa', 'rb')}
logger.info("Sending request to start to " + str(workerID))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment