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
56
57
58
59
60
61
62
//! Loading a ranked list, where the row order is the result.
//!
//! **The silent failure this catches.** Everything
//! [`super::entity_set`](super::entity_set) catches — a list of symbols
//! joined to a table of Ensembl IDs, a truth set that spells its genes
//! differently, symbols a spreadsheet turned into dates — plus one more
//! that only a ranking can have: a rank-ordered result compared against one
//! in a different namespace or from a different release. Two rankings of
//! "the same" genes are a concordance measurement, and if the two were
//! named by different HGNC releases or in different spaces then the
//! measurement is of the naming rather than of the biology, and it comes
//! out low and plausible.
//!
//! What this loader does **not** record is the rank. Rank is the row
//! position, so recording it would be recording the file: the order is kept
//! where order is kept, which is the canonical form
//! (`canon::ranked_list`, D41). A file that also *numbers* its rows carries
//! that number as an ordinary attribute column, like any other.
//!
//! The reading itself lives in [`super::named_list`], shared with the gene
//! list, because reading names and the space they live in is the same work
//! for both kinds. The difference between them is one thing and lives in
//! one place.
use Path;
use ;
use ;
use crate;
/// What a ranked list cannot tell the engine about itself.
const REASONS: Reasons = Reasons ;
/// Load a ranked list from a TSV with a header, highest rank first.
///
/// `id_column` names the column holding the identifiers, defaulting to
/// `id`. Every other column is an attribute and is carried without being
/// read — a `score`, a `rank`, an adjusted p-value — and a `score` is
/// compared **exactly**, because no tolerance has been measured for one
/// (see [`canon::tolerance`](crate::canon::tolerance)).
///
/// The rows are in order, and the order is part of what the file says: two
/// files holding these rows in different orders are two different rankings
/// and have different canonical hashes. A list whose order means nothing is
/// an [`DataKind::EntitySet`] ([`super::entity_set`]).
///
/// # 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.