Command Line Interface

pysec2pri

pysec2pri – secondary-to-primary ID and label mapping.

Each source command returns ids and, where available, labels: the retired identifiers and superseded or alias labels that its current release states, as an SSSOM mapping set.

Sources vary in how much of their own history they keep, and some drop retired entries entirely. –consolidate goes over all available releases to recover the mappings the current release no longer states, and stamp every mapping with the release (date) it first appeared in.

Usage

pysec2pri [OPTIONS] COMMAND [ARGS]...

Options

--version

Show the version and exit.

ambiguous

Find ambiguous mappings for DATASOURCE and save as SSSOM.

DATASOURCE format: <config-id>-<kind>, e.g. hgnc-ids, chebi-labels, hmdb-metabolites-ids, wikidata-labels.

Usage

pysec2pri ambiguous [OPTIONS] {chebi-ids|chebi-labels|ensembl-ids|ensembl-
                    labels|hgnc-ids|hgnc-labels|hmdb-metabolites-ids|hmdb-
                    proteins-ids|ncbi-ids|ncbi-labels|uniprot-ids|vgnc-
                    ids|vgnc-labels|wikidata-ids|wikidata-labels}

Options

-o, --output <output>

Output file or directory.

--version <data_version>

Datasource release version.

--no-progress

Suppress progress bars.

Arguments

DATASOURCE

Required argument

chebi

ChEBI mappings.

Usage

pysec2pri chebi [OPTIONS] COMMAND [ARGS]...

ids

Usage

pysec2pri chebi ids [OPTIONS]

Options

--secondary-ids <secondary_ids>

Local secondary_ids file. Downloaded when omitted.

--compounds <compounds>

Local compounds file. Downloaded when omitted.

-o, --output <output>

Output file or directory.

--version <data_version>

Datasource release version.

--format <output_format>

Output format.

Default:

'sssom'

Options:

sssom | sec2pri | pri_ids | secondary | rdf | json | owl | all

--no-progress

Suppress progress bars.

--subset <subset>

Entry subset. 3star (3-star (curated, reviewed)); complete (Complete (all entries, including unreviewed)).

Default:

'complete'

Options:

3star | complete

--consolidate

Also recover mappings the current release no longer states, by walking the source’s past releases, and stamp each mapping with the release it first appeared in. Slow and network-heavy; resumable.

--cache-dir <cache_dir>

Where to keep the resumable –consolidate index. Defaults to this OS’s per-user cache directory, or $PYSEC2PRI_CACHE_DIR when set.

--force

With –consolidate, re-walk every release, ignoring resume state.

--from-version <from_version>

With –consolidate, lower bound (inclusive) on the release walk.

--to-version <to_version>

With –consolidate, upper bound (inclusive) on the release walk.

labels

Usage

pysec2pri chebi labels [OPTIONS]

Options

--names <names>

Local names file. Downloaded when omitted.

--compounds <compounds>

Local compounds file. Downloaded when omitted.

-o, --output <output>

Output file or directory.

--version <data_version>

Datasource release version.

--format <output_format>

Output format.

Default:

'sssom'

Options:

sssom | label_sec2pri | name2synonym | pri_labels | rdf | json | all

--no-progress

Suppress progress bars.

--subset <subset>

Entry subset. 3star (3-star (curated, reviewed)); complete (Complete (all entries, including unreviewed)).

Default:

'complete'

Options:

3star | complete

--consolidate

Also recover mappings the current release no longer states, by walking the source’s past releases, and stamp each mapping with the release it first appeared in. Slow and network-heavy; resumable.

--cache-dir <cache_dir>

Where to keep the resumable –consolidate index. Defaults to this OS’s per-user cache directory, or $PYSEC2PRI_CACHE_DIR when set.

--force

With –consolidate, re-walk every release, ignoring resume state.

--from-version <from_version>

With –consolidate, lower bound (inclusive) on the release walk.

--to-version <to_version>

With –consolidate, upper bound (inclusive) on the release walk.

diff

Compare two SSSOM mapping files and show differences.

Usage

pysec2pri diff [OPTIONS] FILE1 FILE2

Options

-o, --output <output>

Output file for diff results (TSV).

--show-all

Show all differences.

--datasource <datasource>

Datasource name for diff summary.

Arguments

FILE1

Required argument

FILE2

Required argument

ensembl

