Skip to content
Snippets Groups Projects
Commit 3ced64e2 authored by Mouhamadou Ba's avatar Mouhamadou Ba
Browse files

Update softwares/scripts/to-html.py

parent 5391591b
No related branches found
No related tags found
Loading
import os
import pandas
import csv
import json
def get_score(jfile, entityList = ["Standard scoring"], corpus = "BB" , task = "BB-norm"):
dict = {"Corpus":[], "Task":[], "Pairing":[], "Score Scope":[], "Score Name": [], "Value": []}
data = json.load(open(jfile))
for d in (data['evaluation'])['global-evaluations']:
scorings = d['scorings']
for s in scorings:
if s['name'] in entityList:
for m in s['measures']:
dict["Corpus"].append(corpus)
dict["Task"].append(task)
dict["Pairing"].append(d['name'])
dict["Score Scope"].append(s['name'])
dict["Score Name"].append(m['name'])
dict["Value"].append(m['value'])
return dict
def get_score_norm(jfile):
return get_score(jfile, entityList = ["Standard scoring", "Habitats", "Phenotypes", "Microorganisms"], corpus = "BB19" , task = "BB-norm")
def get_score_kb(jfile):
return get_score(jfile, entityList = ["Standard scoring"], corpus = "BB" , task = "BB-kb")
def get_score_rel(jfile):
return get_score(jfile, entityList = ["Standard scoring", "Lives_In and Exhibits", "Lives_In", "Exhibits"], corpus = "BB" , task = "BB-rel")
# Main
if __name__ == '__main__':
import sys
from optparse import OptionParser, OptionGroup
optparser = OptionParser(usage="%extract data from genbank bank")
group = OptionGroup(optparser, "Main Options", "")
optparser.add_option("-t", "--file", default="None", dest="taxo_ref", help="", metavar="FILE")
optparser.add_option("-d", "--task", default="None", dest="db_path", help="", metavar="FILE")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment