Differences between revisions 3 and 4
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
Line 27: | Line 26: |
# for a given list of entrez gene ids, get the flybase ids eids <- c("35851", "42737", "34411", "35851", "33196", "35851", "43767", "34085", "41565", "41965", "36382", "32772", "41565", "34411", "37618", "43767", "35851", "41565", "40701", "40701", "37618", "33196", "42737", "42737", "42737") |
|
Line 28: | Line 29: |
# filter entrezgene # attributes entrezgene, flybase_gene_id eid2fb <- getBM(attributes=c("flybase_gene_id"), filters=c("entrezgene"), values=eids, mart=bm) |
Example of how to get all mouse gene coordinates using biomaRt:
library(biomaRt) mouse <- useMart("ensembl", dataset="mmusculus_gene_ensembl") # check out what's available ma <- listAttributes(mouse) loci <- getBM(attribute=c("ensembl_gene_id", "chromosome_name", "start_position", "end_position", "strand"), mart=mouse)
library(biomaRt) # what marts are available? listMarts() bm <- useMart("ensembl") # what data sets are available? listDatasets(bm) bm <- useDataset("dmelanogaster_gene_ensembl", mart=bm) # for a given list of entrez gene ids, get the flybase ids eids <- c("35851", "42737", "34411", "35851", "33196", "35851", "43767", "34085", "41565", "41965", "36382", "32772", "41565", "34411", "37618", "43767", "35851", "41565", "40701", "40701", "37618", "33196", "42737", "42737", "42737") # filter entrezgene # attributes entrezgene, flybase_gene_id eid2fb <- getBM(attributes=c("flybase_gene_id"), filters=c("entrezgene"), values=eids, mart=bm)