Ensembl mappings. Species: 10020=Kangaroo rat, 10029=Chinese hamster PICR, 10036=Golden Hamster, 10047=Mongolian gerbil, 100819=Common kestrel, 10089=Ryukyu mouse, 10090=Mouse NZO/HlLtJ, 10091=Mouse CAST/EiJ, 10092=Mouse WSB/EiJ, 10093=Shrew mouse, 10096=Western wild mouse, 10103=Steppe mouse, 10116=Rat - WKY/Bbb RGD_1581635, 10141=Guinea Pig, 10160=Degu, 10181=Naked mole-rat male, 1026970=Upper Galilee mountains blind mole rat, 103695=Central bearded dragon, 105023=Turquoise killifish, 106582=Zebra mbuna, 106734=Abingdon island giant tortoise, 109280=Tiger tail seahorse, 113540=Asian bonytongue, 1196302=New Caledonian crow, 1220523=Silver-eye, 123683=Javanese ricefish, 13146=Budgerigar, 132585=Pink-footed goose, 1328070=Greater bamboo lemur, 132908=Megabat, 13489=European seabass, 13616=Opossum, 13735=Chinese softshell turtle, 144197=Bicolor damselfish, 156563=Blue tit, 158456=Siamese fighting fish, 1608454=Blind barbel, 161767=Orange clownfish, 1676925=P. kingsleyae, 173247=Live sharksucker, and 236 more. See config/ensembl.yaml for the full list.

Usage

pysec2pri ensembl [OPTIONS] COMMAND [ARGS]...

ids

Usage

pysec2pri ensembl ids [OPTIONS]

Options

--stable-id-event <stable_id_event>

Local stable_id_event file. Downloaded when omitted.

--mapping-session <mapping_session>

Local mapping_session file. Downloaded when omitted.

--gene <gene>

Local gene file. Downloaded when omitted.

-o, --output <output>

Output file or directory.

--version <data_version>

Datasource release version.

--format <output_format>

Output format.

Default:

'sssom'

Options:

sssom | sec2pri | pri_ids | secondary | rdf | json | owl | all

--no-progress

Suppress progress bars.

--species <species>

Species as NCBI taxon ID, or ‘all’ to process every species. Known: 10020=Kangaroo rat, 10029=Chinese hamster PICR, 10036=Golden Hamster, 10047=Mongolian gerbil, 100819=Common kestrel, 10089=Ryukyu mouse, 10090=Mouse NZO/HlLtJ, 10091=Mouse CAST/EiJ, 10092=Mouse WSB/EiJ, 10093=Shrew mouse, 10096=Western wild mouse, 10103=Steppe mouse, 10116=Rat - WKY/Bbb RGD_1581635, 10141=Guinea Pig, 10160=Degu, 10181=Naked mole-rat male, 1026970=Upper Galilee mountains blind mole rat, 103695=Central bearded dragon, 105023=Turquoise killifish, 106582=Zebra mbuna, 106734=Abingdon island giant tortoise, 109280=Tiger tail seahorse, 113540=Asian bonytongue, 1196302=New Caledonian crow, 1220523=Silver-eye, 123683=Javanese ricefish, 13146=Budgerigar, 132585=Pink-footed goose, 1328070=Greater bamboo lemur, 132908=Megabat, 13489=European seabass, 13616=Opossum, 13735=Chinese softshell turtle, 144197=Bicolor damselfish, 156563=Blue tit, 158456=Siamese fighting fish, 1608454=Blind barbel, 161767=Orange clownfish, 1676925=P. kingsleyae, 173247=Live sharksucker, and 236 more. See config/ensembl.yaml for the full list. Other taxon IDs are resolved via Ensembl live species list; ‘all’ downloads and combines all ~276 species (slow, network-heavy).

Default:

'all'

--consolidate

Also recover mappings the current release no longer states, by walking the source’s past releases, and stamp each mapping with the release it first appeared in. Slow and network-heavy; resumable.

--cache-dir <cache_dir>

Where to keep the resumable –consolidate index. Defaults to this OS’s per-user cache directory, or $PYSEC2PRI_CACHE_DIR when set.

--force

With –consolidate, re-walk every release, ignoring resume state.

--from-version <from_version>

With –consolidate, lower bound (inclusive) on the release walk.

--to-version <to_version>

With –consolidate, upper bound (inclusive) on the release walk.

labels

Usage

pysec2pri ensembl labels [OPTIONS]

