Skip to Content
ReferenceAPIData types

Data types

Every type is a Dataset carrying the dimensions inferred from its file. The subtypes differ in which dimensions apply to them.

Dataset

class Dataset(core: '_core.Dataset') -> 'None'

Data of a known kind, carrying the dimensions inferred from it.

Dataset.applicable

applicable: tuple[str, ...] # property

The dimensions that mean anything for this kind of data.

A dimension outside this set is not a gap to be filled in: asking a FASTA for its quality encoding is a category error.

Dataset.contigs

contigs: list[Contig] | None # property

The contigs of the reference this data is on, in file order.

Dataset.dimension

dimension(self, name: 'str') -> 'DimensionValue | None'

One dimension’s value, or None if it is unknown or inapplicable.

Dataset.dimensions

dimensions: Mapping[str, DimensionValue] # property

Every dimension that has a known value, by name.

Dataset.file

file: str # property

The file this data is, for code that has to open it.

path is the honest answer to “where did this come from, if anywhere?”, so it can be None — a step’s output carries dimensions worked out before anything ran, and has no file of its own until it does. This is the answer for the other question, the one a lg.write body asks:

return lg.write(lambda out: interpret(v.file, out))

Inside that function the steps above have run, so there is a file, and saying so in the type is what keeps a body from having to prove it.

Raises

RaisesWhen
ValueErrorIf this data has no file behind it at all.

Dataset.files

files: tuple[str, ...] # property

Every file this data is, in order.

One for most kinds and two for a pair of FASTQ mates, in mate order. file names the primary one, which is what a message quotes; this is what code that has to open all of them wants.

Dataset.kind

kind: str # property

The name of the kind of data this holds.

Dataset.notes

notes: tuple[str, ...] # property

What loading this noticed, as one sentence each.

Usually empty. A note is not a failure and never stops anything: it is something true of the data that you cannot act on without being told. A gene list is the file this exists for — its symbols can arrive already corrupted by a spreadsheet, which is a fact about the input rather than about any step, so no step’s output could report it.

Dataset.origin

origin: RemoteOrigin | None # property

Where this was fetched from, or None if it was not fetched.

The overwhelming majority of inputs are files somebody has, and for those this says nothing by being None.

Dataset.path

path: str | None # property

The file this was loaded from.

Dataset.samples

samples: list[str] | None # property

The samples this data covers, in order.

Dataset.unknown_reason

unknown_reason(self, name: 'str') -> 'str | None'

Why an applicable dimension has no value.

None when the dimension is known, or when it does not apply to this kind of data at all.

Reference

class Reference(core: '_core.Dataset') -> 'None'

A reference sequence (FASTA).

Reference.applicable

applicable: tuple[str, ...] # property

The dimensions that mean anything for this kind of data.

A dimension outside this set is not a gap to be filled in: asking a FASTA for its quality encoding is a category error.

Reference.contigs

contigs: list[Contig] | None # property

The contigs of the reference this data is on, in file order.

Reference.dimension

dimension(self, name: 'str') -> 'DimensionValue | None'

One dimension’s value, or None if it is unknown or inapplicable.

Reference.dimensions

dimensions: Mapping[str, DimensionValue] # property

Every dimension that has a known value, by name.

Reference.file

file: str # property

The file this data is, for code that has to open it.

path is the honest answer to “where did this come from, if anywhere?”, so it can be None — a step’s output carries dimensions worked out before anything ran, and has no file of its own until it does. This is the answer for the other question, the one a lg.write body asks:

return lg.write(lambda out: interpret(v.file, out))

Inside that function the steps above have run, so there is a file, and saying so in the type is what keeps a body from having to prove it.

Raises

RaisesWhen
ValueErrorIf this data has no file behind it at all.

Reference.files

files: tuple[str, ...] # property

Every file this data is, in order.

One for most kinds and two for a pair of FASTQ mates, in mate order. file names the primary one, which is what a message quotes; this is what code that has to open all of them wants.

Reference.kind

kind: str # property

The name of the kind of data this holds.

Reference.notes

notes: tuple[str, ...] # property

What loading this noticed, as one sentence each.

Usually empty. A note is not a failure and never stops anything: it is something true of the data that you cannot act on without being told. A gene list is the file this exists for — its symbols can arrive already corrupted by a spreadsheet, which is a fact about the input rather than about any step, so no step’s output could report it.

Reference.origin

origin: RemoteOrigin | None # property

Where this was fetched from, or None if it was not fetched.

The overwhelming majority of inputs are files somebody has, and for those this says nothing by being None.

Reference.path

path: str | None # property

The file this was loaded from.

Reference.samples

samples: list[str] | None # property

The samples this data covers, in order.

Reference.unknown_reason

unknown_reason(self, name: 'str') -> 'str | None'

Why an applicable dimension has no value.

None when the dimension is known, or when it does not apply to this kind of data at all.

Reads

class Reads(core: '_core.Dataset') -> 'None'

Unaligned sequencing reads (FASTQ).

Reads.applicable

applicable: tuple[str, ...] # property

The dimensions that mean anything for this kind of data.

A dimension outside this set is not a gap to be filled in: asking a FASTA for its quality encoding is a category error.

Reads.contigs

contigs: list[Contig] | None # property

The contigs of the reference this data is on, in file order.

Reads.dimension

dimension(self, name: 'str') -> 'DimensionValue | None'

One dimension’s value, or None if it is unknown or inapplicable.

Reads.dimensions

dimensions: Mapping[str, DimensionValue] # property

Every dimension that has a known value, by name.

Reads.file

file: str # property

The file this data is, for code that has to open it.

path is the honest answer to “where did this come from, if anywhere?”, so it can be None — a step’s output carries dimensions worked out before anything ran, and has no file of its own until it does. This is the answer for the other question, the one a lg.write body asks:

return lg.write(lambda out: interpret(v.file, out))

Inside that function the steps above have run, so there is a file, and saying so in the type is what keeps a body from having to prove it.

Raises

RaisesWhen
ValueErrorIf this data has no file behind it at all.

Reads.files

files: tuple[str, ...] # property

Every file this data is, in order.

One for most kinds and two for a pair of FASTQ mates, in mate order. file names the primary one, which is what a message quotes; this is what code that has to open all of them wants.

Reads.kind

kind: str # property

The name of the kind of data this holds.

Reads.notes

notes: tuple[str, ...] # property

What loading this noticed, as one sentence each.

Usually empty. A note is not a failure and never stops anything: it is something true of the data that you cannot act on without being told. A gene list is the file this exists for — its symbols can arrive already corrupted by a spreadsheet, which is a fact about the input rather than about any step, so no step’s output could report it.

Reads.origin

origin: RemoteOrigin | None # property

Where this was fetched from, or None if it was not fetched.

The overwhelming majority of inputs are files somebody has, and for those this says nothing by being None.

Reads.path

path: str | None # property

The file this was loaded from.

Reads.samples

samples: list[str] | None # property

The samples this data covers, in order.

Reads.unknown_reason

unknown_reason(self, name: 'str') -> 'str | None'

Why an applicable dimension has no value.

None when the dimension is known, or when it does not apply to this kind of data at all.

Samples

class Samples(samples: 'list[Reads]') -> 'None'

The samples a glob matched, in the order their files appeared.

Iterable, indexable and sized, so it can be used as an ordinary sequence of Reads. map is the part the golden example uses.

Samples.ids

ids: tuple[str, ...] # property

Each sample’s identifier, in order.

Taken from the filenames, with any mate marker removed, unless the reads were loaded with the identifier declared.

Samples.map

map(self, build: 'Callable[[Reads], T]') -> 'list[T]'

Apply a chain of steps to every sample.

Nothing is executed. build is called once per sample and returns whatever the last step in the chain returns — a handle, not data — so the result is one output per sample, ready for lg.Pipeline.

Parameters

ParameterDescription
buildWhat to do with one sample’s reads.

Returns

One result per sample, in order.

Alignment

class Alignment(core: '_core.Dataset') -> 'None'

Reads placed on a reference (SAM/BAM).

Alignment.applicable

applicable: tuple[str, ...] # property

The dimensions that mean anything for this kind of data.

A dimension outside this set is not a gap to be filled in: asking a FASTA for its quality encoding is a category error.

Alignment.contigs

contigs: list[Contig] | None # property

The contigs of the reference this data is on, in file order.

Alignment.dimension

dimension(self, name: 'str') -> 'DimensionValue | None'

One dimension’s value, or None if it is unknown or inapplicable.

Alignment.dimensions

dimensions: Mapping[str, DimensionValue] # property

Every dimension that has a known value, by name.

Alignment.file

file: str # property

The file this data is, for code that has to open it.

path is the honest answer to “where did this come from, if anywhere?”, so it can be None — a step’s output carries dimensions worked out before anything ran, and has no file of its own until it does. This is the answer for the other question, the one a lg.write body asks:

return lg.write(lambda out: interpret(v.file, out))

Inside that function the steps above have run, so there is a file, and saying so in the type is what keeps a body from having to prove it.

Raises

RaisesWhen
ValueErrorIf this data has no file behind it at all.

Alignment.files

files: tuple[str, ...] # property

Every file this data is, in order.

One for most kinds and two for a pair of FASTQ mates, in mate order. file names the primary one, which is what a message quotes; this is what code that has to open all of them wants.

Alignment.kind

kind: str # property

The name of the kind of data this holds.

Alignment.notes

notes: tuple[str, ...] # property

What loading this noticed, as one sentence each.

Usually empty. A note is not a failure and never stops anything: it is something true of the data that you cannot act on without being told. A gene list is the file this exists for — its symbols can arrive already corrupted by a spreadsheet, which is a fact about the input rather than about any step, so no step’s output could report it.

Alignment.origin

origin: RemoteOrigin | None # property

Where this was fetched from, or None if it was not fetched.

The overwhelming majority of inputs are files somebody has, and for those this says nothing by being None.

Alignment.path

path: str | None # property

The file this was loaded from.

Alignment.samples

samples: list[str] | None # property

The samples this data covers, in order.

Alignment.unknown_reason

unknown_reason(self, name: 'str') -> 'str | None'

Why an applicable dimension has no value.

None when the dimension is known, or when it does not apply to this kind of data at all.

Variants

class Variants(core: '_core.Dataset') -> 'None'

Variant calls (VCF).

Variants.applicable

applicable: tuple[str, ...] # property

The dimensions that mean anything for this kind of data.

A dimension outside this set is not a gap to be filled in: asking a FASTA for its quality encoding is a category error.

Variants.contigs

contigs: list[Contig] | None # property

The contigs of the reference this data is on, in file order.

Variants.dimension

dimension(self, name: 'str') -> 'DimensionValue | None'

One dimension’s value, or None if it is unknown or inapplicable.

Variants.dimensions

dimensions: Mapping[str, DimensionValue] # property

Every dimension that has a known value, by name.

Variants.file

file: str # property

The file this data is, for code that has to open it.

path is the honest answer to “where did this come from, if anywhere?”, so it can be None — a step’s output carries dimensions worked out before anything ran, and has no file of its own until it does. This is the answer for the other question, the one a lg.write body asks:

return lg.write(lambda out: interpret(v.file, out))

Inside that function the steps above have run, so there is a file, and saying so in the type is what keeps a body from having to prove it.

Raises

RaisesWhen
ValueErrorIf this data has no file behind it at all.

Variants.files

files: tuple[str, ...] # property

Every file this data is, in order.

One for most kinds and two for a pair of FASTQ mates, in mate order. file names the primary one, which is what a message quotes; this is what code that has to open all of them wants.

Variants.kind

kind: str # property

The name of the kind of data this holds.

Variants.notes

notes: tuple[str, ...] # property

What loading this noticed, as one sentence each.

Usually empty. A note is not a failure and never stops anything: it is something true of the data that you cannot act on without being told. A gene list is the file this exists for — its symbols can arrive already corrupted by a spreadsheet, which is a fact about the input rather than about any step, so no step’s output could report it.

Variants.origin

origin: RemoteOrigin | None # property

Where this was fetched from, or None if it was not fetched.

The overwhelming majority of inputs are files somebody has, and for those this says nothing by being None.

Variants.path

path: str | None # property

The file this was loaded from.

Variants.samples

samples: list[str] | None # property

The samples this data covers, in order.

Variants.unknown_reason

unknown_reason(self, name: 'str') -> 'str | None'

Why an applicable dimension has no value.

None when the dimension is known, or when it does not apply to this kind of data at all.

Intervals

class Intervals(core: '_core.Dataset') -> 'None'

Genomic intervals (BED/GFF).

The one type whose coordinates dimension varies by format: BED is 0-based half-open, GFF is 1-based closed. Feeding one to a tool expecting the other produces results that are plausible and off by one.

Intervals.applicable

applicable: tuple[str, ...] # property

The dimensions that mean anything for this kind of data.

A dimension outside this set is not a gap to be filled in: asking a FASTA for its quality encoding is a category error.

Intervals.contigs

contigs: list[Contig] | None # property

The contigs of the reference this data is on, in file order.

Intervals.dimension

dimension(self, name: 'str') -> 'DimensionValue | None'

One dimension’s value, or None if it is unknown or inapplicable.

Intervals.dimensions

dimensions: Mapping[str, DimensionValue] # property

Every dimension that has a known value, by name.

Intervals.file

file: str # property

The file this data is, for code that has to open it.

path is the honest answer to “where did this come from, if anywhere?”, so it can be None — a step’s output carries dimensions worked out before anything ran, and has no file of its own until it does. This is the answer for the other question, the one a lg.write body asks:

return lg.write(lambda out: interpret(v.file, out))

Inside that function the steps above have run, so there is a file, and saying so in the type is what keeps a body from having to prove it.

Raises

RaisesWhen
ValueErrorIf this data has no file behind it at all.

Intervals.files

files: tuple[str, ...] # property

Every file this data is, in order.

One for most kinds and two for a pair of FASTQ mates, in mate order. file names the primary one, which is what a message quotes; this is what code that has to open all of them wants.

Intervals.kind

kind: str # property

The name of the kind of data this holds.

Intervals.notes

notes: tuple[str, ...] # property

What loading this noticed, as one sentence each.

Usually empty. A note is not a failure and never stops anything: it is something true of the data that you cannot act on without being told. A gene list is the file this exists for — its symbols can arrive already corrupted by a spreadsheet, which is a fact about the input rather than about any step, so no step’s output could report it.

Intervals.origin

origin: RemoteOrigin | None # property

Where this was fetched from, or None if it was not fetched.

The overwhelming majority of inputs are files somebody has, and for those this says nothing by being None.

Intervals.path

path: str | None # property

The file this was loaded from.

Intervals.samples

samples: list[str] | None # property

The samples this data covers, in order.

Intervals.unknown_reason

unknown_reason(self, name: 'str') -> 'str | None'

Why an applicable dimension has no value.

None when the dimension is known, or when it does not apply to this kind of data at all.

EntitySet

class EntitySet(core: '_core.Dataset') -> 'None'

A set of genes or proteins, named in one identifier space.

The first type here that holds no sequence, and the one whose dimension is the commonest silent bug in biology: a list of HGNC symbols joined to a table of Ensembl IDs overlaps in nothing, and nothing says so.

It has no coordinate system, no contigs, no read pairing and no quality scores. Those are not gaps to be filled in — a list of gene names has no such properties to have — so asking for one gets None rather than a reason.

The rows are a set: their order says nothing, and two files holding them in different orders have the same semantic hash. For a list whose order is its result, see RankedList.

EntitySet.applicable

applicable: tuple[str, ...] # property

The dimensions that mean anything for this kind of data.

A dimension outside this set is not a gap to be filled in: asking a FASTA for its quality encoding is a category error.

EntitySet.contigs

contigs: list[Contig] | None # property

The contigs of the reference this data is on, in file order.

EntitySet.dimension

dimension(self, name: 'str') -> 'DimensionValue | None'

One dimension’s value, or None if it is unknown or inapplicable.

EntitySet.dimensions

dimensions: Mapping[str, DimensionValue] # property

Every dimension that has a known value, by name.

EntitySet.file

file: str # property

The file this data is, for code that has to open it.

path is the honest answer to “where did this come from, if anywhere?”, so it can be None — a step’s output carries dimensions worked out before anything ran, and has no file of its own until it does. This is the answer for the other question, the one a lg.write body asks:

return lg.write(lambda out: interpret(v.file, out))

Inside that function the steps above have run, so there is a file, and saying so in the type is what keeps a body from having to prove it.

