blue_cwl.variant

Variant entry.

Functions

iter_registered_variants()

Iterate over all variants in the registry.

search_variant_in_nexus(generator_name, ...)

Search for a variant with the given generator_name, variant_name, and version in nexus.

Classes

Variant(*[, description, wasAttributedTo, ...])

Variant class.

class blue_cwl.variant.Variant(*, description: str | None = None, wasAttributedTo: List[Agent] | None = None, wasGeneratedBy: Identifiable | None = None, wasDerivedFrom: List[Identifiable] | None = None, dateCreated: datetime | None = None, contribution: List[Contribution] | None = None, name: str, generatorName: str, variantName: str, version: str, distribution: DataDownload)

Variant class.

Method generated by attrs for class Variant.

property definition: CommandLineTool | Workflow

Return the cwl definition for this variant.

evolve(**changes) Variant

Create a new Variant instance with updated attributes.

Note: if ‘path’ is passed, a local distribution will be added in the new instance.

classmethod from_file(filepath: Path, generator_name: str, variant_name: str, version: str) Variant

Create Variant object from variant file definition.

classmethod from_id(resource_id: str, *, base: str | None = None, org: str | None = None, proj: str | None = None, use_auth: str | None = None, **kwargs)

Load entity from resource id.

classmethod from_registry(generator_name: str, variant_name: str, version: str) Variant

Create Variant object from registry entry.

Create a Variant instance by searching the Knowledge Graph.

get_content(*, token: str | None = None) dict

Return definition content.

property overview: str

Return detailed representation.

publish(*, update: bool = False, base: str | None = None, org: str | None = None, proj: str | None = None, token: str | None = None, **kwargs)

Publish or update Variant entity.

property tool_definition: CommandLineTool | Workflow

Return the cwl definition for this variant.

blue_cwl.variant.iter_registered_variants()

Iterate over all variants in the registry.

blue_cwl.variant.search_variant_in_nexus(generator_name: str, variant_name: str, version: str, *, base: str | None = None, org: str | None = None, proj: str | None = None, token: str | None = None, raise_if_not_found: bool = False) str | None

Search for a variant with the given generator_name, variant_name, and version in nexus.

Parameters:
  • generator_name – Generator’s name. Example: ‘cell_position’

  • variant_name – Variant’s name. Example: ‘neurons_cell_position’

  • version – The version of this variant’s definition. Example: ‘v1-dev’

  • base – Nexus instance base url.

  • org – Nexus organization.

  • proj – Nexus project.

  • token – Optional OAuth token.

  • raise_if_not_found – If True it raises an error if no variant is found.

Returns:

Variant’s id if a variant is found, None otherwise.