Options

--gene <gene>

Local gene file. Downloaded when omitted.

--xref <xref>

Local xref file. Downloaded when omitted.

--external-synonym <external_synonym>

Local external_synonym file. Downloaded when omitted.

-o, --output <output>

Output file or directory.

--version <data_version>

Datasource release version.

--format <output_format>

Output format.

Default:

'sssom'

Options:

sssom | label_sec2pri | name2synonym | pri_labels | rdf | json | all

--no-progress

Suppress progress bars.

--species <species>

Species as NCBI taxon ID, or ‘all’ to process every species. Known: 10020=Kangaroo rat, 10029=Chinese hamster PICR, 10036=Golden Hamster, 10047=Mongolian gerbil, 100819=Common kestrel, 10089=Ryukyu mouse, 10090=Mouse NZO/HlLtJ, 10091=Mouse CAST/EiJ, 10092=Mouse WSB/EiJ, 10093=Shrew mouse, 10096=Western wild mouse, 10103=Steppe mouse, 10116=Rat - WKY/Bbb RGD_1581635, 10141=Guinea Pig, 10160=Degu, 10181=Naked mole-rat male, 1026970=Upper Galilee mountains blind mole rat, 103695=Central bearded dragon, 105023=Turquoise killifish, 106582=Zebra mbuna, 106734=Abingdon island giant tortoise, 109280=Tiger tail seahorse, 113540=Asian bonytongue, 1196302=New Caledonian crow, 1220523=Silver-eye, 123683=Javanese ricefish, 13146=Budgerigar, 132585=Pink-footed goose, 1328070=Greater bamboo lemur, 132908=Megabat, 13489=European seabass, 13616=Opossum, 13735=Chinese softshell turtle, 144197=Bicolor damselfish, 156563=Blue tit, 158456=Siamese fighting fish, 1608454=Blind barbel, 161767=Orange clownfish, 1676925=P. kingsleyae, 173247=Live sharksucker, and 236 more. See config/ensembl.yaml for the full list. Other taxon IDs are resolved via Ensembl live species list; ‘all’ downloads and combines all ~276 species (slow, network-heavy).

Default:

'all'

--consolidate

Also recover mappings the current release no longer states, by walking the source’s past releases, and stamp each mapping with the release it first appeared in. Slow and network-heavy; resumable.

--cache-dir <cache_dir>

Where to keep the resumable –consolidate index. Defaults to this OS’s per-user cache directory, or $PYSEC2PRI_CACHE_DIR when set.

--force

With –consolidate, re-walk every release, ignoring resume state.

--from-version <from_version>

With –consolidate, lower bound (inclusive) on the release walk.

--to-version <to_version>

With –consolidate, upper bound (inclusive) on the release walk.

hgnc

HGNC mappings.

Usage

pysec2pri hgnc [OPTIONS] COMMAND [ARGS]...

ids

Usage

pysec2pri hgnc ids [OPTIONS]

Options

--withdrawn <withdrawn>

Local withdrawn file. Downloaded when omitted.

--complete <complete>

Local complete file. Downloaded when omitted.

-o, --output <output>

Output file or directory.

--version <data_version>

Datasource release version.

--format <output_format>

Output format.

Default:

'sssom'

Options:

sssom | sec2pri | pri_ids | secondary | rdf | json | owl | all

--no-progress

Suppress progress bars.

--consolidate

Also recover mappings the current release no longer states, by walking the source’s past releases, and stamp each mapping with the release it first appeared in. Slow and network-heavy; resumable.

--cache-dir <cache_dir>

Where to keep the resumable –consolidate index. Defaults to this OS’s per-user cache directory, or $PYSEC2PRI_CACHE_DIR when set.

--force

With –consolidate, re-walk every release, ignoring resume state.

--from-version <from_version>

With –consolidate, lower bound (inclusive) on the release walk.

--to-version <to_version>

With –consolidate, upper bound (inclusive) on the release walk.

labels

Usage

pysec2pri hgnc labels [OPTIONS]

Options

--complete <complete>

Local complete file. Downloaded when omitted.

-o, --output <output>

Output file or directory.

--version <data_version>

Datasource release version.

--format <output_format>

Output format.

Default:

'sssom'

Options:

sssom | label_sec2pri | name2synonym | pri_labels | rdf | json | all

--no-progress

Suppress progress bars.

--consolidate

Also recover mappings the current release no longer states, by walking the source’s past releases, and stamp each mapping with the release it first appeared in. Slow and network-heavy; resumable.

--cache-dir <cache_dir>

Where to keep the resumable –consolidate index. Defaults to this OS’s per-user cache directory, or $PYSEC2PRI_CACHE_DIR when set.

--force

With –consolidate, re-walk every release, ignoring resume state.

--from-version <from_version>

With –consolidate, lower bound (inclusive) on the release walk.

--to-version <to_version>

With –consolidate, upper bound (inclusive) on the release walk.

hmdb-metabolites

HMDB Metabolites mappings.

Usage

pysec2pri hmdb-metabolites [OPTIONS] COMMAND [ARGS]...

ids

Usage

pysec2pri hmdb-metabolites ids [OPTIONS]

Options

--metabolites <metabolites>

Local metabolites file. Downloaded when omitted.

-o, --output <output>

Output file or directory.

--version <data_version>

Datasource release version.

--format <output_format>

Output format.

Default:

'sssom'

Options:

sssom | sec2pri | pri_ids | secondary | rdf | json | owl | all

--no-progress

Suppress progress bars.

hmdb-proteins

HMDB Proteins mappings.

Usage

pysec2pri hmdb-proteins [OPTIONS] COMMAND [ARGS]...

ids

Usage

pysec2pri hmdb-proteins ids [OPTIONS]

Options

--proteins <proteins>

Local proteins file. Downloaded when omitted.

-o, --output <output>

Output file or directory.

--version <data_version>

Datasource release version.

--format <output_format>

Output format.

Default:

'sssom'

Options:

sssom | sec2pri | pri_ids | secondary | rdf | json | owl | all

--no-progress

Suppress progress bars.

list-versions

List the releases DATASOURCE keeps in its archive.

Only sources whose config declares an archive_url have one; the rest publish their current release only.

Usage

pysec2pri list-versions [OPTIONS] {chebi|ensembl|hgnc|uniprot}

Arguments

DATASOURCE

Required argument

ncbi

NCBI Gene mappings. Species: 10029=Chinese hamster, 10036=Golden hamster, 10090=House mouse, 10116=Norway rat, 10141=Domestic guinea pig, 10181=Naked mole-rat, 109461=Honeybee mite, 11320=Influenza A virus, 11676=Human immunodeficiency virus 1, 1280=Staphylococcus aureus, 1313=Streptococcus pneumoniae, 13616=Gray short-tailed opossum, 1423=Bacillus subtilis, 15368=Stiff brome, 1773=Mycobacterium tuberculosis, 210=Helicobacter pylori, 2190=Methanocaldococcus jannaschii, 2697049=Severe acute respiratory syndrome coronavirus 2, 27679=Bolivian squirrel monkey, 28377=Green anole, 287=Pseudomonas aeruginosa, 28901=Salmonella enterica, 29760=Wine grape, 30538=Alpaca, 31033=Torafugu, 3635=Cotton, 3641=Cacao, 3659=Cucumber, 3694=Black cottonwood, 3702=Thale cress, 3708=Rape, 3847=Soybean, 3880=Barrel medic, 3983=Cassava, 4081=Tomato, 4113=Potato, 44689=Dictyostelium discoideum, 4513=Barley, 4530=Asian cultivated rice, 4558=Sorghum, and 86 more. See config/ncbi.yaml for the full list.

Usage

pysec2pri ncbi [OPTIONS] COMMAND [ARGS]...

ids

Usage

pysec2pri ncbi ids [OPTIONS]

Options

--gene-history <gene_history>

Local gene_history file. Downloaded when omitted.

--gene-info <gene_info>

Local gene_info file. Downloaded when omitted.

-o, --output <output>

Output file or directory.

--version <data_version>

Datasource release version.

--format <output_format>

Output format.

Default:

'sssom'

Options:

sssom | sec2pri | pri_ids | secondary | rdf | json | owl | all

--no-progress

Suppress progress bars.

--species <species>

Species as NCBI taxon ID, or ‘all’ to process every species. Known: 10029=Chinese hamster, 10036=Golden hamster, 10090=House mouse, 10116=Norway rat, 10141=Domestic guinea pig, 10181=Naked mole-rat, 109461=Honeybee mite, 11320=Influenza A virus, 11676=Human immunodeficiency virus 1, 1280=Staphylococcus aureus, 1313=Streptococcus pneumoniae, 13616=Gray short-tailed opossum, 1423=Bacillus subtilis, 15368=Stiff brome, 1773=Mycobacterium tuberculosis, 210=Helicobacter pylori, 2190=Methanocaldococcus jannaschii, 2697049=Severe acute respiratory syndrome coronavirus 2, 27679=Bolivian squirrel monkey, 28377=Green anole, 287=Pseudomonas aeruginosa, 28901=Salmonella enterica, 29760=Wine grape, 30538=Alpaca, 31033=Torafugu, 3635=Cotton, 3641=Cacao, 3659=Cucumber, 3694=Black cottonwood, 3702=Thale cress, 3708=Rape, 3847=Soybean, 3880=Barrel medic, 3983=Cassava, 4081=Tomato, 4113=Potato, 44689=Dictyostelium discoideum, 4513=Barley, 4530=Asian cultivated rice, 4558=Sorghum, and 86 more. See config/ncbi.yaml for the full list.

Default:

'9606'

--consolidate

Also recover mappings the current release no longer states, by walking the source’s past releases, and stamp each mapping with the release it first appeared in. Slow and network-heavy; resumable.

--cache-dir <cache_dir>

Where to keep the resumable –consolidate index. Defaults to this OS’s per-user cache directory, or $PYSEC2PRI_CACHE_DIR when set.

--force

With –consolidate, re-walk every release, ignoring resume state.

--from-version <from_version>

With –consolidate, lower bound (inclusive) on the release walk.

--to-version <to_version>

With –consolidate, upper bound (inclusive) on the release walk.

labels

Usage

pysec2pri ncbi labels [OPTIONS]

Options

--gene-info <gene_info>

Local gene_info file. Downloaded when omitted.

-o, --output <output>

Output file or directory.

--version <data_version>

Datasource release version.

--format <output_format>

Output format.

Default:

'sssom'

Options:

sssom | label_sec2pri | name2synonym | pri_labels | rdf | json | all

--no-progress

Suppress progress bars.

--species <species>

Species as NCBI taxon ID, or ‘all’ to process every species. Known: 10029=Chinese hamster, 10036=Golden hamster, 10090=House mouse, 10116=Norway rat, 10141=Domestic guinea pig, 10181=Naked mole-rat, 109461=Honeybee mite, 11320=Influenza A virus, 11676=Human immunodeficiency virus 1, 1280=Staphylococcus aureus, 1313=Streptococcus pneumoniae, 13616=Gray short-tailed opossum, 1423=Bacillus subtilis, 15368=Stiff brome, 1773=Mycobacterium tuberculosis, 210=Helicobacter pylori, 2190=Methanocaldococcus jannaschii, 2697049=Severe acute respiratory syndrome coronavirus 2, 27679=Bolivian squirrel monkey, 28377=Green anole, 287=Pseudomonas aeruginosa, 28901=Salmonella enterica, 29760=Wine grape, 30538=Alpaca, 31033=Torafugu, 3635=Cotton, 3641=Cacao, 3659=Cucumber, 3694=Black cottonwood, 3702=Thale cress, 3708=Rape, 3847=Soybean, 3880=Barrel medic, 3983=Cassava, 4081=Tomato, 4113=Potato, 44689=Dictyostelium discoideum, 4513=Barley, 4530=Asian cultivated rice, 4558=Sorghum, and 86 more. See config/ncbi.yaml for the full list.

Default:

'9606'

--consolidate

Also recover mappings the current release no longer states, by walking the source’s past releases, and stamp each mapping with the release it first appeared in. Slow and network-heavy; resumable.

--cache-dir <cache_dir>

Where to keep the resumable –consolidate index. Defaults to this OS’s per-user cache directory, or $PYSEC2PRI_CACHE_DIR when set.

--force

With –consolidate, re-walk every release, ignoring resume state.

--from-version <from_version>

With –consolidate, lower bound (inclusive) on the release walk.

--to-version <to_version>

With –consolidate, upper bound (inclusive) on the release walk.

uniprot

UniProt mappings.

Usage

pysec2pri uniprot [OPTIONS] COMMAND [ARGS]...

ids

Usage

pysec2pri uniprot ids [OPTIONS]

Options

--sec-ac <sec_ac>

Local sec_ac file. Downloaded when omitted.

--delac-sp <delac_sp>

