react-cheminfo 0.46.0 → 0.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -0
- package/lib/chart/core/chartDomain.d.ts +14 -0
- package/lib/chart/core/chartDomain.d.ts.map +1 -1
- package/lib/chart/core/chartDomain.js +1 -0
- package/lib/chart/core/chartDomain.js.map +1 -1
- package/lib/chart/core/selectionGeometry.d.ts +4 -2
- package/lib/chart/core/selectionGeometry.d.ts.map +1 -1
- package/lib/chart/core/selectionGeometry.js +4 -2
- package/lib/chart/core/selectionGeometry.js.map +1 -1
- package/lib/chart/core/zoomDomain.d.ts +11 -1
- package/lib/chart/core/zoomDomain.d.ts.map +1 -1
- package/lib/chart/core/zoomDomain.js +25 -5
- package/lib/chart/core/zoomDomain.js.map +1 -1
- package/lib/chart/ui/chartGestures.d.ts +26 -1
- package/lib/chart/ui/chartGestures.d.ts.map +1 -1
- package/lib/chart/ui/chartGestures.js +21 -0
- package/lib/chart/ui/chartGestures.js.map +1 -1
- package/lib/chart/ui/index.d.ts +1 -1
- package/lib/chart/ui/index.d.ts.map +1 -1
- package/lib/chart/ui/index.js +1 -1
- package/lib/chart/ui/index.js.map +1 -1
- package/lib/chart/ui/useChartZoom.d.ts.map +1 -1
- package/lib/chart/ui/useChartZoom.js +17 -1
- package/lib/chart/ui/useChartZoom.js.map +1 -1
- package/lib/core.d.ts +1 -0
- package/lib/core.d.ts.map +1 -1
- package/lib/core.js +1 -0
- package/lib/core.js.map +1 -1
- package/lib/download/core/cssPaint.d.ts +27 -0
- package/lib/download/core/cssPaint.d.ts.map +1 -0
- package/lib/download/core/cssPaint.js +63 -0
- package/lib/download/core/cssPaint.js.map +1 -0
- package/lib/download/core/drawingMarkup.d.ts +11 -0
- package/lib/download/core/drawingMarkup.d.ts.map +1 -0
- package/lib/download/core/drawingMarkup.js +32 -0
- package/lib/download/core/drawingMarkup.js.map +1 -0
- package/lib/download/core/figureHtml.d.ts +25 -0
- package/lib/download/core/figureHtml.d.ts.map +1 -0
- package/lib/download/core/figureHtml.js +174 -0
- package/lib/download/core/figureHtml.js.map +1 -0
- package/lib/download/core/figureHtmlMarkup.d.ts +107 -0
- package/lib/download/core/figureHtmlMarkup.d.ts.map +1 -0
- package/lib/download/core/figureHtmlMarkup.js +75 -0
- package/lib/download/core/figureHtmlMarkup.js.map +1 -0
- package/lib/download/core/figureSvg.d.ts.map +1 -1
- package/lib/download/core/figureSvg.js +16 -35
- package/lib/download/core/figureSvg.js.map +1 -1
- package/lib/download/core/figureSvgDocument.d.ts +3 -3
- package/lib/download/core/figureSvgDocument.d.ts.map +1 -1
- package/lib/download/core/figureTarget.d.ts +14 -3
- package/lib/download/core/figureTarget.d.ts.map +1 -1
- package/lib/download/core/figureTarget.js +42 -3
- package/lib/download/core/figureTarget.js.map +1 -1
- package/lib/download/core/index.d.ts +1 -1
- package/lib/download/core/index.d.ts.map +1 -1
- package/lib/download/core/index.js +1 -1
- package/lib/download/core/index.js.map +1 -1
- package/lib/download/core/textLines.d.ts +27 -0
- package/lib/download/core/textLines.d.ts.map +1 -0
- package/lib/download/core/textLines.js +51 -0
- package/lib/download/core/textLines.js.map +1 -0
- package/lib/ecosystem/core/lookup.d.ts +2 -1
- package/lib/ecosystem/core/lookup.d.ts.map +1 -1
- package/lib/ecosystem/core/lookup.js +10 -3
- package/lib/ecosystem/core/lookup.js.map +1 -1
- package/lib/ecosystem/core/types.d.ts +2 -2
- package/lib/ecosystem/core/types.d.ts.map +1 -1
- package/lib/ecosystem/core/unlistedSites.d.ts +9 -0
- package/lib/ecosystem/core/unlistedSites.d.ts.map +1 -0
- package/lib/ecosystem/core/unlistedSites.js +35 -0
- package/lib/ecosystem/core/unlistedSites.js.map +1 -0
- package/lib/ecosystem/ui/glyphs.d.ts.map +1 -1
- package/lib/ecosystem/ui/glyphs.js +7 -0
- package/lib/ecosystem/ui/glyphs.js.map +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
- package/lib/ir/core/irMode.d.ts.map +1 -1
- package/lib/ir/core/irMode.js +6 -1
- package/lib/ir/core/irMode.js.map +1 -1
- package/lib/locales/de.json +56 -1
- package/lib/locales/en.json +56 -1
- package/lib/locales/es.json +56 -1
- package/lib/locales/fr.json +56 -1
- package/lib/locales/it.json +56 -1
- package/lib/periodic/core/index.d.ts +1 -1
- package/lib/periodic/core/index.d.ts.map +1 -1
- package/lib/periodic/core/layout.d.ts +11 -0
- package/lib/periodic/core/layout.d.ts.map +1 -1
- package/lib/periodic/core/layout.js.map +1 -1
- package/lib/periodic/ui/ElementCell.d.ts +6 -2
- package/lib/periodic/ui/ElementCell.d.ts.map +1 -1
- package/lib/periodic/ui/ElementCell.js +2 -2
- package/lib/periodic/ui/ElementCell.js.map +1 -1
- package/lib/periodic/ui/PeriodicTable.d.ts +3 -98
- package/lib/periodic/ui/PeriodicTable.d.ts.map +1 -1
- package/lib/periodic/ui/PeriodicTable.js +9 -84
- package/lib/periodic/ui/PeriodicTable.js.map +1 -1
- package/lib/periodic/ui/PeriodicTableChrome.d.ts +13 -3
- package/lib/periodic/ui/PeriodicTableChrome.d.ts.map +1 -1
- package/lib/periodic/ui/PeriodicTableChrome.js +10 -20
- package/lib/periodic/ui/PeriodicTableChrome.js.map +1 -1
- package/lib/periodic/ui/SelectAllCorner.d.ts +23 -0
- package/lib/periodic/ui/SelectAllCorner.d.ts.map +1 -0
- package/lib/periodic/ui/SelectAllCorner.js +40 -0
- package/lib/periodic/ui/SelectAllCorner.js.map +1 -0
- package/lib/periodic/ui/headerStyles.d.ts +17 -0
- package/lib/periodic/ui/headerStyles.d.ts.map +1 -0
- package/lib/periodic/ui/headerStyles.js +19 -0
- package/lib/periodic/ui/headerStyles.js.map +1 -0
- package/lib/periodic/ui/periodicTableProps.d.ts +115 -0
- package/lib/periodic/ui/periodicTableProps.d.ts.map +1 -0
- package/lib/periodic/ui/periodicTableProps.js +8 -0
- package/lib/periodic/ui/periodicTableProps.js.map +1 -0
- package/lib/periodic/ui/tableLayout.d.ts +26 -0
- package/lib/periodic/ui/tableLayout.d.ts.map +1 -0
- package/lib/periodic/ui/tableLayout.js +86 -0
- package/lib/periodic/ui/tableLayout.js.map +1 -0
- package/lib/split/ui/SplitColumn.d.ts +29 -0
- package/lib/split/ui/SplitColumn.d.ts.map +1 -0
- package/lib/split/ui/SplitColumn.js +19 -0
- package/lib/split/ui/SplitColumn.js.map +1 -0
- package/lib/split/ui/SplitRow.d.ts +14 -53
- package/lib/split/ui/SplitRow.d.ts.map +1 -1
- package/lib/split/ui/SplitRow.js +8 -90
- package/lib/split/ui/SplitRow.js.map +1 -1
- package/lib/split/ui/index.d.ts +3 -0
- package/lib/split/ui/index.d.ts.map +1 -1
- package/lib/split/ui/index.js +1 -0
- package/lib/split/ui/index.js.map +1 -1
- package/lib/split/ui/splitPanes.d.ts +84 -0
- package/lib/split/ui/splitPanes.d.ts.map +1 -0
- package/lib/split/ui/splitPanes.js +125 -0
- package/lib/split/ui/splitPanes.js.map +1 -0
- package/lib/taxonomy/core/index.d.ts +8 -0
- package/lib/taxonomy/core/index.d.ts.map +1 -0
- package/lib/taxonomy/core/index.js +5 -0
- package/lib/taxonomy/core/index.js.map +1 -0
- package/lib/taxonomy/core/lineage.d.ts +83 -0
- package/lib/taxonomy/core/lineage.d.ts.map +1 -0
- package/lib/taxonomy/core/lineage.js +126 -0
- package/lib/taxonomy/core/lineage.js.map +1 -0
- package/lib/taxonomy/core/ncbi.d.ts +8 -0
- package/lib/taxonomy/core/ncbi.d.ts.map +1 -0
- package/lib/taxonomy/core/ncbi.js +10 -0
- package/lib/taxonomy/core/ncbi.js.map +1 -0
- package/lib/taxonomy/core/organismName.d.ts +28 -0
- package/lib/taxonomy/core/organismName.d.ts.map +1 -0
- package/lib/taxonomy/core/organismName.js +188 -0
- package/lib/taxonomy/core/organismName.js.map +1 -0
- package/lib/taxonomy/core/organismWords.d.ts +20 -0
- package/lib/taxonomy/core/organismWords.d.ts.map +1 -0
- package/lib/taxonomy/core/organismWords.js +86 -0
- package/lib/taxonomy/core/organismWords.js.map +1 -0
- package/lib/taxonomy/core/ranks.d.ts +51 -0
- package/lib/taxonomy/core/ranks.d.ts.map +1 -0
- package/lib/taxonomy/core/ranks.js +123 -0
- package/lib/taxonomy/core/ranks.js.map +1 -0
- package/lib/taxonomy/ui/OrganismName.d.ts +28 -0
- package/lib/taxonomy/ui/OrganismName.d.ts.map +1 -0
- package/lib/taxonomy/ui/OrganismName.js +28 -0
- package/lib/taxonomy/ui/OrganismName.js.map +1 -0
- package/lib/taxonomy/ui/TaxonLineage.d.ts +67 -0
- package/lib/taxonomy/ui/TaxonLineage.d.ts.map +1 -0
- package/lib/taxonomy/ui/TaxonLineage.js +45 -0
- package/lib/taxonomy/ui/TaxonLineage.js.map +1 -0
- package/lib/taxonomy/ui/index.d.ts +6 -0
- package/lib/taxonomy/ui/index.d.ts.map +1 -0
- package/lib/taxonomy/ui/index.js +4 -0
- package/lib/taxonomy/ui/index.js.map +1 -0
- package/lib/taxonomy/ui/rankLabel.d.ts +17 -0
- package/lib/taxonomy/ui/rankLabel.d.ts.map +1 -0
- package/lib/taxonomy/ui/rankLabel.js +77 -0
- package/lib/taxonomy/ui/rankLabel.js.map +1 -0
- package/lib/ui.d.ts +1 -0
- package/lib/ui.d.ts.map +1 -1
- package/lib/ui.js +1 -0
- package/lib/ui.js.map +1 -1
- package/package.json +1 -1
- package/src/chart/core/chartDomain.ts +15 -0
- package/src/chart/core/selectionGeometry.ts +4 -2
- package/src/chart/core/zoomDomain.ts +37 -5
- package/src/chart/ui/chartGestures.ts +41 -1
- package/src/chart/ui/index.ts +1 -1
- package/src/chart/ui/useChartZoom.ts +25 -1
- package/src/core.ts +1 -0
- package/src/download/core/cssPaint.ts +71 -0
- package/src/download/core/drawingMarkup.ts +35 -0
- package/src/download/core/figureHtml.ts +214 -0
- package/src/download/core/figureHtmlMarkup.ts +187 -0
- package/src/download/core/figureSvg.ts +17 -38
- package/src/download/core/figureSvgDocument.ts +3 -3
- package/src/download/core/figureTarget.ts +41 -8
- package/src/download/core/index.ts +1 -0
- package/src/download/core/textLines.ts +67 -0
- package/src/ecosystem/core/lookup.ts +11 -3
- package/src/ecosystem/core/types.ts +4 -2
- package/src/ecosystem/core/unlistedSites.ts +37 -0
- package/src/ecosystem/ui/glyphs.tsx +44 -0
- package/src/ir/core/irMode.ts +6 -1
- package/src/locales/de.json +56 -1
- package/src/locales/en.json +56 -1
- package/src/locales/es.json +56 -1
- package/src/locales/fr.json +56 -1
- package/src/locales/it.json +56 -1
- package/src/periodic/core/index.ts +1 -1
- package/src/periodic/core/layout.ts +12 -0
- package/src/periodic/ui/ElementCell.tsx +8 -4
- package/src/periodic/ui/PeriodicTable.tsx +27 -197
- package/src/periodic/ui/PeriodicTableChrome.tsx +23 -20
- package/src/periodic/ui/SelectAllCorner.tsx +65 -0
- package/src/periodic/ui/headerStyles.ts +23 -0
- package/src/periodic/ui/periodicTableProps.ts +117 -0
- package/src/periodic/ui/tableLayout.ts +96 -0
- package/src/split/ui/SplitColumn.tsx +35 -0
- package/src/split/ui/SplitRow.tsx +16 -208
- package/src/split/ui/index.ts +3 -0
- package/src/split/ui/splitPanes.tsx +283 -0
- package/src/taxonomy/core/index.ts +20 -0
- package/src/taxonomy/core/lineage.ts +161 -0
- package/src/taxonomy/core/ncbi.ts +9 -0
- package/src/taxonomy/core/organismName.ts +217 -0
- package/src/taxonomy/core/organismWords.ts +86 -0
- package/src/taxonomy/core/ranks.ts +134 -0
- package/src/taxonomy/ui/OrganismName.tsx +59 -0
- package/src/taxonomy/ui/TaxonLineage.tsx +183 -0
- package/src/taxonomy/ui/index.ts +5 -0
- package/src/taxonomy/ui/rankLabel.ts +81 -0
- package/src/ui.ts +1 -0
- package/styles/chrome.css +135 -6
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { genusOrBelow, isPlaceholderTaxon, lineageFromNodes, lineageFromRanks, principalLineage, } from "./lineage.js";
|
|
2
|
+
export { ncbiTaxonomyUrl } from "./ncbi.js";
|
|
3
|
+
export { splitOrganismName } from "./organismName.js";
|
|
4
|
+
export { PRINCIPAL_RANKS, TAXON_RANKS, isAboveGenus, isGenusOrBelow, isPrincipalRank, rankOrder, } from "./ranks.js";
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/taxonomy/core/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EACL,eAAe,EACf,WAAW,EACX,YAAY,EACZ,cAAc,EACd,eAAe,EACf,SAAS,GACV,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A lineage: the taxa from the top of the tree of life down to one of them.
|
|
3
|
+
*
|
|
4
|
+
* It is read three ways, because the family meets it in three shapes: a map of
|
|
5
|
+
* NCBI nodes each pointing at its parent (what a database built on the NCBI
|
|
6
|
+
* dump answers), a record of names by rank (what octochemdb stores), or a list
|
|
7
|
+
* already in order.
|
|
8
|
+
*/
|
|
9
|
+
/** One taxon of a lineage. */
|
|
10
|
+
export interface Taxon {
|
|
11
|
+
/** The rank, as NCBI writes it: `genus`, `no rank`, `clade`… */
|
|
12
|
+
rank: string;
|
|
13
|
+
/** The scientific name. */
|
|
14
|
+
name: string;
|
|
15
|
+
/**
|
|
16
|
+
* The NCBI Taxonomy id.
|
|
17
|
+
* @default undefined — the taxon is known by its name alone
|
|
18
|
+
*/
|
|
19
|
+
taxId?: number;
|
|
20
|
+
}
|
|
21
|
+
/** The taxa from the top of the tree down to one of them, in that order. */
|
|
22
|
+
export type TaxonLineage = readonly Taxon[];
|
|
23
|
+
/** A taxon of the NCBI tree, as a map of nodes holds it. */
|
|
24
|
+
export interface TaxonNode {
|
|
25
|
+
/** The scientific name. */
|
|
26
|
+
name: string;
|
|
27
|
+
/** The rank, as NCBI writes it. */
|
|
28
|
+
rank: string;
|
|
29
|
+
/** The id of the taxon above; the root is its own parent. */
|
|
30
|
+
parentId: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The taxa a lineage is summarised by: those of a principal rank (domain,
|
|
34
|
+
* kingdom, phylum, class, order, family, genus, species), and the last one
|
|
35
|
+
* whatever its rank, since it is the taxon the lineage leads to.
|
|
36
|
+
*
|
|
37
|
+
* An NCBI placeholder for an unidentified species ('Streptomyces sp.') says
|
|
38
|
+
* no more than its genus, so it is left out and the genus is the leaf. The
|
|
39
|
+
* root, 'cellular organisms', the clades and the steps of no rank above the
|
|
40
|
+
* leaf never show.
|
|
41
|
+
* @param lineage - The lineage, from the top down.
|
|
42
|
+
* @returns The taxa kept, in the same order.
|
|
43
|
+
*/
|
|
44
|
+
export declare function principalLineage(lineage: TaxonLineage): Taxon[];
|
|
45
|
+
/**
|
|
46
|
+
* Whether a taxon is an NCBI placeholder for an unidentified species of a
|
|
47
|
+
* genus: a species named the genus and 'sp.', such as 'Streptomyces sp.'.
|
|
48
|
+
* One named for a strain ('Streptomyces sp. CNQ-509') is a taxon of its own.
|
|
49
|
+
* @param taxon - The taxon.
|
|
50
|
+
* @returns Whether it is one.
|
|
51
|
+
*/
|
|
52
|
+
export declare function isPlaceholderTaxon(taxon: Taxon): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* The lineage of a taxon, walked up a map of NCBI nodes to the root.
|
|
55
|
+
* @param nodes - The nodes, by id: a record keyed by the id written as a
|
|
56
|
+
* string, as JSON delivers it, or a map keyed by the number.
|
|
57
|
+
* @param taxId - The taxon to start from.
|
|
58
|
+
* @returns Every taxon from the root down to it, each with its id; empty when
|
|
59
|
+
* the map does not hold the taxon.
|
|
60
|
+
*/
|
|
61
|
+
export declare function lineageFromNodes(nodes: Readonly<Record<string, TaxonNode>> | ReadonlyMap<number, TaxonNode>, taxId: number): Taxon[];
|
|
62
|
+
/**
|
|
63
|
+
* The lineage written by a record of names by rank, the shape octochemdb
|
|
64
|
+
* stores (`{ kingdom: 'Fungi', genus: 'Penicillium', … }`).
|
|
65
|
+
*
|
|
66
|
+
* A key is matched whatever its case, so `superKingdom` reads as
|
|
67
|
+
* `superkingdom`; a key that names no rank, and an empty name, are left out.
|
|
68
|
+
* @param ranks - The names, by rank.
|
|
69
|
+
* @returns The taxa, from the top down.
|
|
70
|
+
*/
|
|
71
|
+
export declare function lineageFromRanks(ranks: Readonly<Record<string, string | null | undefined>>): Taxon[];
|
|
72
|
+
/**
|
|
73
|
+
* Which taxa of a lineage sit at the genus or under it — the ones whose names
|
|
74
|
+
* nomenclature sets in italics.
|
|
75
|
+
*
|
|
76
|
+
* A taxon with no rank (a clade, a strain NCBI left unranked) takes the place
|
|
77
|
+
* of the taxa above it: under a genus it is one of the genus's, above it it is
|
|
78
|
+
* a clade like Embryophyta, written upright.
|
|
79
|
+
* @param lineage - The lineage, from the top down.
|
|
80
|
+
* @returns One flag per taxon.
|
|
81
|
+
*/
|
|
82
|
+
export declare function genusOrBelow(lineage: TaxonLineage): boolean[];
|
|
83
|
+
//# sourceMappingURL=lineage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lineage.d.ts","sourceRoot":"","sources":["../../../src/taxonomy/core/lineage.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AASH,8BAA8B;AAC9B,MAAM,WAAW,KAAK;IACpB,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,4EAA4E;AAC5E,MAAM,MAAM,YAAY,GAAG,SAAS,KAAK,EAAE,CAAC;AAE5C,4DAA4D;AAC5D,MAAM,WAAW,SAAS;IACxB,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,YAAY,GAAG,KAAK,EAAE,CAc/D;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAExD;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,EAC3E,KAAK,EAAE,MAAM,GACZ,KAAK,EAAE,CAiBT;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC,GACzD,KAAK,EAAE,CAcT;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,EAAE,CAY7D"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A lineage: the taxa from the top of the tree of life down to one of them.
|
|
3
|
+
*
|
|
4
|
+
* It is read three ways, because the family meets it in three shapes: a map of
|
|
5
|
+
* NCBI nodes each pointing at its parent (what a database built on the NCBI
|
|
6
|
+
* dump answers), a record of names by rank (what octochemdb stores), or a list
|
|
7
|
+
* already in order.
|
|
8
|
+
*/
|
|
9
|
+
import { TAXON_RANKS, isGenusOrBelow, isPrincipalRank, rankOrder, } from "./ranks.js";
|
|
10
|
+
/**
|
|
11
|
+
* The taxa a lineage is summarised by: those of a principal rank (domain,
|
|
12
|
+
* kingdom, phylum, class, order, family, genus, species), and the last one
|
|
13
|
+
* whatever its rank, since it is the taxon the lineage leads to.
|
|
14
|
+
*
|
|
15
|
+
* An NCBI placeholder for an unidentified species ('Streptomyces sp.') says
|
|
16
|
+
* no more than its genus, so it is left out and the genus is the leaf. The
|
|
17
|
+
* root, 'cellular organisms', the clades and the steps of no rank above the
|
|
18
|
+
* leaf never show.
|
|
19
|
+
* @param lineage - The lineage, from the top down.
|
|
20
|
+
* @returns The taxa kept, in the same order.
|
|
21
|
+
*/
|
|
22
|
+
export function principalLineage(lineage) {
|
|
23
|
+
const kept = [];
|
|
24
|
+
let last = lineage.length - 1;
|
|
25
|
+
if (last > 0 && isPlaceholderTaxon(lineage[last])) {
|
|
26
|
+
// The genus becomes the leaf, past 'unclassified Streptomyces'.
|
|
27
|
+
last--;
|
|
28
|
+
while (last > 0 && !isPrincipalRank(lineage[last].rank))
|
|
29
|
+
last--;
|
|
30
|
+
}
|
|
31
|
+
for (let index = 0; index <= last; index++) {
|
|
32
|
+
const taxon = lineage[index];
|
|
33
|
+
if (index < last && isPlaceholderTaxon(taxon))
|
|
34
|
+
continue;
|
|
35
|
+
if (index === last || isPrincipalRank(taxon.rank))
|
|
36
|
+
kept.push(taxon);
|
|
37
|
+
}
|
|
38
|
+
return kept;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Whether a taxon is an NCBI placeholder for an unidentified species of a
|
|
42
|
+
* genus: a species named the genus and 'sp.', such as 'Streptomyces sp.'.
|
|
43
|
+
* One named for a strain ('Streptomyces sp. CNQ-509') is a taxon of its own.
|
|
44
|
+
* @param taxon - The taxon.
|
|
45
|
+
* @returns Whether it is one.
|
|
46
|
+
*/
|
|
47
|
+
export function isPlaceholderTaxon(taxon) {
|
|
48
|
+
return taxon.rank === 'species' && /\ssp\.$/.test(taxon.name);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The lineage of a taxon, walked up a map of NCBI nodes to the root.
|
|
52
|
+
* @param nodes - The nodes, by id: a record keyed by the id written as a
|
|
53
|
+
* string, as JSON delivers it, or a map keyed by the number.
|
|
54
|
+
* @param taxId - The taxon to start from.
|
|
55
|
+
* @returns Every taxon from the root down to it, each with its id; empty when
|
|
56
|
+
* the map does not hold the taxon.
|
|
57
|
+
*/
|
|
58
|
+
export function lineageFromNodes(nodes, taxId) {
|
|
59
|
+
const read = nodes instanceof Map
|
|
60
|
+
? (id) => nodes.get(id)
|
|
61
|
+
: (id) => nodes[String(id)];
|
|
62
|
+
const upward = [];
|
|
63
|
+
const seen = new Set();
|
|
64
|
+
let id = taxId;
|
|
65
|
+
while (!seen.has(id)) {
|
|
66
|
+
const node = read(id);
|
|
67
|
+
if (node === undefined)
|
|
68
|
+
break;
|
|
69
|
+
seen.add(id);
|
|
70
|
+
upward.push({ rank: node.rank, name: node.name, taxId: id });
|
|
71
|
+
id = node.parentId;
|
|
72
|
+
}
|
|
73
|
+
return upward.toReversed();
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The lineage written by a record of names by rank, the shape octochemdb
|
|
77
|
+
* stores (`{ kingdom: 'Fungi', genus: 'Penicillium', … }`).
|
|
78
|
+
*
|
|
79
|
+
* A key is matched whatever its case, so `superKingdom` reads as
|
|
80
|
+
* `superkingdom`; a key that names no rank, and an empty name, are left out.
|
|
81
|
+
* @param ranks - The names, by rank.
|
|
82
|
+
* @returns The taxa, from the top down.
|
|
83
|
+
*/
|
|
84
|
+
export function lineageFromRanks(ranks) {
|
|
85
|
+
const byRank = new Map();
|
|
86
|
+
for (const key of Object.keys(ranks)) {
|
|
87
|
+
const name = ranks[key]?.trim();
|
|
88
|
+
if (name === undefined || name === '')
|
|
89
|
+
continue;
|
|
90
|
+
const rank = key.toLowerCase();
|
|
91
|
+
if (rankOrder(rank) !== undefined)
|
|
92
|
+
byRank.set(rank, name);
|
|
93
|
+
}
|
|
94
|
+
const lineage = [];
|
|
95
|
+
for (const rank of TAXON_RANKS) {
|
|
96
|
+
const name = byRank.get(rank);
|
|
97
|
+
if (name !== undefined)
|
|
98
|
+
lineage.push({ rank, name });
|
|
99
|
+
}
|
|
100
|
+
return lineage;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Which taxa of a lineage sit at the genus or under it — the ones whose names
|
|
104
|
+
* nomenclature sets in italics.
|
|
105
|
+
*
|
|
106
|
+
* A taxon with no rank (a clade, a strain NCBI left unranked) takes the place
|
|
107
|
+
* of the taxa above it: under a genus it is one of the genus's, above it it is
|
|
108
|
+
* a clade like Embryophyta, written upright.
|
|
109
|
+
* @param lineage - The lineage, from the top down.
|
|
110
|
+
* @returns One flag per taxon.
|
|
111
|
+
*/
|
|
112
|
+
export function genusOrBelow(lineage) {
|
|
113
|
+
const flags = [];
|
|
114
|
+
let below = false;
|
|
115
|
+
for (const taxon of lineage) {
|
|
116
|
+
if (isGenusOrBelow(taxon.rank)) {
|
|
117
|
+
below = true;
|
|
118
|
+
}
|
|
119
|
+
else if (rankOrder(taxon.rank) !== undefined) {
|
|
120
|
+
below = false;
|
|
121
|
+
}
|
|
122
|
+
flags.push(below);
|
|
123
|
+
}
|
|
124
|
+
return flags;
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=lineage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lineage.js","sourceRoot":"","sources":["../../../src/taxonomy/core/lineage.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,WAAW,EACX,cAAc,EACd,eAAe,EACf,SAAS,GACV,MAAM,YAAY,CAAC;AA4BpB;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAqB;IACpD,MAAM,IAAI,GAAY,EAAE,CAAC;IACzB,IAAI,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IAC9B,IAAI,IAAI,GAAG,CAAC,IAAI,kBAAkB,CAAC,OAAO,CAAC,IA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,MAAM,UAAU,YAAY,CAAC,OAAqB;IAChD,MAAM,KAAK,GAAc,EAAE,CAAC;IAC5B,IAAI,KAAK,GAAG,KAAK,CAAC;IAClB,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,IAAI,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAC/B,KAAK,GAAG,IAAI,CAAC;QACf,CAAC;aAAM,IAAI,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;YAC/C,KAAK,GAAG,KAAK,CAAC;QAChB,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The page of a taxon in the NCBI Taxonomy Browser.
|
|
3
|
+
* @param taxId - The NCBI Taxonomy id.
|
|
4
|
+
* @returns Its address, e.g.
|
|
5
|
+
* `https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=5076`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function ncbiTaxonomyUrl(taxId: number): string;
|
|
8
|
+
//# sourceMappingURL=ncbi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ncbi.d.ts","sourceRoot":"","sources":["../../../src/taxonomy/core/ncbi.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAErD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The page of a taxon in the NCBI Taxonomy Browser.
|
|
3
|
+
* @param taxId - The NCBI Taxonomy id.
|
|
4
|
+
* @returns Its address, e.g.
|
|
5
|
+
* `https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=5076`.
|
|
6
|
+
*/
|
|
7
|
+
export function ncbiTaxonomyUrl(taxId) {
|
|
8
|
+
return `https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=${encodeURIComponent(String(taxId))}`;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=ncbi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ncbi.js","sourceRoot":"","sources":["../../../src/taxonomy/core/ncbi.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,KAAa;IAC3C,OAAO,+DAA+D,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;AAC5G,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which parts of an organism's name nomenclature sets in italics.
|
|
3
|
+
*
|
|
4
|
+
* The genus, the species epithet and an infraspecific epithet are italic; the
|
|
5
|
+
* authority, a strain, `sp.`, a cultivar and the words announcing a rank
|
|
6
|
+
* (`subsp.`, `var.`, `f.`) are upright. Names arrive the way their source wrote
|
|
7
|
+
* them — "Catharanthus roseus (L.) G. Don", "Streptomyces sp. CHQ-64",
|
|
8
|
+
* "Isodon Shikokiana Var. Occidentalis" — so this reads them by their shape,
|
|
9
|
+
* and a name it cannot place is left upright rather than guessed at.
|
|
10
|
+
*/
|
|
11
|
+
/** A run of an organism's name, set one way. */
|
|
12
|
+
export interface OrganismNamePart {
|
|
13
|
+
/** The text, exactly as the name carries it. */
|
|
14
|
+
text: string;
|
|
15
|
+
/** Whether nomenclature sets it in italics. */
|
|
16
|
+
italic: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The runs of an organism's name, each set upright or in italics.
|
|
20
|
+
*
|
|
21
|
+
* Joined together, the runs give back the name exactly. A consortium written
|
|
22
|
+
* `A + B` is read as two names; a virus, and anything that does not open with
|
|
23
|
+
* a genus, is one upright run.
|
|
24
|
+
* @param name - The name, as its source writes it.
|
|
25
|
+
* @returns The runs, consecutive runs never set the same way.
|
|
26
|
+
*/
|
|
27
|
+
export declare function splitOrganismName(name: string): OrganismNamePart[];
|
|
28
|
+
//# sourceMappingURL=organismName.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organismName.d.ts","sourceRoot":"","sources":["../../../src/taxonomy/core/organismName.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAYH,gDAAgD;AAChD,MAAM,WAAW,gBAAgB;IAC/B,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,MAAM,EAAE,OAAO,CAAC;CACjB;AAyBD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAYlE"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which parts of an organism's name nomenclature sets in italics.
|
|
3
|
+
*
|
|
4
|
+
* The genus, the species epithet and an infraspecific epithet are italic; the
|
|
5
|
+
* authority, a strain, `sp.`, a cultivar and the words announcing a rank
|
|
6
|
+
* (`subsp.`, `var.`, `f.`) are upright. Names arrive the way their source wrote
|
|
7
|
+
* them — "Catharanthus roseus (L.) G. Don", "Streptomyces sp. CHQ-64",
|
|
8
|
+
* "Isodon Shikokiana Var. Occidentalis" — so this reads them by their shape,
|
|
9
|
+
* and a name it cannot place is left upright rather than guessed at.
|
|
10
|
+
*/
|
|
11
|
+
import { BEFORE_EPITHET, CANDIDATUS, HYBRID, NOT_EPITHET, NOT_GENUS, RANK_MARKERS, UNNAMED, } from "./organismWords.js";
|
|
12
|
+
const CONSORTIUM = /(?<plus>\s+\+\s+)/;
|
|
13
|
+
const VIRUS = /\b(?:virus|viruses|phage|bacteriophage|viroid|satellite)\b/i;
|
|
14
|
+
const SEPARATOR = /^[\s_]+$/;
|
|
15
|
+
const TRAILING_MARK = /^(?<word>.+?)(?<mark>[,;]+)$/;
|
|
16
|
+
const GENUS = /^[A-Z][a-z]+$/;
|
|
17
|
+
const ABBREVIATED_GENUS = /^[A-Z]\.$/;
|
|
18
|
+
// A family, a subfamily or a tribe written where a genus would stand:
|
|
19
|
+
// -aceae, -oideae and -eae in botany, -idae in zoology. No genus ends so.
|
|
20
|
+
const FAMILY = /(?:eae|idae)$/;
|
|
21
|
+
const BRACKETED_GENUS = /^\[(?<genus>[A-Z][a-z]+)\]$/;
|
|
22
|
+
const JOINED_MARKER = /^(?<marker>subsp\.|ssp\.|var\.|f\.|pv\.)(?<epithet>[a-z][a-z-]+)$/i;
|
|
23
|
+
const EPITHET = /^[a-zß-öø-ÿ][a-zß-öø-ÿ-]+$/;
|
|
24
|
+
const CAPITALISED_EPITHET = /^[A-Z][a-zß-öø-ÿ-]+$/;
|
|
25
|
+
const STARTS_WITH_LETTER = /^\p{L}/u;
|
|
26
|
+
const STARTS_UPPERCASE = /^\p{Lu}/u;
|
|
27
|
+
/**
|
|
28
|
+
* The runs of an organism's name, each set upright or in italics.
|
|
29
|
+
*
|
|
30
|
+
* Joined together, the runs give back the name exactly. A consortium written
|
|
31
|
+
* `A + B` is read as two names; a virus, and anything that does not open with
|
|
32
|
+
* a genus, is one upright run.
|
|
33
|
+
* @param name - The name, as its source writes it.
|
|
34
|
+
* @returns The runs, consecutive runs never set the same way.
|
|
35
|
+
*/
|
|
36
|
+
export function splitOrganismName(name) {
|
|
37
|
+
if (name === '')
|
|
38
|
+
return [];
|
|
39
|
+
if (VIRUS.test(name))
|
|
40
|
+
return [{ text: name, italic: false }];
|
|
41
|
+
const pieces = [];
|
|
42
|
+
for (const segment of name.split(CONSORTIUM)) {
|
|
43
|
+
if (CONSORTIUM.test(segment)) {
|
|
44
|
+
pieces.push({ text: segment, word: false, italic: false });
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
pieces.push(...styledPieces(segment));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return mergedRuns(pieces);
|
|
51
|
+
}
|
|
52
|
+
function styledPieces(text) {
|
|
53
|
+
const pieces = tokenize(text);
|
|
54
|
+
const words = pieces.filter((piece) => piece.word);
|
|
55
|
+
styleWords(words);
|
|
56
|
+
for (let index = 0; index < pieces.length; index++) {
|
|
57
|
+
const piece = pieces[index];
|
|
58
|
+
if (piece.word)
|
|
59
|
+
continue;
|
|
60
|
+
piece.italic =
|
|
61
|
+
pieces[index - 1]?.italic === true && pieces[index + 1]?.italic === true;
|
|
62
|
+
}
|
|
63
|
+
return pieces;
|
|
64
|
+
}
|
|
65
|
+
function tokenize(text) {
|
|
66
|
+
const pieces = [];
|
|
67
|
+
for (const chunk of text.split(/(?<gap>[\s_]+)/)) {
|
|
68
|
+
if (chunk === '')
|
|
69
|
+
continue;
|
|
70
|
+
if (SEPARATOR.test(chunk)) {
|
|
71
|
+
pieces.push({ text: chunk, word: false, italic: false });
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
// A comma or a semicolon closing a word is punctuation, not part of it.
|
|
75
|
+
const { word: bare = chunk, mark } = TRAILING_MARK.exec(chunk)?.groups ?? {};
|
|
76
|
+
const joined = JOINED_MARKER.exec(bare)?.groups;
|
|
77
|
+
const bracketed = BRACKETED_GENUS.exec(bare)?.groups;
|
|
78
|
+
const words = joined !== undefined
|
|
79
|
+
? [joined.marker, joined.epithet]
|
|
80
|
+
: bracketed !== undefined
|
|
81
|
+
? ['[', bracketed.genus, ']']
|
|
82
|
+
: [bare];
|
|
83
|
+
for (const word of words) {
|
|
84
|
+
pieces.push({ text: word ?? '', word: true, italic: false });
|
|
85
|
+
}
|
|
86
|
+
if (mark !== undefined) {
|
|
87
|
+
pieces.push({ text: mark, word: false, italic: false });
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return pieces;
|
|
91
|
+
}
|
|
92
|
+
function styleWords(words) {
|
|
93
|
+
let index = words[0]?.text === '×' ? 1 : 0;
|
|
94
|
+
const first = words[index];
|
|
95
|
+
if (first === undefined)
|
|
96
|
+
return;
|
|
97
|
+
if (CANDIDATUS.has(first.text)) {
|
|
98
|
+
first.italic = true;
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
let genus;
|
|
102
|
+
if (first.text === '[' && words[index + 2]?.text === ']') {
|
|
103
|
+
genus = words[index + 1];
|
|
104
|
+
index += 3;
|
|
105
|
+
}
|
|
106
|
+
else if (GENUS.test(first.text) || ABBREVIATED_GENUS.test(first.text)) {
|
|
107
|
+
genus = first;
|
|
108
|
+
index += 1;
|
|
109
|
+
}
|
|
110
|
+
if (genus === undefined ||
|
|
111
|
+
NOT_GENUS.has(genus.text.toLowerCase()) ||
|
|
112
|
+
FAMILY.test(genus.text)) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
genus.italic = true;
|
|
116
|
+
const titleCase = isTitleCase(words);
|
|
117
|
+
const next = words[index]?.text;
|
|
118
|
+
if (next === undefined || UNNAMED.has(next.toLowerCase()))
|
|
119
|
+
return;
|
|
120
|
+
let announced = false;
|
|
121
|
+
if (HYBRID.has(next) || BEFORE_EPITHET.has(next.toLowerCase())) {
|
|
122
|
+
index += 1;
|
|
123
|
+
announced = true;
|
|
124
|
+
}
|
|
125
|
+
if (isEpithet(words[index], titleCase || announced)) {
|
|
126
|
+
words[index].italic = true;
|
|
127
|
+
index += 1;
|
|
128
|
+
// A zoological trinomial names its subspecies with no word announcing it.
|
|
129
|
+
if (isEpithet(words[index], false)) {
|
|
130
|
+
words[index].italic = true;
|
|
131
|
+
index += 1;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
for (; index < words.length; index++) {
|
|
135
|
+
const word = words[index].text;
|
|
136
|
+
const marks = RANK_MARKERS.has(word.toLowerCase()) || HYBRID.has(word);
|
|
137
|
+
if (marks && isEpithet(words[index + 1], true)) {
|
|
138
|
+
words[index + 1].italic = true;
|
|
139
|
+
index += 1;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
function isEpithet(word, capitalised) {
|
|
144
|
+
if (word === undefined)
|
|
145
|
+
return false;
|
|
146
|
+
const lower = word.text.toLowerCase();
|
|
147
|
+
if (NOT_EPITHET.has(lower) ||
|
|
148
|
+
UNNAMED.has(lower) ||
|
|
149
|
+
RANK_MARKERS.has(lower) ||
|
|
150
|
+
HYBRID.has(word.text)) {
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
return (EPITHET.test(word.text) ||
|
|
154
|
+
(capitalised && CAPITALISED_EPITHET.test(word.text)));
|
|
155
|
+
}
|
|
156
|
+
// A source that capitalises every word ("Agave Americana") still means a
|
|
157
|
+
// binomial; the words announcing a rank are left out of the count.
|
|
158
|
+
function isTitleCase(words) {
|
|
159
|
+
let lettered = 0;
|
|
160
|
+
for (const { text } of words) {
|
|
161
|
+
const lower = text.toLowerCase();
|
|
162
|
+
if (RANK_MARKERS.has(lower) || UNNAMED.has(lower) || HYBRID.has(text)) {
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
if (!STARTS_WITH_LETTER.test(text))
|
|
166
|
+
continue;
|
|
167
|
+
if (!STARTS_UPPERCASE.test(text))
|
|
168
|
+
return false;
|
|
169
|
+
lettered += 1;
|
|
170
|
+
}
|
|
171
|
+
return lettered >= 2;
|
|
172
|
+
}
|
|
173
|
+
function mergedRuns(pieces) {
|
|
174
|
+
const runs = [];
|
|
175
|
+
for (const piece of pieces) {
|
|
176
|
+
if (piece.text === '')
|
|
177
|
+
continue;
|
|
178
|
+
const last = runs.at(-1);
|
|
179
|
+
if (last?.italic === piece.italic) {
|
|
180
|
+
last.text += piece.text;
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
runs.push({ text: piece.text, italic: piece.italic });
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return runs;
|
|
187
|
+
}
|
|
188
|
+
//# sourceMappingURL=organismName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organismName.js","sourceRoot":"","sources":["../../../src/taxonomy/core/organismName.ts"],"names":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;aAAM,CAAC;YACN,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The words an organism's name is read by: the signs and abbreviations that
|
|
3
|
+
* announce a rank or qualify a name, and the ordinary words a source writes
|
|
4
|
+
* where a genus or an epithet would stand.
|
|
5
|
+
*/
|
|
6
|
+
/** The hybrid sign, and the letters written for it. */
|
|
7
|
+
export declare const HYBRID: Set<string>;
|
|
8
|
+
/** The word that opens a provisional bacterial name; it alone is italic. */
|
|
9
|
+
export declare const CANDIDATUS: Set<string>;
|
|
10
|
+
/** Qualifiers set before the epithet they qualify, in lower case. */
|
|
11
|
+
export declare const BEFORE_EPITHET: Set<string>;
|
|
12
|
+
/** An unnamed species of the genus, in lower case. */
|
|
13
|
+
export declare const UNNAMED: Set<string>;
|
|
14
|
+
/** The abbreviations announcing a lower-rank epithet, in lower case. */
|
|
15
|
+
export declare const RANK_MARKERS: Set<string>;
|
|
16
|
+
/** Words that open a description rather than a binomial, in lower case. */
|
|
17
|
+
export declare const NOT_GENUS: Set<string>;
|
|
18
|
+
/** Lower-case words that follow a binomial without being an epithet. */
|
|
19
|
+
export declare const NOT_EPITHET: Set<string>;
|
|
20
|
+
//# sourceMappingURL=organismWords.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organismWords.d.ts","sourceRoot":"","sources":["../../../src/taxonomy/core/organismWords.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,uDAAuD;AACvD,eAAO,MAAM,MAAM,aAA2B,CAAC;AAC/C,4EAA4E;AAC5E,eAAO,MAAM,UAAU,aAAiC,CAAC;AACzD,qEAAqE;AACrE,eAAO,MAAM,cAAc,aAA+C,CAAC;AAC3E,sDAAsD;AACtD,eAAO,MAAM,OAAO,aAAwC,CAAC;AAC7D,wEAAwE;AACxE,eAAO,MAAM,YAAY,aAiBvB,CAAC;AACH,2EAA2E;AAC3E,eAAO,MAAM,SAAS,aAmBpB,CAAC;AACH,wEAAwE;AACxE,eAAO,MAAM,WAAW,aA8BtB,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The words an organism's name is read by: the signs and abbreviations that
|
|
3
|
+
* announce a rank or qualify a name, and the ordinary words a source writes
|
|
4
|
+
* where a genus or an epithet would stand.
|
|
5
|
+
*/
|
|
6
|
+
/** The hybrid sign, and the letters written for it. */
|
|
7
|
+
export const HYBRID = new Set(['×', 'x', 'X']);
|
|
8
|
+
/** The word that opens a provisional bacterial name; it alone is italic. */
|
|
9
|
+
export const CANDIDATUS = new Set(['Candidatus', 'Ca.']);
|
|
10
|
+
/** Qualifiers set before the epithet they qualify, in lower case. */
|
|
11
|
+
export const BEFORE_EPITHET = new Set(['cf.', 'cf', 'aff.', 'aff', 'nr.']);
|
|
12
|
+
/** An unnamed species of the genus, in lower case. */
|
|
13
|
+
export const UNNAMED = new Set(['sp.', 'sp', 'spp.', 'spp']);
|
|
14
|
+
/** The abbreviations announcing a lower-rank epithet, in lower case. */
|
|
15
|
+
export const RANK_MARKERS = new Set([
|
|
16
|
+
'subsp.',
|
|
17
|
+
'ssp.',
|
|
18
|
+
'nothosubsp.',
|
|
19
|
+
'var.',
|
|
20
|
+
'nothovar.',
|
|
21
|
+
'subvar.',
|
|
22
|
+
'f.',
|
|
23
|
+
'fo.',
|
|
24
|
+
'forma',
|
|
25
|
+
'subf.',
|
|
26
|
+
'pv.',
|
|
27
|
+
'subgen.',
|
|
28
|
+
'sect.',
|
|
29
|
+
'subsect.',
|
|
30
|
+
'ser.',
|
|
31
|
+
'subser.',
|
|
32
|
+
]);
|
|
33
|
+
/** Words that open a description rather than a binomial, in lower case. */
|
|
34
|
+
export const NOT_GENUS = new Set([
|
|
35
|
+
'unknown',
|
|
36
|
+
'unidentified',
|
|
37
|
+
'uncultured',
|
|
38
|
+
'unclassified',
|
|
39
|
+
'environmental',
|
|
40
|
+
'fungal',
|
|
41
|
+
'bacterial',
|
|
42
|
+
'marine',
|
|
43
|
+
'endophytic',
|
|
44
|
+
'mixed',
|
|
45
|
+
'fungus',
|
|
46
|
+
'bacterium',
|
|
47
|
+
'endophyte',
|
|
48
|
+
'strain',
|
|
49
|
+
'isolate',
|
|
50
|
+
'plant',
|
|
51
|
+
'soil',
|
|
52
|
+
'sponge',
|
|
53
|
+
]);
|
|
54
|
+
/** Lower-case words that follow a binomial without being an epithet. */
|
|
55
|
+
export const NOT_EPITHET = new Set([
|
|
56
|
+
'strain',
|
|
57
|
+
'isolate',
|
|
58
|
+
'symbiont',
|
|
59
|
+
'endophyte',
|
|
60
|
+
'clone',
|
|
61
|
+
'group',
|
|
62
|
+
'complex',
|
|
63
|
+
'culture',
|
|
64
|
+
'cultivar',
|
|
65
|
+
'serovar',
|
|
66
|
+
'biovar',
|
|
67
|
+
'pathovar',
|
|
68
|
+
'species',
|
|
69
|
+
'incertae',
|
|
70
|
+
'sedis',
|
|
71
|
+
'and',
|
|
72
|
+
'et',
|
|
73
|
+
'ex',
|
|
74
|
+
'in',
|
|
75
|
+
'non',
|
|
76
|
+
'sensu',
|
|
77
|
+
'auct',
|
|
78
|
+
'de',
|
|
79
|
+
'du',
|
|
80
|
+
'la',
|
|
81
|
+
'le',
|
|
82
|
+
'van',
|
|
83
|
+
'von',
|
|
84
|
+
'der',
|
|
85
|
+
]);
|
|
86
|
+
//# sourceMappingURL=organismWords.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organismWords.js","sourceRoot":"","sources":["../../../src/taxonomy/core/organismWords.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,uDAAuD;AACvD,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE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