-
Notifications
You must be signed in to change notification settings - Fork 0
/
_annotation-file-generator.R
34 lines (27 loc) · 838 Bytes
/
_annotation-file-generator.R
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
# ####################################
# Create an up-to-date annotation file
# ####################################
# Install required packages
if (!require('BiocManager', quietly = TRUE))
install.packages('BiocManager')
BiocManager::install('biomaRt', update = TRUE, ask = FALSE, checkBuilt = TRUE)
require(biomaRt)
# Get annotation table
ensembl <- useEnsembl(biomart = 'genes', dataset = 'hsapiens_gene_ensembl')
annotLookup <- getBM(
mart = ensembl,
attributes = c(
'agilent_sureprint_g3_ge_8x60k_v2',
'ensembl_gene_id',
'external_gene_name'
)
)
# Export annotation table as tsv file
today <- format(Sys.Date(), format='%Y-%m')
write.table(
annotLookup,
paste0('Human_agilent_sureprint_g3_ge_8x60k_v2_', gsub('-', '_', as.character(today)), '.tsv'),
sep = '\t',
row.names = FALSE,
quote = FALSE
)