Raises

RaisesWhen
ValueErrorIf this data has no file behind it at all.

EntitySet.files

files: tuple[str, ...] # property

Every file this data is, in order.

One for most kinds and two for a pair of FASTQ mates, in mate order. file names the primary one, which is what a message quotes; this is what code that has to open all of them wants.

EntitySet.kind

kind: str # property

The name of the kind of data this holds.

EntitySet.notes

notes: tuple[str, ...] # property

What loading this noticed, as one sentence each.

Usually empty. A note is not a failure and never stops anything: it is something true of the data that you cannot act on without being told. A gene list is the file this exists for — its symbols can arrive already corrupted by a spreadsheet, which is a fact about the input rather than about any step, so no step’s output could report it.

EntitySet.origin

origin: RemoteOrigin | None # property

Where this was fetched from, or None if it was not fetched.

The overwhelming majority of inputs are files somebody has, and for those this says nothing by being None.

EntitySet.path

path: str | None # property

The file this was loaded from.

EntitySet.samples

samples: list[str] | None # property

The samples this data covers, in order.

EntitySet.unknown_reason

unknown_reason(self, name: 'str') -> 'str | None'

Why an applicable dimension has no value.

None when the dimension is known, or when it does not apply to this kind of data at all.

RankedList

class RankedList(core: '_core.Dataset') -> 'None'

A ranked list of genes, proteins or candidates: order is the result.

An EntitySet and one more thing, and the one more thing is why the type exists: its canonical form preserves row order, where every other type in Ligase discards it. Rank is the row position, so the same twelve genes in two orders are two different answers to the question “which of these matters most?” — and two files holding them have different semantic hashes (D41 ).

It carries exactly the dimensions an EntitySet carries: the identifier space, the organism, the subject and the release. The difference between the two types is canonicalisation, and nothing else. A score column is optional and compared exactly, with no tolerance.

RankedList.applicable

applicable: tuple[str, ...] # property

The dimensions that mean anything for this kind of data.

A dimension outside this set is not a gap to be filled in: asking a FASTA for its quality encoding is a category error.

RankedList.contigs

contigs: list[Contig] | None # property

The contigs of the reference this data is on, in file order.

RankedList.dimension

dimension(self, name: 'str') -> 'DimensionValue | None'

One dimension’s value, or None if it is unknown or inapplicable.

RankedList.dimensions

dimensions: Mapping[str, DimensionValue] # property

Every dimension that has a known value, by name.

RankedList.file

file: str # property

The file this data is, for code that has to open it.

path is the honest answer to “where did this come from, if anywhere?”, so it can be None — a step’s output carries dimensions worked out before anything ran, and has no file of its own until it does. This is the answer for the other question, the one a lg.write body asks:

return lg.write(lambda out: interpret(v.file, out))

Inside that function the steps above have run, so there is a file, and saying so in the type is what keeps a body from having to prove it.

Raises

RaisesWhen
ValueErrorIf this data has no file behind it at all.

RankedList.files

files: tuple[str, ...] # property

Every file this data is, in order.

One for most kinds and two for a pair of FASTQ mates, in mate order. file names the primary one, which is what a message quotes; this is what code that has to open all of them wants.

RankedList.kind

kind: str # property

The name of the kind of data this holds.

RankedList.notes

notes: tuple[str, ...] # property

What loading this noticed, as one sentence each.

Usually empty. A note is not a failure and never stops anything: it is something true of the data that you cannot act on without being told. A gene list is the file this exists for — its symbols can arrive already corrupted by a spreadsheet, which is a fact about the input rather than about any step, so no step’s output could report it.

RankedList.origin

origin: RemoteOrigin | None # property

Where this was fetched from, or None if it was not fetched.

The overwhelming majority of inputs are files somebody has, and for those this says nothing by being None.

RankedList.path

path: str | None # property

The file this was loaded from.

RankedList.samples

samples: list[str] | None # property

The samples this data covers, in order.

RankedList.unknown_reason

unknown_reason(self, name: 'str') -> 'str | None'

Why an applicable dimension has no value.

None when the dimension is known, or when it does not apply to this kind of data at all.

KnowledgeGraph

class KnowledgeGraph(core: '_core.Dataset') -> 'None'

Typed nodes and edges with per-edge provenance, read from JSON.

The first type here that is assembled rather than measured, and the one dimension that follows from it is why the type exists: which evidence sources were folded into a graph decides what it holds. Add DisGeNET to a graph that had Open Targets and a literature-mined set, and edges appear, neighbourhoods widen and every propagated score moves — and nothing in the file says which sources went in. So two graphs that differ only in their source composition diff and score against each other without complaint, and the difference reads as biology.

source_set is therefore a dimension, and the loader reads it off the graph’s own nodes and edges rather than asking for it. It is compared exactly, case included, because a source is usually an object key or a URL and both are case-sensitive by specification — unlike organism, where HIV-1 and hiv-1 are one organism (D36 ).

It also carries the organism set, the identifier space its node ids are named in, what it is a graph of, and the release its sources were drawn from. It has no coordinate system, no contigs, no pairing, no quality scores and no samples.

KnowledgeGraph.applicable

applicable: tuple[str, ...] # property

The dimensions that mean anything for this kind of data.

A dimension outside this set is not a gap to be filled in: asking a FASTA for its quality encoding is a category error.

KnowledgeGraph.contigs

contigs: list[Contig] | None # property

The contigs of the reference this data is on, in file order.

KnowledgeGraph.dimension

dimension(self, name: 'str') -> 'DimensionValue | None'

One dimension’s value, or None if it is unknown or inapplicable.

KnowledgeGraph.dimensions

dimensions: Mapping[str, DimensionValue] # property

Every dimension that has a known value, by name.

KnowledgeGraph.file

file: str # property

The file this data is, for code that has to open it.

path is the honest answer to “where did this come from, if anywhere?”, so it can be None — a step’s output carries dimensions worked out before anything ran, and has no file of its own until it does. This is the answer for the other question, the one a lg.write body asks:

return lg.write(lambda out: interpret(v.file, out))

Inside that function the steps above have run, so there is a file, and saying so in the type is what keeps a body from having to prove it.

Raises

RaisesWhen
ValueErrorIf this data has no file behind it at all.

KnowledgeGraph.files

files: tuple[str, ...] # property

Every file this data is, in order.

One for most kinds and two for a pair of FASTQ mates, in mate order. file names the primary one, which is what a message quotes; this is what code that has to open all of them wants.

KnowledgeGraph.kind

kind: str # property

The name of the kind of data this holds.

KnowledgeGraph.notes

notes: tuple[str, ...] # property

What loading this noticed, as one sentence each.

Usually empty. A note is not a failure and never stops anything: it is something true of the data that you cannot act on without being told. A gene list is the file this exists for — its symbols can arrive already corrupted by a spreadsheet, which is a fact about the input rather than about any step, so no step’s output could report it.

KnowledgeGraph.origin

origin: RemoteOrigin | None # property

Where this was fetched from, or None if it was not fetched.

The overwhelming majority of inputs are files somebody has, and for those this says nothing by being None.

KnowledgeGraph.path

path: str | None # property

The file this was loaded from.

KnowledgeGraph.samples

samples: list[str] | None # property

The samples this data covers, in order.

KnowledgeGraph.unknown_reason

unknown_reason(self, name: 'str') -> 'str | None'

Why an applicable dimension has no value.

None when the dimension is known, or when it does not apply to this kind of data at all.

MoleculeSet

class MoleculeSet(core: '_core.Dataset') -> 'None'

A set of molecules, named in one standardisation state.

The type representation exists for. The same substance has different InChIKeys depending on what was done to it before the key was computed, and not marginally: of thirty ordinary drugs measured across six RDKit releases, twelve change key under a different standardisation state. Aspirin has three — JZLOKWGVGHYBKD-UHFFFAOYSA-M as a sodium salt, BSYNRYMUTXBXSQ-UHFFFAOYSA-M salt-stripped, and BSYNRYMUTXBXSQ-UHFFFAOYSA-N salt-stripped and neutralised. The last two differ in the final character.

So two compound sets prepared differently overlap in nothing for the substances affected while the rest still match, and the hit rate that comes out is small, non-zero and reads as poor enrichment rather than as a mismatch. Nothing about two columns of keys says which standardisation produced them, which is what makes this the one dimension in Ligase that no glance at the data can catch.

