Skip to content

csv-to-babeltests: --resolve-from-label (NameRes-assisted CURIE population) #78

Description

@gaurav

Summary

When a CSV has label/name columns but no CURIE column (or a sparsely-populated one), the tool should fall back to a NameRes lookup(label, limit=1) call to fill in the CURIE automatically.

Proposed interface

csv-to-babeltests input.csv \
  --label-column "Gene Name" \
  --resolve-from-label            # use NameRes to fill --curie-column
  --target dev

If --label-column is set and --curie-column is absent or the CURIE cell is empty for a given row, call CachedNameRes.lookup(label, limit=1) and use the top result's curie field as the CURIE for that row. Emit a # resolved from label: <label> comment (or a stderr note) for traceability.

Implementation notes

  • CachedNameRes already exists at src/babel_validation/services/nameres.py; its lookup() method returns a list of {curie, label, score, ...} dicts — take result[0]["curie"] when the list is non-empty.
  • load_nodenorm_url in csv_to_babeltests.py could be extended to also return the NameResURL from targets.ini (it's already in every target section).
  • Should warn to stderr when no result is found (lookup returns []).
  • Useful for workflows where only names/synonyms are available, e.g. spreadsheets exported from literature-mining tools.

Related

This tool is being developed at #77

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions