King's College London - COST SYSGENET - Introduction to R 2013




biomaRt

QUESTION 1:

database <- useMart("ensembl",dataset="mmusculus_gene_ensembl")
getBM(attributes = c("mgi_symbol"),  
      filters = c("mgi_symbol","go_id"), 
      values = list(c("Tpd52l1", "Birc5", "Rab6a", "Tmem204", "Wnt10b"),"GO:0000086"), 
      mart = database)

QUESTION 2:

getSequence(id="Birc5",
            type="mgi_symbol",
            seqType="3utr",
            mart=database)

QUESTION 3:

getBM(attributes=c("ensembl_gene_id","mgi_symbol","chromosome_name","exon_chrom_start","exon_chrom_end"), 
      filters=c("mgi_symbol"),
      values=c("Tpd52l1", "Birc5", "Wnt10b"),
      mart=database)
Error in getBM(attributes = c("ensembl_gene_id", "mgi_symbol", "chromosome_name",  : 
  Query ERROR: caught BioMart::Exception::Usage: Attributes from multiple attribute pages are not allowed
one <- getBM(attributes=c("ensembl_gene_id","mgi_symbol"), 
      filters=c("mgi_symbol"),
      values=c("Tpd52l1", "Birc5", "Wnt10b"),
      mart=database)
two <- getBM(attributes=c("ensembl_gene_id","chromosome_name","exon_chrom_start","exon_chrom_end"), 
      filters=c("mgi_symbol"),values=c("Tpd52l1", "Birc5", "Wnt10b"),
      mart=database)
merge(one,two, by="ensembl_gene_id")

QUESTION 4:

database2 <- useMart("ensembl")
database2 <- useDataset("rnorvegicus_gene_ensembl",mart=database)
getBM(attributes=c("ensembl_gene_id"),
      filters=c("chromosomal_region"), 
      values = c("5:300000:600000"), 
      mart=database2)