It carries the organism its compounds were measured against, what it is a set of — a target, an assay, a therapeutic area — and the release of the collection it was drawn from. It has no identifier_namespace, though an InChIKey is an identifier space, because representation already says which space its names are in and two axes carrying one fact is one too many.

The rows are a set: their order says nothing, and two files holding them in different orders have the same semantic hash. For a table whose order is its result, see MoleculeRanking.

MoleculeSet.applicable

applicable: tuple[str, ...] # property

The dimensions that mean anything for this kind of data.

A dimension outside this set is not a gap to be filled in: asking a FASTA for its quality encoding is a category error.

MoleculeSet.contigs

contigs: list[Contig] | None # property

The contigs of the reference this data is on, in file order.

MoleculeSet.dimension

dimension(self, name: 'str') -> 'DimensionValue | None'

One dimension’s value, or None if it is unknown or inapplicable.

MoleculeSet.dimensions

dimensions: Mapping[str, DimensionValue] # property

Every dimension that has a known value, by name.

MoleculeSet.file

file: str # property

The file this data is, for code that has to open it.

path is the honest answer to “where did this come from, if anywhere?”, so it can be None — a step’s output carries dimensions worked out before anything ran, and has no file of its own until it does. This is the answer for the other question, the one a lg.write body asks:

return lg.write(lambda out: interpret(v.file, out))

Inside that function the steps above have run, so there is a file, and saying so in the type is what keeps a body from having to prove it.

Raises

RaisesWhen
ValueErrorIf this data has no file behind it at all.

MoleculeSet.files

files: tuple[str, ...] # property

Every file this data is, in order.

One for most kinds and two for a pair of FASTQ mates, in mate order. file names the primary one, which is what a message quotes; this is what code that has to open all of them wants.

MoleculeSet.kind

kind: str # property

The name of the kind of data this holds.

MoleculeSet.notes

notes: tuple[str, ...] # property

What loading this noticed, as one sentence each.

Usually empty. A note is not a failure and never stops anything: it is something true of the data that you cannot act on without being told. A gene list is the file this exists for — its symbols can arrive already corrupted by a spreadsheet, which is a fact about the input rather than about any step, so no step’s output could report it.

MoleculeSet.origin

origin: RemoteOrigin | None # property

Where this was fetched from, or None if it was not fetched.

The overwhelming majority of inputs are files somebody has, and for those this says nothing by being None.

MoleculeSet.path

path: str | None # property

The file this was loaded from.

MoleculeSet.samples

samples: list[str] | None # property

The samples this data covers, in order.

MoleculeSet.unknown_reason

unknown_reason(self, name: 'str') -> 'str | None'

Why an applicable dimension has no value.

None when the dimension is known, or when it does not apply to this kind of data at all.

MoleculeRanking

class MoleculeRanking(core: '_core.Dataset') -> 'None'

A ranking of molecules: the order is the result.

A MoleculeSet and one more thing, and the one more thing is why the type exists: its canonical form preserves row order. A ranking of docked compounds answers which of these to order, rank is the row position, and a canonical form that sorted them would declare two different answers identical — after which a cache keyed on that form would serve one when the pipeline asked for the other, in silence (D41 ).

It carries exactly the dimensions a MoleculeSet carries. The difference between the two types is canonicalisation, and nothing else. A score column is optional and compared exactly, with no tolerance.

This is what §4.4 of the v0.2 design called BindingScores. It is named for the shape rather than for one of its contents, because the same file holds docking scores, QSAR-predicted activities, predicted solubilities and synthetic-accessibility scores, and only the first is a binding score (D48 ).

MoleculeRanking.applicable

applicable: tuple[str, ...] # property

The dimensions that mean anything for this kind of data.

A dimension outside this set is not a gap to be filled in: asking a FASTA for its quality encoding is a category error.

MoleculeRanking.contigs

contigs: list[Contig] | None # property

The contigs of the reference this data is on, in file order.

MoleculeRanking.dimension

dimension(self, name: 'str') -> 'DimensionValue | None'

One dimension’s value, or None if it is unknown or inapplicable.

MoleculeRanking.dimensions

dimensions: Mapping[str, DimensionValue] # property

Every dimension that has a known value, by name.