Local delac_sp file. Downloaded when omitted.

-o, --output <output>

Output file or directory.

--version <data_version>

Datasource release version.

--format <output_format>

Output format.

Default:

'sssom'

Options:

sssom | sec2pri | pri_ids | secondary | rdf | json | owl | all

--no-progress

Suppress progress bars.

--consolidate

Also recover mappings the current release no longer states, by walking the source’s past releases, and stamp each mapping with the release it first appeared in. Slow and network-heavy; resumable.

--cache-dir <cache_dir>

Where to keep the resumable –consolidate index. Defaults to this OS’s per-user cache directory, or $PYSEC2PRI_CACHE_DIR when set.

--force

With –consolidate, re-walk every release, ignoring resume state.

--from-version <from_version>

With –consolidate, lower bound (inclusive) on the release walk.

--to-version <to_version>

With –consolidate, upper bound (inclusive) on the release walk.

update-ids

Resolve secondary IDs in INPUT_FILE to primary IDs using DATASOURCE.

Reads the –at column and writes a new column with each ID’s current one.

An ID that is both retired and still current is ambiguous: there is no safe answer, so the new column is left empty for that row. To resolve those, give a hint: another column of the same row saying which entry it means. All hints are optional.

–synonyms names a column of names for the row. –xref names a column of identifiers from another vocabulary, and needs a table to read them against: –xref-file for your own, or –xref-source to download one DATASOURCE’s config lists. –report writes down every decision.

Examples:

pysec2pri update-ids genes.tsv hgnc --at gene_id -o out.tsv
pysec2pri update-ids genes.tsv hgnc --at gene_id --synonyms label
pysec2pri update-ids genes.tsv hgnc --at gene_id --xref ensembl \\
    --xref-source hgnc_custom --xref-on ensembl --report decisions.tsv

Usage

pysec2pri update-ids [OPTIONS] INPUT_FILE {chebi|ensembl|hgnc|hmdb_metabolites
                     |hmdb_proteins|ncbi|uniprot|vgnc|wikidata}

Options

--at <COLUMN>

Required Column(s) containing IDs to resolve. Repeat for multiple.

-o, --output <output_path>

Output file (TSV or CSV).

--suffix <suffix>

New-column suffix.

Default:

'_primary'

--sep <sep>

Delimiter (inferred from extension if omitted).

--mapping <mapping_file>

Pre-built sec2pri TSV file (skips download).

--synonyms <COLUMN>

Hint column paired with –at column. Repeat to pair each.

--synonyms-mapping <synonyms_mapping_file>

Pre-built label/label mapping file for alias resolution.

--xref <COLUMN>

Column holding an identifier from another vocabulary for the same row, as a hint. Pairs with –at, and needs –xref-file or –xref-source.

--xref-file <xref_file>

Table saying which of this source’s entries each –xref value belongs to (SSSOM or plain TSV).

--xref-source <xref_source>

Same as –xref-file, but downloaded: name one of the crosswalks DATASOURCE’s config lists, e.g. ‘hgnc_custom’.

--xref-on <xref_on>

Which vocabulary the –xref values are from, e.g. ensembl/entrez/refseq/uniprot. Required with –xref-source.

--xref-predicate <PREDICATE>

Accepted equivalence predicate(s) for xref records. Repeat for multiple. Default accepts any predicate (and unannotated records).

--report <report_path>

Write a per-decision audit log (TSV) for context-based resolutions.

--version <data_version>

Datasource release version.

--no-progress

Suppress progress bars.

Arguments

INPUT_FILE

Required argument

DATASOURCE

Required argument

update-labels

Resolve previous/alias labels in INPUT_FILE to current labels using DATASOURCE.

Reads the –at column and writes a new column with each label’s current one.

A label that is both old and still in use for something else is ambiguous: there is no safe answer, so the new column is left empty for that row. To resolve those, give a hint: another column of the same row saying which entry it means. All hints are optional.

–synonyms names a column of names for the row. –xref names a column of identifiers from another vocabulary, and needs a table to read them against: –xref-file for your own, or –xref-source to download one DATASOURCE’s config lists. –report writes down every decision.

Examples:

pysec2pri update-labels genes.tsv hgnc --at label -o out.tsv
pysec2pri update-labels genes.tsv hgnc --at label --mapping labels.tsv
pysec2pri update-labels genes.tsv hgnc --at label --xref ensembl \\
    --xref-source hgnc_custom --xref-on ensembl --report decisions.tsv

