dataesr/scientific-paragraphs-categorization huggingface dataset:
As features we used an unbiased k-mer scoring, which is naive to any known transcription factor motif and thus generalizable to other systems. We used the matchKmers function in chromVAR with parameters k = 7 and genome = BSgenome. Hsapiens. UCSC. hg19, which returns a matrix of dimension number of peaks by number of k-mers where a 1 indicates that the peak contains the k-mer sequence. The output of this function was then included in the computeDeviations function to compute chromatin accessibility z-scores for each of the k-mers in our dataset. This matrix of cells by k-mer accessibility z-scores serves as a data-driven dimensionality reduction of the chromatin accessibility profiles of these cells. Based on the z-score matrix of k-mer DNA sequences, all the 7-mer features are standardized to have zero mean and unit variance.
PCA is performed on the scaled matrix to convert z-score to principal components. According to the variance ratio elbow plot we selected the top 15 PCs, but excluded the first component since it captured technical noise (dropout and number of reads). The obtained matrix is used to reconstruct trajectories as previously described. Diverging and transition k-mers were selected with the same procedures used for gene selection. Finally, detected k-mers were mapped to known transcription factors using Tomtom  19  (http://memesuite. org/tools/tomtom) and a motif database previously assembled [chromvar_and_hocomoco. meme](https://github. com/buenrostrolab/chromVARmotifs)  16.
Comparison of methods for trajectory inference Simulated datasets: Given a set of n cells and assuming we know their developmental/sampling time and topological organization, i. e. how they are organized in branches, we can easily evaluate a generic reconstruction method with the following two metrics: 1. Difference between the number of inferred and true branches. 2. Correlation between the true sampling time 𝑋 and the inferred pseudotime 𝑌. For the pseudotime we use either the proposed ranking or the actual distance from the starting point as provided by each method. We used 3 different measure of correlation: Pearson correlation 𝑟, Spearman correlation 𝜌 and Kendall's tau correlation 𝜏, calculated as follow: 𝑟 h--˜™š›#oe-= ∑ (𝑥 # -𝑥̅ ) ž #OP (𝑦 # -𝑦 Ÿ) ∑ (𝑥 # -𝑥̅ ) D ž #OP ∑ (𝑦 # -𝑦 Ÿ) D ž #OP 𝑟 r¡ž) = ∑ (𝑥 # -𝑥̅ ) ž #OP (𝑟𝑔 £ # -𝑟𝑔 £ ŸŸŸŸŸ) ∑ (𝑥 # -𝑥̅ ) D ž #OP | ∑ (𝑟𝑔 £ # -𝑟𝑔 £ ŸŸŸŸŸ) D ž #OP 𝜌 = 𝑐𝑜𝑣(𝑟𝑔 ¦ , 𝑟𝑔 § ) 𝜎 r¨© 𝜎 r¨ª 𝜏 = 1 𝑛(𝑛 -1) 0 𝑠𝑔𝑛A𝑥 # -𝑥 * C𝑠𝑔𝑛A𝑦 # -𝑦 * C #«* Where 𝑟𝑔 ¦ and 𝑟𝑔 § are the ranks of cells, 𝑐𝑜𝑣(𝑟𝑔 ¦ , 𝑟𝑔 § ) is the covariance of rank variables, 𝜎 r¨© and 𝜎 r¨ª are the standard deviations of rank variables.
Real datasets: To evaluate the quality of reconstruction in real datasets in which we do not have the real developmental time and topological information, we used the following two metrics: 1. Path-specific marker gene correlation analysis: In real datasets oftentimes, we don't have the sampling time along a branch. In this case, instead, it is helpful to evaluate how the inferred pseudotime recapitulates the progressive activation or repression of an important gene along that branch. The main idea here is that ordering cells based on a marker gene, which is important in defining a developmental trajectory, as a reasonable surrogate for the correct pseudotime ordering. As in the simulation case we computed 4 correlation coefficients using marker gene expression 𝑋 and the inferred pseudotime 𝑌.
To show the utility of the mapping feature, we applied STREAM on scRNA-seq data from Olsson et al. 2017  11. Using FACS sorting, 382 cells were isolated and profiled from different subpopulations, including stem/multipotent progenitor (LSK; lin-, Sca1+, c-Kit+), CMP, GMP, and LKCD34+(lin-c-Kit+CD34+) cells (Supplementary Fig. 3a.
left). A key result of this study is the discovery of metastable mixed-lineage states and the presence of co-expressed genes at single-cell level from competing lineages. The authors suggest that these metastable states are important in cell-fate decisions and that transcription factors play a key role in this process. In fact, they uncovered and validated two key transcription factors, i. e. Gfi1 and Irf8, that are co-expressed in a sub-population and are shown to be important for the commitment to neutrophils or macrophages. Importantly, this dataset contains, in addition to wild-type data, genetic perturbations of those two key regulators. Using the wild-type data, STREAM unbiasedly and correctly reconstructs the cell lineage hierarchy (Supplementary Fig. 3a  right) as shown by inspection of the labels proposed in the original study (either cell surface markers or predicted lineages): starting from haematopoietic stem cell/progenitor(HSCP), cells bifurcate into an erythrocytic branch (which contains megakaryocytic (Meg) and erythrocytic (Eryth) cells) and into a multi-lineage primed (Multi-Lin) branch.
Multi-Lin cells further separate into the granulocytic (Gran) branch and monocytic (Mono) branch. The hierarchical progression can be easily visualized by our proposed 2D visualizations: subway map and stream plots (Supplementary Fig. 3b ). Importantly, STREAM precisely recovers the bifurcation event from Muli-lineage to Mono and Gran as shown in the original study within the wild-type GMP cellular population (Supplementary Fig. 3b, c ), whereas the proposed Monocle2 analysis in the same dataset  12  incorrectly assigns those cells to a very short erythroid branch. Furthermore, Monocle2 branch lengths are overall very diverse and distorted in their hierarchical representation (FE branch in Fig 2 , and Supplementary Fig. 18  of the original paper  12  ). Using our gene expression analysis, the Gran-specific gene Gfi1, Monospecific gene Irf8, and Eryth-specific gene Gata1 are highly expressed on their respective inferred trajectories, confirming the validity of the reconstructed branching structure (Supplementary Fig.
3d ). Next, using the STREAM mapping function, we analyzed the genetic perturbation data to study the consequences on cell fate determination of Gfi1 loss (Gfi1 -/-), Irf8 loss (Irf8 -/-) and both Gfi1 and Irf8 loss (Gfi1 -/-Irf8 -/-) within wild-type GMP cells (Supplementary Fig. 4a ). Gfi1 -/-GMP cells tend to differentiate into the Mono branch and Irf8 -/-GMP cells lean toward the Gran branch. Gfi1 -/-Irf8 -/-GMP cells have equal chance to go either way. The loss of Gfi1 and Irf8 instead does not show any imbalance of cells differentiating into the diverging branches (Supplementary Fig. 4b-d ). Our predictions are validated by the original study where the authors used GMP cells with inducible expression and GFP reporters for Gfi1 and Irf8. Irf8 loss led to cells that differentiated toward granulocyte.
Supplementary Supplementary Figure  4  Mapping of genetic perturbation data to the inferred trajectories from wild-type mouse hematopoietic cells. (a) Left, scRNA sequencing is performed on genetically perturbed cells within the GMP populations: Gfi1-/-, Irf8-/-and Gfi1-/-Irf8-/-. Right, genetically perturbed cells are mapped using STREAM to the low dimensional space in which cellular trajectories were built based on wild-type cells. (b) At density level, stream plots easily summarize the effects of the 3 genetic perturbations: Gfi1-/-cells are diverted to monocyte-committed branch while Irf8-/-cells are instead diverted to granulocyte-committed branch. Gfi1-/-Irf8-/-cells have equal chances to differentiate into either branch. (c) Single-cell level visualization of perturbed cells on the reference flat tree plot constructed from wild-type cells (top).
Supplementary Note 3: STREAM analysis on single cell qPCR data of the zebrafish hematopoietic system Next, we tested STREAM with data from a different organism, analyzing recently published single-cell qPCR data from Moore et al  13  , that provided a first model of the zebrafish hematopoiesis system using a panel of 96 gene primers. 166 cells were profiled from the wild-type(WT) whole-kidney marrow (WKM). STREAM analysis uncovered four cell lineages trajectories (Supplementary Fig. 5a left ). Based on the automatic gene detection module of STREAM, we uncovered marker genes for each trajectory (Supplementary Fig. 5a ), which includes T cell marker gene TCR-alpha, myeloid marker gene nccrp-1, B-cell marker gene CD79 and erythroid marker gene band3. Based on this analysis, we hypothesize that the inferred four branches corresponded to T cells, myeloid, B cell and erythroid lineages (Supplementary Fig.
5a right ). û ü ü û ü û û û û û ü The mapping feature û û û û û û û û û û ü Tested on epigenomic data û û ü û û û û û û û ü trajectory. (density information is not available). SCUBA, each node is one cluster and the node size represents the variance within each cluster. (neither visualization of single-cells or density information is available with this method). We next calculated for each method the correlation (Online methods) between true pseudotime and inferred pseudotime. Our method has the best performance for two out of four metrics (importantly when using the actual pseudotime defined as the distance of each cell from the origin in the proposed embedding) and comparable performance for the other two rank-based metrics (following scTDA in which this synthetic dataset was proposed) (Supplementary Fig.
Supplementary Figure 9 Analysis results of different methods on synthetic data Correlation (Pearson, Spearman and Kendall's tau) between real and inferred pseudotime (either rank or distance based) for the 11 methods tested. In summary, STREAM correctly recovers the correct topology, has the best pseudotime reconstruction performance when using distance-based pseudotime along a trajectory, and is the only tool that provides a visualization to study the density of different cell types in different branches. To compare the different methods on real datasets, we first used the most commonly used scRNA-seq dataset for this task, originally proposed by Trapnell et al  25. This dataset contains human skeletal muscle myoblasts (HSMM) cells differentiating along a linear trajectory. In this analysis, we were able to evaluate only methods capable to detect the correct bifurcation event.
github. io/monocle-release/). To illustrate STREAM analysis on scATAC-seq data, a total of 3,072 cells were profiled from the human bone marrow and isolated by FACS into nine different cellular populations, including HSC, MPP, CMP, CLP, LMPP, GMP, MEP, mono and plasmacytoid dendritic cells (pDCs)  30. After filtering cells as previously described,  31  single cell accessibility profiles for 2,034 high-quality cells passed quality control. We emphasize that each cell was sorted using multiple surface markers as previously described  32  , providing a phenotypic "true positive" for cell state that would enable us to determine the accuracy of STREAM. To consider general features related to chromatin accessibility, as many transcription factor motifs have been defined from the hematopoietic system, we sought to determine the efficacy of our approach using general DNA sequence features, i.
e. unbiased k-mer scores, which are naive to any known transcription factor motifs and thus generalizable to other systems. To this end, starting from count data and using chromVAR  33  , we first constructed a matrix of cells x k-mer accessibility z-scores in our dataset (in our experiments k=7). The k-mer accessibility z-scores are then used by STREAM as features to reconstruct trajectories (Online Methods). STREAM accurately reconstructed cellular developmental trajectories of the human blood system: the HSCs branch segregates through MPP into the erythrocyte-committed, lymphocyte-committed and myelocyte-committed branches. STREAM also reconstructed the bifurcation from lymphoid multipotent progenitors (LMPP) to CLP and plasmacytoid dendritic cells (pDC). Interestingly, STREAM reveals a similar and consistent hematopoietic hierarchy described by orthogonal assays such as transcriptomic profiling (Fig.
Example of the mapping feature: To use the mapping feature, users need to provide two datasets: one used to inferring trajectories and the other containing cells to be mapped to the inferred trajectories. Here to illustrate this feature we use data from Moore et al. 2016 and in particular those two files: Moore. tsv (cells used to infer trajectories), data_mapping. tsv (cells to map). We first infer trajetories using the following command: position of the region. The order of regions should be consistent with the regions indices in the count file. No header is necessary: docker run pinellolab/stream -v $PWD:/data -w /data --atac -s PCA --atac_counts count_file. tsv --atac_sample_file. tsv --atac_regions region_file. bed -l cell_label. tsv -c cell_label_color. tsv This command will generate a file named df_zscores_scaled.
, 2012; Seng et al. , 2010). Whenever MALDI-TOF MS fails to identify the tested organism, 16S rRNA gene sequencing was performed as formerly done for further phylogenetic analysis  (Drancourt, Berger, & Raoult, 2004). CodonCode Aligner tool (http://www. codoncode. com) served for sequence optimization and alignment. Retrieved sequences were blasted in NCBI nucleotide database (http://blast. ncbi. nlm. nih. gov. gate1. inist. fr/Blast. cgi) , and species or genera delimitation thresholds were adapted according to  Kim, Oh, Park, and Chun (2014).
| Phylogenetic analysis A maximum-likelihood 16S rRNA gene sequence-based phylogenetic tree was constructed using the MEGA software with 500 bootstraps  (Kumar et al. , 1994). Blast was done (https://blast. ncbi. nlm. nih. gov/Blast. cgi?PAGE TYPE=BlastSearch), and NCBI nucleotide database (https://www. ncbi. nlm. nih. gov/nucleotide/) was used for the phylogenetically closest species with standing in nomenclatures' sequence download. CLUSTAL W was used for sequence alignment  (Thompson, Higgins, & Gibson, 1994).
| Strain Marseille-P4678 T identification The mass spectrum of strain Marseille-P4678 T was missing in the current MALDI-TOF MS Bruker database. Thus, its identification with the means of this technique was not possible. Consequently, 16S rRNA gene sequencing analysis showed that the understudied organism has more than 5% sequence divergence with Parvimonas micra strain 3119B T (NR 036934. 1), its phylogenetically closest species with standing in nomenclature (Figure  1 ). Thus, according to  Kim et al. (2014) , we propose the isolation of a new bacterial genus. To analyze at the proteomic level strain Marseille-P4678 T , a gel view comparing the available mass spectra of the phylogenetically closest species with standing in nomenclature was done (Figure  2b ). The gel view shows that strain Marseille-P4678 T has a unique peaks profile that does not match completely with any of the implemented organisms.
ACK N OWLED G M ENTS This study was supported by  IHU Méditerranée Infection, Marseille, France , and by the  French Government  under the " Investissements d'avenir" (Investments for the Future) program  managed by the  Agence Nationale de la Recherche  ( ANR , fr:  National Agency for Research)  (reference: Méditerranée Infection  10-IAHU-03 ). This work was supported by  Région Provence Alpes Côte d'Azur and European funding FEDER PRIMI.
8 ± 2. 45 35. 4 ± 2. 45 100% PC 27 ± 2. 4 28. 7 ± 2. 45 34. 9 ± 2. 45 38. 7 ± 2. 5 100% HS 27. 5 ± 2. 45 21. 9 ± 2. 35 20. 4 ± 2. 3 100% FM 20. 1 ± 2. 3 22. 2 ± 2. 35 100% PM 19. 3 ± 2. 3 100% MM 100% With the means of this approach, we succeeded in isolating a new bacte- rial genus (M. massiliensis strain Marseille-P4678 T gen. nov. sp. nov. ), thus adding to the current human gut repertoire new spe- cies. Its taxono-genomics description rendered its main features available for the scientific community in case of its isolation in a commensal or pathogenic scene. Nevertheless, sequencing its genome made more nucleotides sequences defined and thus minimized the holes in the current database or what is so-called Dark Matter. 4. 1 | Miniphocibacter (Mini. phoci. bacter, L. adj. masc. , miniphocibacter composed by mini, referring at the small size of pygmy people from whom this strain was isolated, and phoci referring at Phocae, the Latin name of the city from where the funders of culturomics came from).
Sage, a software in an ecosystem The development of Sage was relatively quick thanks to its strategy of reusing existing free software, including many specialised mathematical libraries or systems like GAP, PARI/GP, Maxima, Singular, to cite just a few. Sage itself is written in Python, a programming language used by millions and known for the ease with which it can be learned. Python is particularly well established in the sciences. Within the same computing environment, it is possible to combine the capabilities of Sage with scientific libraries for numerical computations, data analysis, statistics, visualisation, machine learning, biology, astrophysics, and technical libraries for networking, databases, web,. See for example: https: //en. wikipedia. org/wiki/List_of_Python_software. At first, Sage was both an acronym and a reference to the "sage" medicinal plant.
Programming and Data Structures The two preceding chapters introduced mathematical computations using one-line commands, but Sage also allows programs with sequences of instructions. The Sage computer algebra system is in fact an extension of the Python 1  computer language, and allows, with a few exceptions, to use the Python programming constructs. The commands described in the previous chapters show that it is not necessary to know the Python language to use Sage; this chapter explains how to use the Python programming structures within Sage. Since we only present basic programming, this chapter can be skipped by the reader fluent in Python; the examples are chosen among the most classical ones encountered in mathematics, so that the reader can quickly grasp the Python programming constructs, by analogy with known programming languages.
General Syntax The instructions are generally processed line by line. Python considers the sharp symbol "#" as the beginning of a comment, until the end of the line. The semi-colon ";" separates several instructions written on the same line: In the terminal, a command can be written on several lines by putting a backslash "\" before each end of line, this character being ignored: sage: 123 + \. : 345 468 An identifier -i. e. , a variable or function name, etc. -is formed from letters, digits and the underline symbol "_", and cannot start with a digit. The user identifiers should differ from the language keywords, given in Table  3. 1, and which form the core of the Python language. The list of keywords is available by: sage: import keyword; keyword. kwlist [ and , as , assert , break , class , continue , def , del , elif , else , except , exec , finally , for , from , global , if , import , in , is , lambda , not , or , pass , print , raise , return , try , while , with , yield ] In addition to these keywords, we have the constants None (empty value, named NULL in other languages), True and False, and several functions predefined by Python or Sage like len, cos and integrate.
Those functions show how to efficiently implement the power operator "ˆ" upon multiplication, and are similar to the method implemented within Sage. For example, using powers of matrices enables us to compute much larger terms of the Fibonacci sequence: A = 0 1 1 1 , X n = u n u n+1 , AX n = X n+1 , A n X 0 = X n. The corresponding Sage program fits in two lines, and the wanted result is the first coordinate of the matrix product A n X 0 , which effectively works for n = 10 7 ; the fib3 and fib4 programs are equivalent, and their efficiency comes from the fact that Sage implements a fast exponentiation method: sage: def fib3 (n):.
gcd(q). It is though slightly less natural in Sage since it is not a general mechanism: gcd(p,q) calls a function of two arguments, defined manually in the source code of Sage, and which calls in turn p. gcd. Only some usual methods have such an associated function. The extended gcd, i. e. , the computation of a Bézout relation g = gcd(p, q) = ap + bq, g, p, q, a, b ∈ K[x] is given by p. xgcd(q): sage: R. <x> = QQ[]; p = x^5-1; q = x^3-1 sage: print("the gcd is %s = (%s)*p + (%s)*q" % p. xgcd(q)) the gcd is x -1 = (-x)*p + (x^3 + 1)*q The xgcd method also exists for polynomials in ZZ['x'], but beware: since Z[x] is not a principal ideal ring, the result is in general not a Bézout relation (ap + bq might be an integer multiple of the gcd)!.
Floating-point numbers should be used with care, but they did not prevent the development of computing and its applications: rounding errors do not limit the validity of numerical weather forecasts, to give only one obvious example. Interval arithmetic seems to appear first in the works of Ramon E. Moore in 1966  [Moo66]  (even if the idea appears before the computer era), but new software developments (such as MPFI and Arb used by Sage) as well as some spectacular applications draw attention to it: some famous old mathematical conjectures have proofs which rely at least partially on interval computations. For example, we may mention the Kepler conjecture in 1998 by Thomas C. Hales, or the ternary Goldbach problem by Harald A. Helfgott in 2013.
Representation of Numbers We recall how to denote commonly-used rings with Sage (see §5. 2). Integers are represented by objects of the class Integer; conversions are performed using the parent ZZ or the function IntegerRing(), which returns the object ZZ. Similarly, rational numbers are represented by objects of the class Rational; the parent of these objects is the object QQ, which is returned by the function RationalField(). In both cases Sage uses the arbitrary precision library GMP. Without diving into the inner workings of this library, the integers used by Sage have arbitrary size, limited only by the available memory of the machine on which the software is run. Several approximate representations of real numbers are available (see Chapter 11). There is RealField() -or Reals() -for floating-point numbers with a given precision and, in particular, RR for 53-bit precision.
sage: E = Set([ Remark: it would be natural in Python to use len(S) to ask for the cardinality of S. This is not possible because Python requires that the result of len be an integer of type int; this could cause overflows, and would not permit the return of Infinity for infinite sets. sage: len(S) Traceback (most recent call last):. OverflowError: Python int too large to convert to C long.
For a random ideal J, let us assume χ(λ) = 0 with λ ∈ C. Thus λ is an eigenvalue of m x. Let p ∈ Q[x, y] \ J a representative of an eigenvector associated to λ: we have xp = λp + q for a given q ∈ J. Since p / ∈ J, we can find (x 0 , y 0 ) ∈ V (J) such that p(x 0 , y 0 ) = 0, and we have then (x 0 -λ) p(x 0 , y 0 ) = q(x 0 , y 0 ) = 0, thus λ = x 0. Exercise 38 page 211. The expressions sin θ, cos θ, sin(2θ) and cos(2θ) are related by the classical trigonometric formulas sin 2 θ + cos 2 θ = 1, sin(2θ) = 2(sin θ)(cos θ), cos(2θ) = cos 2 θ -sin 2 θ. SageMath, or Sage for short, is an open-source mathematical software system based on the Python language. Sage is developed by an international community of hundreds of teachers and researchers, whose aim is to provide an alternative to the commercial products Magma, Maple, Mathematica and Matlab.