MoleculeRanking.file

file: str # property

The file this data is, for code that has to open it.

path is the honest answer to “where did this come from, if anywhere?”, so it can be None — a step’s output carries dimensions worked out before anything ran, and has no file of its own until it does. This is the answer for the other question, the one a lg.write body asks:

return lg.write(lambda out: interpret(v.file, out))

Inside that function the steps above have run, so there is a file, and saying so in the type is what keeps a body from having to prove it.

Raises

RaisesWhen
ValueErrorIf this data has no file behind it at all.

MoleculeRanking.files

files: tuple[str, ...] # property

Every file this data is, in order.

One for most kinds and two for a pair of FASTQ mates, in mate order. file names the primary one, which is what a message quotes; this is what code that has to open all of them wants.

MoleculeRanking.kind

kind: str # property

The name of the kind of data this holds.

MoleculeRanking.notes

notes: tuple[str, ...] # property

What loading this noticed, as one sentence each.

Usually empty. A note is not a failure and never stops anything: it is something true of the data that you cannot act on without being told. A gene list is the file this exists for — its symbols can arrive already corrupted by a spreadsheet, which is a fact about the input rather than about any step, so no step’s output could report it.

MoleculeRanking.origin

origin: RemoteOrigin | None # property

Where this was fetched from, or None if it was not fetched.

The overwhelming majority of inputs are files somebody has, and for those this says nothing by being None.

MoleculeRanking.path

path: str | None # property

The file this was loaded from.

MoleculeRanking.samples

samples: list[str] | None # property

The samples this data covers, in order.

MoleculeRanking.unknown_reason

unknown_reason(self, name: 'str') -> 'str | None'

Why an applicable dimension has no value.

None when the dimension is known, or when it does not apply to this kind of data at all.

Contig

class Contig(name: 'str', length: 'int | None', md5: 'str | None') -> None

One sequence in a reference.

Attributes

AttributeDescription
nameThe name as written: chr1, 1, K03455.1.
lengthLength in bases, or None when the file records no length.
md5MD5 of the uppercased sequence, as the SAM specification defines @SQ M5, or None when neither recorded nor computable.

DimensionValue

class DimensionValue(name: 'str', value: 'str', source: 'str') -> None

A dimension’s value, and where it came from.

Attributes

AttributeDescription
nameThe dimension’s name, e.g. reference.
valueThe value, rendered for a human.
sourceWhere it came from, e.g. from BAM @SQ header: data/x.bam. This is the part that makes an error actionable.

StepOutput

class StepOutput( step: 'Step[Any, Any]', arguments: 'dict[str, object]', ) -> 'None'

A handle on data a step would produce.

Returned by calling a Step. It holds no data and has never touched a file; what it knows is which step would make it, and from what. Once a Pipeline has been built from it, dataset holds the dimensions the engine propagated — the dimensions the output will have, worked out without running anything.

Attributes

AttributeDescription
stepThe step that would produce it.
argumentsEverything the step was called with, by parameter name.

StepOutput.dataset

dataset: Dataset | None # property

The propagated output dataset, once a Pipeline has been built.

None before that: propagation is the graph’s work, and there is no graph until a pipeline asks for one.

StepOutput.file

file: str # property

Where the output is, once the step has produced it.

The same name Dataset.file has, because a body cannot tell which it was handed: a step’s input is loaded data for the first step of a pipeline and another step’s handle after that. A lg.write body reads it inside the function it hands back, by which time the engine has run whatever comes above it:

return lg.write(lambda out: interpret(v.file, out))

Raises

RaisesWhen
RuntimeErrorBefore the step has run, when there is no file to name. A shell command should use {placeholders} instead, which the engine fills in for it.

StepOutput.inputs

inputs(self) -> 'tuple[tuple[Parameter, object], ...]'

The data arguments, paired with the parameters they filled.

StepOutput.kind

kind: str # property

The kind of data the step declares it produces.

Written

class Written( function: 'Callable[[Path], Iterable[Noticed] | None]', ) -> None

A step whose work is Python, and writes its own output.

Attributes

AttributeDescription
functionCalled with the path to write to, once the engine has decided what that path is. It may return what it noticed about its own work, as Noticed pairs.
Last updated on