Skip to content

Commit f4b4ffd

Browse files
committed
R script update to get data from Ensembl
1 parent bd4c865 commit f4b4ffd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

databases/gene_info/get_datasets.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ try(civicUrl <- Sys.getenv(CIVIC_URL), silent = TRUE)
2626
# GRCh38 ####
2727
ensembl_grch38 = useEnsembl(biomart = "genes", dataset = "hsapiens_gene_ensembl")
2828
atr <- c("ensembl_gene_id", "description", "chromosome_name", "start_position", "end_position", "strand", "band", "percentage_gene_gc_content", "gene_biotype", "hgnc_symbol", "hgnc_id", "entrezgene_id")
29-
fil <- c("with_hgnc")
29+
fil_chrom <- c("MT", "X", "Y", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22")
30+
3031
res_grch38 <- getBM(
3132
attributes = atr,
32-
filters = fil,
33-
values = TRUE,
33+
filters = c("chromosome_name", "with_hgnc"),
34+
values = list(fil_chrom, TRUE),
3435
mart = ensembl_grch38
3536
)
3637
res_grch38$description <- data.frame(do.call('rbind', str_split(res_grch38$description, " \\[Source")))$X1
@@ -41,11 +42,10 @@ ensembl_grch37 = useEnsembl(biomart="genes", dataset = "hsapiens_gene_ensembl",
4142
# listFilters(ensembl_grch37)
4243
# listAttributes(ensembl_grch37)
4344
atr <- c("ensembl_gene_id", "description", "chromosome_name", "start_position", "end_position", "strand", "band", "percentage_gene_gc_content", "gene_biotype", "hgnc_symbol", "hgnc_id", "entrezgene_id")
44-
fil <- c("with_hgnc")
4545
res_grch37 <- getBM(
4646
attributes = atr,
47-
filters = fil,
48-
values = TRUE,
47+
filters = c("chromosome_name", "with_hgnc"),
48+
values = list(fil_chrom, TRUE),
4949
mart = ensembl_grch37
5050
)
5151

0 commit comments

Comments
 (0)