Skip to content

Commit

Permalink
null safe noctua file
Browse files Browse the repository at this point in the history
  • Loading branch information
sierra-moxon committed Feb 1, 2024
1 parent dcdab0e commit 76fdb9d
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions bin/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,16 +352,17 @@ def make_gpads(dataset, gaf_path, products, ontology_graph, noctua_gpad_file):
outfile = open(validated_gpad_path, "w")
gpadwriter = GpadWriter(file=outfile, version="GPAD_2_0")

with open(noctua_gpad_file) as nf:
gpadparser = GpadParser(config=assocparser.AssocParserConfig(
ontology=ontology_graph,
paint=False,
))

click.echo("Making noctua gpad products...")
with click.progressbar(iterable=gpadparser.association_generator(file=nf), length=lines) as associations:
for association in associations:
gpadwriter.write_assoc(association)
if noctua_gpad_file is not None:
with open(noctua_gpad_file) as nf:
gpadparser = GpadParser(config=assocparser.AssocParserConfig(
ontology=ontology_graph,
paint=False,
))

click.echo("Making noctua gpad products...")
with click.progressbar(iterable=gpadparser.association_generator(file=nf), length=lines) as associations:
for association in associations:
gpadwriter.write_assoc(association)

with open(gaf_path) as gf:
gafparser = GafParser(config=assocparser.AssocParserConfig(
Expand Down Expand Up @@ -644,6 +645,8 @@ def produce(ctx, group, metadata_dir, gpad, ttl, target, ontology, exclude, base
make_gpads(dataset, end_gaf, products, ontology_graph, noctua_gpad_src)




@cli.command()
@click.pass_context
@click.option("--gpad_path", "-g", type=click.Path(), required=True)
Expand Down

0 comments on commit 76fdb9d

Please sign in to comment.