-
Notifications
You must be signed in to change notification settings - Fork 0
/
rmarkdown-xelatex-stix2.Rmd
45 lines (37 loc) · 1.37 KB
/
rmarkdown-xelatex-stix2.Rmd
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
---
title: "Using STIX Two in R Markdown"
author: "Author Name"
fontsize: "11pt"
output:
pdf_document:
latex_engine: "xelatex"
highlight: "arrow"
header-includes:
- \usepackage[notextcomp,nomath]{stix2}
---
# Sample text
For example, suppose we treat each gene as a _term_ and say each sample is a
_document_. In that case, we can use word embedding methods in NLP like
`word2vec` or `GloVe` to learn low-dimensional vector representations for genes,
given the gene expression count data for a collection of samples.
$$
\mathrm{E}\left[\left(T\left(F_{n}\right)-T(F)\right)^{r}\right]=
\mathrm{E}\left[\left(\sum_{j=1}^{k} T_{j, n} / j !\right)^{r}\right]+o\left(n^{-(r+k-1) / 2}\right)
$$
Traditional methods might assume two genes are similar if they have highly
correlated expression profiles or overlaps in labels. We assume that two
genes are similar if their **expression context** is similar,
i.e., the groups of genes that frequently express together with them are similar.
# Sample code block
```{r, eval=FALSE}
#' Classify any file into text or binary
is_text_file <- function(path, n = file.info(path)$size) {
bytecode <- readBin(path, what = "raw", n = n)
if (length(bytecode) == 0L) return(FALSE)
allow <- as.raw(c(9, 10, 13, 32:255))
block <- as.raw(c(0:6, 14:31))
cond1 <- any(bytecode %in% allow)
cond2 <- !any(bytecode %in% block)
cond1 && cond2
}
```