diff --git a/bin/README.md b/bin/README.md index dd062eee..2fc664f5 100644 --- a/bin/README.md +++ b/bin/README.md @@ -3,6 +3,6 @@ See [command line docs](http://ontobio.readthedocs.io/en/latest/commandline.html To test validate.py on a particular source: ```bash poetry install -poetry run validate produce -m ../go-site/metadata --gpad -t [path/to/local/ontobio/checkout] -o go-basic.json --only-dataset mgi MGI -poetry run validate produce -m ../go-site/metadata --gpad -t [path/to/local/ontobio/checkout] -o go-basic.json --only-dataset goa_chicken goa +poetry run validate produce -m ../go-site/metadata --gpad -t [path/to/local/ontobio/clone] -o go-basic.json --only-dataset mgi MGI +poetry run validate produce -m ../go-site/metadata --gpad -t [path/to/local/ontobio/clone] -o go-basic.json --only-dataset goa_chicken goa ``` diff --git a/bin/validate.py b/bin/validate.py index 6c7a368c..429da2e3 100755 --- a/bin/validate.py +++ b/bin/validate.py @@ -343,8 +343,6 @@ def make_gpads(dataset, gaf_path, products, ontology_graph, noctua_gpad_file): # Bail if we have no products return [] - with open(gaf_path) as sg: - lines = sum(1 for line in sg) # logger.info("AssocParserConfig used: {}".format(config)) split_source = os.path.split(gaf_path)[0] @@ -354,6 +352,10 @@ def make_gpads(dataset, gaf_path, products, ontology_graph, noctua_gpad_file): print("noctua-gpad-file: {}".format(noctua_gpad_file)) if noctua_gpad_file is not None: + + with open(noctua_gpad_file) as sg: + lines = sum(1 for line in sg) + with open(noctua_gpad_file) as nf: gpadparser = GpadParser(config=assocparser.AssocParserConfig( ontology=ontology_graph, @@ -365,6 +367,9 @@ def make_gpads(dataset, gaf_path, products, ontology_graph, noctua_gpad_file): for association in associations: gpadwriter.write_assoc(association) + with open(gaf_path) as sg: + lines = sum(1 for line in sg) + with open(gaf_path) as gf: gafparser = GafParser(config=assocparser.AssocParserConfig( ontology=ontology_graph,