1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! Loading a gene or protein list, and reading the space its names live in.
//!
//! **The silent failure this catches.** A list of gene symbols joined to a
//! table of Ensembl IDs overlaps in nothing, and nothing says so: the merge
//! succeeds, the overlap is empty or small, and the result is a plausible
//! answer to a question nobody asked. The same list scored against a
//! curated truth set that spells its genes differently gives a precision of
//! zero that reads as a failed method. And a list whose symbols a
//! spreadsheet has turned into dates — `SEPT7` into `2-Sep`, `MARCH1` into
//! `1-Mar` — is missing exactly those genes from every join downstream,
//! which is a published-literature problem rather than a hypothetical one.
//!
//! So the space is a dimension, and this loader fills it in.
//!
//! The reading itself lives in [`super::named_list`], because a ranked list
//! is read the same way; what is here is the kind, and the three sentences
//! this format uses to say why it cannot supply a dimension on its own.
use Path;
use ;
use ;
use crate;
/// What a gene list cannot tell the engine about itself.
const REASONS: Reasons = Reasons ;
/// Load a gene or protein list from a TSV with a header.
///
/// `id_column` names the column holding the identifiers, defaulting to
/// `id`. Every other column is an attribute and is carried without being
/// read: what a list says about its genes is the user's business, and the
/// dimension is about the names.
///
/// The rows are a **set**: this loader reads the order they arrive in and
/// records none of it, and the canonical form discards it too. A list whose
/// order means something is a [`DataKind::RankedList`]
/// ([`super::ranked_list`]).
///
/// # Errors
///
/// [`LoadError::Io`] if the file cannot be read, and [`LoadError::Format`]
/// if it has no header row, has no column of the name asked for, or holds a
/// row the header cannot account for.