Exemplo n.º 1
0
# pub_ns = parsed.load_data('pubchem_namespace')
mesh = parsed.load_data("mesh")
do = parsed.load_data("do")

# does NOT include pubchem currently
ns_data = [ei, hg, mg, rg, sp, af, chebi, gobp, gocc, mesh, schem, do, sdis]
for d in ns_data:
    if verbose:
        print("Generating namespace file for " + str(d))
    namespaces.make_namespace(d, verbose)
print("Phase III ran in " + str(((time.time() - interval_time) / 60)) + " minutes")

print("\n======= Phase IV, building annotations =======")
# There are 3 .belanno files to generate from the MeSH dataset.
interval_time = time.time()
annotate.make_annotations(mesh)
print("Phase IV ran in " + str(((time.time() - interval_time) / 60)) + " minutes")

print("\n======= Phase V, building equivalences =======")
# Any datasets producing a .beleq file should be added to equiv_data
interval_time = time.time()
equiv_data = [ei, hg, mg, rg, sp, af, chebi, gobp, gocc, do, mesh, sdis_to_do, schem_to_chebi]
for d in equiv_data:
    if verbose:
        print("Generating equivalence file for " + str(d))
    equiv.equiv(d, verbose)
print("Phase V ran in " + str(((time.time() - interval_time) / 60)) + " minutes")

print("\n======= Phase VI, finished! =======")
print("Total runtime: " + str(((time.time() - start_time) / 60)) + " minutes")
if args.begin_phase > 2:
	# need to reload some data into parsed objects since they are needed by eqiv:
	#  - meshd 			...needs... do
	parsed.do_data = object_dict.get('do_data')
	#  - affy           ...needs... g2
	parsed.gene2acc_data = object_dict.get('gene2acc_data')

# equiv_root_data should include string names for each namespacedataset used as a 'root' for equivalence
equiv_root_data = ['egid_data','hgnc_data', 'mgi_data', 'rgd_data', 'gobp_data', 'chebi_data', 'gocc_data', 'do_data', 'meshc_data']
for data_name in equiv_root_data:
	data = object_dict.get(data_name)
	if data:
		if verbose:
			print('Generating equivalence file for ' + str(data))
		equiv.equiv(data, verbose)
# now make equivalences for namespace datasets that are not root
for data_name, data in object_dict.items():
	# skip equiv root datasets handled above
	if data_name in equiv_root_data:
		continue
	elif isinstance(data, NamespaceDataSet) and 'ns' in data.scheme_type:
		if verbose:
			print('Generating equivalence file for ' + str(data))
		equiv.equiv(data, verbose)

print('Phase V ran in %.3f minutes' % ((time.time() - interval_time) / 60))

print('\n======= Phase VI, finished! =======')
print('Total runtime: %.3f minutes' % ((time.time() - start_time) / 60))
# vim: ts=4 sts=4 sw=4 noexpandtab
Exemplo n.º 3
0
    parsed.do_data = object_dict.get('do_data')
    #  - affy           ...needs... g2
    parsed.gene2acc_data = object_dict.get('gene2acc_data')

# equiv_root_data should include string names for each namespacedataset
# used as a 'root' for equivalence
equiv_root_data = [
    'egid_data', 'hgnc_data', 'mgi_data', 'rgd_data', 'gobp_data',
    'chebi_data', 'gocc_data', 'do_data', 'meshc_data'
]
for data_name in equiv_root_data:
    data = object_dict.get(data_name)
    if data:
        if verbose:
            print('Generating equivalence file for ' + str(data))
        equiv.equiv(data, verbose)
# now make equivalences for namespace datasets that are not root
for data_name, data in object_dict.items():
    # skip equiv root datasets handled above
    if data_name in equiv_root_data:
        continue
    elif isinstance(data, NamespaceDataSet) and 'ns' in data.scheme_type:
        if verbose:
            print('Generating equivalence file for ' + str(data))
        equiv.equiv(data, verbose)

print('Phase V ran in %.3f minutes' % ((time.time() - interval_time) / 60))

print('\n======= Phase VI, finished! =======')
print('Total runtime: %.3f minutes' % ((time.time() - start_time) / 60))