Usage

pysec2pri update-labels [OPTIONS] INPUT_FILE
                        {chebi|ensembl|hgnc|ncbi|vgnc|wikidata}

Options

--at <COLUMN>

Required Column(s) containing labels to resolve. Repeat for multiple.

-o, --output <output_path>

Output file (TSV or CSV).

--suffix <suffix>

New-column suffix.

Default:

'_current'

--sep <sep>

Delimiter (inferred from extension if omitted).

--mapping <mapping_file>

Pre-built label2prev TSV file (skips download).

--synonyms <COLUMN>

Hint column paired with –at column. Repeat to pair each.

--synonyms-mapping <synonyms_mapping_file>

Pre-built mapping file for alias resolution.

--xref <COLUMN>

Column holding an identifier from another vocabulary for the same row, as a hint. Pairs with –at, and needs –xref-file or –xref-source.

--xref-file <xref_file>

Table saying which of this source’s entries each –xref value belongs to (SSSOM or plain TSV).

--xref-source <xref_source>

Same as –xref-file, but downloaded: name one of the crosswalks DATASOURCE’s config lists, e.g. ‘hgnc_custom’.

--xref-on <xref_on>

Which vocabulary the –xref values are from, e.g. ensembl/entrez/refseq/uniprot. Required with –xref-source.

--xref-predicate <PREDICATE>

Accepted equivalence predicate(s) for xref records. Repeat for multiple. Default accepts any predicate (and unannotated records).

--report <report_path>

Write a per-decision audit log (TSV) for context-based resolutions.

--species <species>

Species as NCBI taxon ID. Defaults to DATASOURCE config default when omitted; run ‘pysec2pri DATASOURCE labels –help’ to see its known species.

--entity-type <entity_type>

Wikidata entity type to query. Queries all if omitted.

Options:

chemicals | genes | proteins

--subset <subset>

Entry subset. Defaults to DATASOURCE’s configured subset when omitted.

--version <data_version>

Datasource release version.

--no-progress

Suppress progress bars.

Arguments

INPUT_FILE

Required argument

DATASOURCE

Required argument

validate-config

Validate one (or, if omitted, every) datasource config YAML.

Examples:

pysec2pri validate-config
pysec2pri validate-config hgnc

Usage

pysec2pri validate-config [OPTIONS] [DATASOURCE]

Arguments

DATASOURCE

Optional argument

vgnc

VGNC mappings. Species: 1737458=Capuchin, 1868482=Tarsier, 30608=Mouse lemur, 30611=Bushbaby, 336983=Angola colobus, 37293=Ma’s night monkey, 379532=Coquerel’s sifaka, 39432=Bolivian squirrel monkey, 60711=Vervet-AGM, 61383=Canada lynx, 61621=Black snub-nosed monkey, 61853=Gibbon, 74533=Tiger, 8508=Tuatara, 8823=Great spotted kiwi, 9483=Marmoset, 9531=Sooty mangabey, 9541=Crab-eating macaque, 9544=Macaque, 9545=Pig-tailed macaque, 9555=Olive baboon, 9568=Drill, 9597=Bonobo, 9598=Chimpanzee, 9615=Dog, 9685=Cat, 9689=Lion, 9691=Leopard, 9796=Horse, 9823=Pig, 9913=Cattle, 9925=Goat.

Usage

pysec2pri vgnc [OPTIONS] COMMAND [ARGS]...

ids

Usage

pysec2pri vgnc ids [OPTIONS]

Options

--withdrawn <withdrawn>

Local withdrawn file. Downloaded when omitted.

--complete <complete>

Local complete file. Downloaded when omitted.

-o, --output <output>

Output file or directory.

--version <data_version>

Datasource release version.

--format <output_format>

Output format.

Default:

'sssom'

Options:

sssom | sec2pri | pri_ids | secondary | rdf | json | owl | all

--no-progress

Suppress progress bars.

--species <species>

Species as NCBI taxon ID, or ‘all’ to process every species. Known: 1737458=Capuchin, 1868482=Tarsier, 30608=Mouse lemur, 30611=Bushbaby, 336983=Angola colobus, 37293=Ma’s night monkey, 379532=Coquerel’s sifaka, 39432=Bolivian squirrel monkey, 60711=Vervet-AGM, 61383=Canada lynx, 61621=Black snub-nosed monkey, 61853=Gibbon, 74533=Tiger, 8508=Tuatara, 8823=Great spotted kiwi, 9483=Marmoset, 9531=Sooty mangabey, 9541=Crab-eating macaque, 9544=Macaque, 9545=Pig-tailed macaque, 9555=Olive baboon, 9568=Drill, 9597=Bonobo, 9598=Chimpanzee, 9615=Dog, 9685=Cat, 9689=Lion, 9691=Leopard, 9796=Horse, 9823=Pig, 9913=Cattle, 9925=Goat.

Default:

'all'

--consolidate

Also recover mappings the current release no longer states, by walking the source’s past releases, and stamp each mapping with the release it first appeared in. Slow and network-heavy; resumable.

--cache-dir <cache_dir>

Where to keep the resumable –consolidate index. Defaults to this OS’s per-user cache directory, or $PYSEC2PRI_CACHE_DIR when set.

--force

With –consolidate, re-walk every release, ignoring resume state.

--from-version <from_version>

With –consolidate, lower bound (inclusive) on the release walk.

--to-version <to_version>

With –consolidate, upper bound (inclusive) on the release walk.

labels

Usage

pysec2pri vgnc labels [OPTIONS]

Options

--complete <complete>

Local complete file. Downloaded when omitted.

-o, --output <output>

Output file or directory.

--version <data_version>

Datasource release version.

--format <output_format>

Output format.

Default:

'sssom'

Options:

sssom | label_sec2pri | name2synonym | pri_labels | rdf | json | all

--no-progress

Suppress progress bars.

--species <species>

Species as NCBI taxon ID, or ‘all’ to process every species. Known: 1737458=Capuchin, 1868482=Tarsier, 30608=Mouse lemur, 30611=Bushbaby, 336983=Angola colobus, 37293=Ma’s night monkey, 379532=Coquerel’s sifaka, 39432=Bolivian squirrel monkey, 60711=Vervet-AGM, 61383=Canada lynx, 61621=Black snub-nosed monkey, 61853=Gibbon, 74533=Tiger, 8508=Tuatara, 8823=Great spotted kiwi, 9483=Marmoset, 9531=Sooty mangabey, 9541=Crab-eating macaque, 9544=Macaque, 9545=Pig-tailed macaque, 9555=Olive baboon, 9568=Drill, 9597=Bonobo, 9598=Chimpanzee, 9615=Dog, 9685=Cat, 9689=Lion, 9691=Leopard, 9796=Horse, 9823=Pig, 9913=Cattle, 9925=Goat.

Default:

'all'

--consolidate

Also recover mappings the current release no longer states, by walking the source’s past releases, and stamp each mapping with the release it first appeared in. Slow and network-heavy; resumable.

--cache-dir <cache_dir>

Where to keep the resumable –consolidate index. Defaults to this OS’s per-user cache directory, or $PYSEC2PRI_CACHE_DIR when set.

--force

With –consolidate, re-walk every release, ignoring resume state.

--from-version <from_version>

With –consolidate, lower bound (inclusive) on the release walk.

--to-version <to_version>

With –consolidate, upper bound (inclusive) on the release walk.

wikidata

Wikidata mappings.

Usage

pysec2pri wikidata [OPTIONS] COMMAND [ARGS]...

ids

Usage

pysec2pri wikidata ids [OPTIONS]

Options

-o, --output <output>

Output file or directory.

--version <data_version>

Datasource release version.

--format <output_format>

Output format.

Default:

'sssom'

Options:

sssom | sec2pri | pri_ids | secondary | rdf | json | owl | all

--no-progress

Suppress progress bars.

--entity-type <entity_type>

Wikidata entity type to query. Queries all if omitted.

Options:

chemicals | genes | proteins

--test-subset

Use test SPARQL queries (LIMIT 10).

labels

Usage

pysec2pri wikidata labels [OPTIONS]

Options

-o, --output <output>

Output file or directory.

--version <data_version>

Datasource release version.

--format <output_format>

Output format.

Default:

'sssom'

Options:

sssom | label_sec2pri | pri_labels | rdf | json | all

--no-progress

Suppress progress bars.

--entity-type <entity_type>

Wikidata entity type to query. Queries all if omitted.

Options:

chemicals | genes | proteins

--test-subset

Use test SPARQL queries (LIMIT 10).