Skip to content

Instantly share code, notes, and snippets.

@kozo2
Created September 9, 2020 07:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kozo2/c5b0c28696146302d93b0562f999bf24 to your computer and use it in GitHub Desktop.
Save kozo2/c5b0c28696146302d93b0562f999bf24 to your computer and use it in GitHub Desktop.

Introduction to Bioconductor Annotation Resources

Bioc 2020: 29-31 July

Instructors

Workshop Description

There are various annotation packages provided by the Bioconductor project that can be used to incorporate additional information to results from high-throughput experiments. This can be as simple as mapping Ensembl IDs to corresponding HUGO gene symbols, to much more complex queries involving multiple data sources. In this workshop we will cover the various classes of annotation packages, what they contain, and how to use them efficiently.

ハイスループット実験の結果に追加情報を組み込むために使用できる、 Bioconductorプロジェクトによって提供されるさまざまな アノテーションパッケージがあります。 これは、複数のデータソース含まれる非常に複雑なクエリを、 Ensembl IDを対応するHUGO遺伝子シンボルにマッピングするのと同じくらい簡単にします。 このワークショップでは、アノテーションパッケージのさまざまなクラス、 それらに含まれるもの、およびそれらを効率的に使用する方法について説明します。

Prerequisites

  • Basic knowledge of R syntax
  • Basic understanding of the various annotation sources (NCBI, EBI/EMBL)

Useful background reading

Workshop Participation

After each type of annotation package is introduced, students will be given the opportunity to practice making their own queries.

R / Bioconductor packages used

  • AnnotationDbi
  • AnnotationHub
  • BSgenome
  • biomaRt
  • ensembldb
  • org.Hs.eg.db
  • TxDb.Hsapiens.UCSC.hg19.knownGene
  • EnsDb.Hsapiens.v79
  • EnsDb.Mmusculus.v79
  • Homo.sapiens
  • BSgenome.Hsapiens.UCSC.hg19
  • hugene20sttranscriptcluster.db

Workshop goals and objectives

Annotating data is a complex task. For any high-throughput experiment the analyst usually starts with a set of identifiers for each thing that was measured, and in order to make the results useful to collaborators these identifiers need to be mapped to other identifiers that are either more familiar to collaborators, or that can be used for further analyses. As an example, RNA-Seq data may only have Entrez Gene IDs for each gene measured, and as part of the output you may want to include the gene symbols, which are more likely to be familiar to a Biologist.

データをアノテートすることは複雑なタスクです。 ハイスループット実験の場合、アナリストは通常、測定された各対象物のIDのセットからスタートします。 結果をコラボレーターにとって有用なものにするために、 これらのIDは、コラボレーターにとってより馴染みのある他のIDにマップする必要があり、 またそれがさらなる分析に使われ得ます。例えば、RNA-Seqデータは、測定された各遺伝子の Entrez Gene IDしか持たない場合があり、出力の一部としてその遺伝子シンボルを 含めたい場合があるでしょう。それらは生物学者に(訳注:IDよりも) よく知られている可能性が高いです。

Learning goals

  • Understand what sort of annotation data are available : 利用可能なアノテーションデータの種類を理解する
  • Understand the difference between annotation sources (NCBI and EBI/EMBL) : アノテーションソースの違い(NCBI と EBI/EMBL)を理解する
  • Gain familiarity with the various ways to query annotation packages : アノテーションパッケージをクエリするためのさまざまな方法に慣れる
  • Get some practice making queries : クエリを作る練習をする

Learning objectives

  • Be able to use select and mapIds to map between identifiers : ID間をマップするためにselectとmapIdsを使うことができる
  • Be able to extract data from TxDb and EnsDb packages : TxDbとEnsDbパッケージからデータを抽出できる
  • Be able to make queries using biomaRt : biomaRtを使用してクエリを作成できる
  • Extract and utilize various data from AnnotationHub : AnnotationHubからさまざまなデータを抽出し、利用する

Annotation Workshop

library(Bioc2020Anno)
library(hugene20sttranscriptcluster.db)
library(EnsDb.Mmusculus.v79)
library(org.Hs.eg.db)
library(TxDb.Hsapiens.UCSC.hg19.knownGene)
library(Homo.sapiens)
library(BSgenome)
library(BSgenome.Hsapiens.UCSC.hg19)
library(AnnotationHub)
library(Organism.dplyr)

What do we mean by annotation? アノテーションとは何を意味するか?

Map a known ID to other functional or positional information

既知のIDを他の機能または位置情報にマップする

knitr::include_graphics("./mapping.png")

Specific goal 具体的な目標

We have data and statistics, and we want to add other useful information

我々は何らかのデータと統計量を持っており、他の有用な情報を追加したいとします。

knitr::include_graphics("./boxes.png")

The end result might be as simple as a data.frame or HTML table, or as complex as a RangedSummarizedExperiment

最終結果は、data.frameまたはHTMLテーブルのように単純な場合もあれば、 RangedSummarizedExperiment のように複雑な場合もあります。

Data containers

knitr::include_graphics("./eset.png")

ExpressionSet

load(file.path(system.file(package = "Bioc2020Anno", "extdata"), "eset.Rdata"))
eset

ExpressionSet (continued)

head(exprs(eset))
head(pData(phenoData(eset)))

ExpressionSet (continued)

head(pData(featureData(eset)))

BioC containers vs basic structures

Pros

  • Validity checking

  • Subsetting

  • Function dispatch

  • Automatic behaviors

Cons

  • Difficult to create : 作るのが難しい

  • Cumbersome to extract data by hand : 手作業でデータを抽出するのは面倒

  • Useful only within R : R内でのみ有用

Annotation sources

df <- data.frame("Package type" = c("ChipDb","OrgDb","TxDb/EnsDb","OrganismDb","BSgenome","Others","AnnotationHub","biomaRt"),
		 Example = c("hugene20sttranscriptcluster.db","org.Hs.eg.db","TxDb.Hsapiens.UCSC.hg19.knownGene; EnsDb.Hsapiens.v75",
			     "Homo.sapiens","BSgenome.Hsapiens.UCSC.hg19","GO.db; KEGG.db", "Online resource","Online resource"), check.names = FALSE)
knitr::kable(df)

Interacting with AnnoDb packages

The main function is select:

主な機能は select です:

select(annopkg, keys, columns, keytype)

Where ここで

  • annopkg is the annotation package : annopkg はアノテーションパッケージです

  • keys are the IDs that we know : keys は私たちが知っているIDです

  • columns are the values we want : columns は我々が欲しい値です

  • keytype is the type of key used : keytype は使用される key のタイプです

    • if the keytype is the central key, it can remain unspecified : keytypeがセントラルキーの場合、未指定のままにすることができます

Simple example 簡単な例

Say we have analyzed data from an Affymetrix Human Gene ST 2.0 array and want to know what the genes are. For purposes of this lab, we just select some IDs at random.

Affymetrix Human Gene ST 2.0アレイ由来のデータを分析し、遺伝子が何かを知りたいとします。 この実習では、ランダムにいくつかのIDだけをセレクトしています。

library(hugene20sttranscriptcluster.db)
set.seed(12345)
ids <- featureNames(eset)[sample(1:25000, 5)]
ids
select(hugene20sttranscriptcluster.db, ids, "SYMBOL")

Questions!

How do you know what the central keys are? : どうしてセントラルキーが何であるかを知っているのですか?

  • If it's a ChipDb, the central key are the manufacturer's probe IDs : それがChipDbの場合、セントラルキーは製造元のプローブIDです

  • It's sometimes in the name - org.Hs.eg.db, where 'eg' means Entrez Gene ID : org.Hs.eg.db という名前の場合もあります。ここで 'eg' は Entrez Gene ID を意味します。

  • You can see examples using e.g., head(keys(annopkg)), and infer from that : たとえば、head(keys(annopkg)) を使用して例を確認し、それから推測することができます

  • But note that it's never necessary to know the central key, as long as you specify the keytype : ただし、keytypeを指定したら、 セントラルキーを知る必要はないことに注意してください。

More questions!

What keytypes or columns are available for a given annotation package?

あるアノテーションパッケージで使用できるkeytypeまたはcolumnは何かわかりますか?

keytypes(hugene20sttranscriptcluster.db)
columns(hugene20sttranscriptcluster.db)

Another example

There is one issue with select however.

ただし、select には1つ問題があります。

ids <- c('16737401','16657436' ,'16678303')
select(hugene20sttranscriptcluster.db, ids, c("SYMBOL","MAP"))

The mapIds function

An alternative to select is mapIds, which gives control of duplicates

select に代わる手段は mapIds です。mapIdsは重複をコントロールします。

  • Same arguments as select with slight differences : selectと同じ引数で、若干の違いがあります

    • The columns argument can only specify one column : columns引数は1つのcolumnのみを指定できます

    • The keytype argument must be specified : keytype引数を指定する必要があります

    • An additional argument, multiVals used to control duplicates : 追加の引数、multiValsは重複のコントロールに使用されます

mapIds(hugene20sttranscriptcluster.db, ids, "SYMBOL", "PROBEID")

Choices for multiVals (multiValsの選択肢)

Default is first, where we just choose the first of the duplicates. Other choices are list, CharacterList, filter, asNA or a user-specified function.

デフォルトはfirstです。これは最初の重複だけを選択します。 その他の選択肢は、list, CharacterList, filter, asNAまたはユーザー指定の関数です。

mapIds(hugene20sttranscriptcluster.db, ids, "SYMBOL", "PROBEID", multiVals = "list")

Choices for multiVals (continued)

mapIds(hugene20sttranscriptcluster.db, ids, "SYMBOL", "PROBEID", multiVals = "CharacterList")
mapIds(hugene20sttranscriptcluster.db, ids, "SYMBOL", "PROBEID", multiVals = "filter")
mapIds(hugene20sttranscriptcluster.db, ids, "SYMBOL", "PROBEID", multiVals = "asNA")

ChipDb/OrgDb questions

Using either the hugene20sttranscriptcluster.db or org.Hs.eg.db package,

  • What gene symbol corresponds to Entrez Gene ID 1000? : Entrez Gene ID 1000に対応する遺伝子シンボルは何でしょうか?

  • What is the Ensembl Gene ID for PPARG? : PPARGのEnsembl Gene IDは何でしょうか?

  • What is the UniProt ID for GAPDH? : GAPDHのUniProt IDは何でしょうか?

  • How many of the probesets from the ExpressionSet (eset) we loaded map to a single gene? How many don't map to a gene at all? : ロードしたExpressionSet (eset) のプローブセットのうち、いくつが単一の遺伝子にマップされるでしょうか? いくつが遺伝子にまったくマップされないでしょうか?

TxDb packages

TxDb packages contain positional information; the contents can be inferred by the package name

TxDbパッケージには位置情報が含まれています; その内容は パッケージ名から推測できます

TxDb.Species.Source.Build.Table

  • TxDb.Hsapiens.UCSC.hg19.knownGene

    • Homo sapiens

    • UCSC genome browser

    • hg19 (their version of GRCh37)

    • knownGene table

TxDb.Dmelanogaster.UCSC.dm3.ensGene TxDb.Athaliana.BioMart.plantsmart22

EnsDb packages

EnsDb packages are similar to TxDb packages, but based on Ensembl mappings

EnsDb パッケージは TxDb パッケージに似ていますが、Ensemblのマッピング 情報に基づいています

  • EnsDb.Rnorvegicus.v79
  • EnsDb.Hsapiens.v79
  • EnsDb.Mmusculus.v79
  • EnsDb.Rnorvegicus.v79

Transcript packages

As with ChipDb and OrgDb packages, select and mapIds can be used to make queries

ChipDbおよびOrgDbパッケージと同様に、クエリするのに selectmapIds が使えます。

select(TxDb.Hsapiens.UCSC.hg19.knownGene, c("1","10"),
       c("TXNAME","TXCHROM","TXSTART","TXEND"), "GENEID")
select(EnsDb.Hsapiens.v79, c("1", "10"),
       c("GENEID","GENENAME","SEQNAME","GENESEQSTART","GENESEQEND"), "ENTREZID")

But this is not how one normally uses them...

しかし、これは通常の使用方法ではありません...

GRanges

The normal use case for transcript packages is to extract positional information into a GRanges or GRangesList object. An example is the genomic position of all genes:

transcriptパッケージの通常の使用例は、位置情報を GRanges もしくは GRangesList オブジェクトに抽出することです。 一例は、すべての遺伝子のゲノムでの位置です:

gns <- genes(TxDb.Hsapiens.UCSC.hg19.knownGene)
gns

GRangesList

Or the genomic position of all transcripts by gene:

または、遺伝子ごとのすべての転写産物のゲノム位置:

txs <- transcriptsBy(TxDb.Hsapiens.UCSC.hg19.knownGene)
txs

Other accessors

  • Positional information can be extracted for transcripts, genes, coding sequences (cds), promoters and exons. : 位置情報は、 transcriptsgenes、コーディング配列 (cds)、promoters、そして exons に対して抽出できます。

  • Positional information can be extracted for most of the above, grouped by a second element. For example, our transcriptsBy call was all transcripts, grouped by gene. : 位置情報は上記のほとんどに対して、 2番目の要素でグループ化して抽出できます。 たとえば、さっき我々が使った transcriptsBy は gene でグループ化された すべての transcripts でした。

  • More detail on these *Ranges objects is beyond the scope of this workshop, but why we want them is not. : これらの *Ranges オブジェクトの 詳細はこのワークショップの範囲を超えていますが、 なぜそれらが必要なのかは範囲外ではありません。

Why *Ranges objects

The main rationale for *Ranges objects is to allow us to easily select and subset data based on genomic position information. This is really powerful!

*Ranges オブジェクトの存在の根本的理由はゲノムの位置情報に基づいて データを簡単に選択およびサブセット化できるようにすることです。 これは本当に強力です!

GRanges and GRangesLists act like data.frames and lists, and can be subsetted using the [ function. As a really artificial example:

GRangesGRangesLists は data.frames や lists のように機能し、 [ 関数を使用してサブセット化できます。本当に人為的な例として:

txs[txs %over% gns[1:2,]]

*Ranges use cases

  • Gene expression changes near differentially methylated CpG islands : differentially methylated CpGアイランドに近い領域の遺伝子発現の変化

  • Closest genes to a set of interesting SNPs : 一連の興味のあるSNPsに最も近い遺伝子群

  • Genes near DNAseI hypersensitivity clusters : DNA分解酵素に過敏なクラスター付近の遺伝子

  • Number of CpGs measured over Gene X by Chip Y : Chip Yによって遺伝子 Xで測定されたCpGsの数

SummarizedExperiment objects

SummarizedExperiment objects are like ExpressionSets, but the row-wise annotations are GRanges, so you can subset by genomic locations:

SummarizedExperiment オブジェクトは ExpressionSets のようなものですが 、行ごとのアノテーションは GRanges なので、ゲノムの位置でサブセット化できます。

knitr::include_graphics("./subset.png")

SummarizedExperiment objects are popular objects for representing expression data and other rectangular data (feature x sample data). Incoming packages are now strongly recommended to use this class representation instead of ExpressionSet.

SummarizedExperiment オブジェクトは、発現データやその他の長方形データ (機能 x サンプルデータ) を表すための一般的なオブジェクトです。 これからのパッケージには ExpressionSet の代わりにこのクラス表現を使うことを強くお勧めします。

TxDb exercises

  • How many transcripts does PPARG have, according to UCSC? : UCSCによると、PPARGにはいくつのtranscriptsがありますか?

  • Does Ensembl agree? : Ensembl (訳注: による前述のtranscriptsの数) は一致しますか?

  • How many genes are between 2858473 and 3271812 on chr2 in the hg19 genome? : hg19ゲノムのchr2の2858473と3271812の間にある遺伝子の数はいくつですか?

    • Hint: you make a GRanges like this - GRanges("chr2", IRanges(2858473,3271812))

OrganismDb packages

OrganismDb packages are meta-packages that contain an OrgDb, a TxDb, and a GO.db package and allow cross-queries between those packages.

OrganismDbパッケージは、OrgDb、TxDb、およびGO.dbパッケージを含み、 それらのパッケージ間のクロスクエリを可能にするメタパッケージです。

All previous accessors work; select, mapIds, transcripts, etc.

前述のすべてのアクセサーが機能します。selectmapIdstranscriptsなど。

library(Homo.sapiens)
Homo.sapiens

OrganismDb packages

  • Updateable - can change TxDb object : 更新可能 - TxDbオブジェクトを変更できます

  • columns and keytypes span all underlying objects : columns と keytypes はすべての内在するオブジェクトにまたがります

  • Calls to TxDb accessors include a 'columns' argument : TxDbのアクセサーへの呼び出しには'columns'引数が含まれます

head(genes(Homo.sapiens, columns = c("ENTREZID","ALIAS","UNIPROT")),4)

OrganismDb exercises

  • Get all the GO terms for BRCA1 : BRCA1のすべてのGO termを取得しましょう

  • What gene does the UCSC transcript ID uc002fai.3 map to? : UCSC transcript ID uc002fai.3 はどの遺伝子にマップされますか?

  • How many other transcripts does that gene have? : その遺伝子には他にいくつの転写産物がありますか?

  • Get all the transcripts from the hg19 genome build, along with their Ensembl gene ID, UCSC transcript ID and gene symbol : hg19 ゲノムビルドからすべての転写産物を、 Ensemblの遺伝子ID、UCSCの転写産物ID、および遺伝子シンボルとともに取得しましょう

Organism.dplyr package

  • Combines the data from TxDb and Org.Db associated packages into local database. : TxDb と Org.Db 関連のパッケージの データをローカルのデータベースに統合します。

  • Allows functions from both org.* and TxDb.* : org.*TxDb.* の両方の機能を許可します

    • keytypes(), select(), ...
    • exons(), promoters(), ...
  • Allows for filtering and display of combined TxDb and Org.Db information through dplyr functions. : dplyr の関数を介して、TxDbとOrg.Dbが統合された情報のフィルタリングと表示を可能にします。

library(Organism.dplyr)
# src = src_organism("TxDb.Hsapiens.UCSC.hg19.knownGene")
src <- src_organism(dbpath = hg38light())
src

Organism.dplyr

Get promoters from a TxDb object (we use a small version)

TxDb オブジェクトからプロモーターを取得しましょう (小さいバージョンのものを使用します(訳注: ここは意図掴めず))

options(width = 120)
promoters(src)

Organism.dplyr

Extract a table from the underlying database

基になるデータベースからテーブルを抽出する

tbl(src, "id")

Organism.dplyr

Make a complex query between tables in the underlying database

基になるデータベースのテーブル間で複雑なクエリを作成する

inner_join(tbl(src, "id"), tbl(src, "ranges_gene")) %>%
		    filter(symbol %in% c("ADA", "NAT2")) %>%
		    dplyr::select(gene_chrom, gene_start, gene_end,
		    gene_strand, symbol, alias, map)

Organism.dplyr exercises

  • How many supported organisms are implemented in Organism.dplyr? : Organism.dplyrでの動作がサポートされている生物種はいくつありますか?

  • Display the ensembl Id and genename description for symbol "NAT2". : シンボル "NAT2" のensembl Idと遺伝子名の説明を表示してみましょう

  • Show all the alias for "NAT2" in the database. : データベース内の "NAT2" のすべてのエイリアスを表示してみましょう

  • Display Gene ontology (GO) information for gene symbol "Nat2". : 遺伝子シンボル"Nat2" の Gene ontology (GO) の情報を表示してみましょう

BSgenome packages

BSgenome packages contain sequence information for a given species/build. There are many such packages - you can get a listing using available.genomes

BSgenomeパッケージには、特定の種/ビルドのシーケンス情報が含まれています。 そのようなパッケージはたくさんあります - available.genomes を使用して そのリストを取得できます。

library(BSgenome)
head(available.genomes())

BSgenome packages

We can load and inspect a BSgenome package

BSgenomeパッケージを読み込んで調査できます

library(BSgenome.Hsapiens.UCSC.hg19)
Hsapiens

BSgenome packages

The main accessor is getSeq, and you can get data by sequence (e.g., entire chromosome or unplaced scaffold), or by passing in a GRanges object, to get just a region.

メインのアクセサーはgetSeqであり、 シーケンス (たとえば、染色体全体またはそこに配置されていないスキャフォールド) ごとに、またはGRangesオブジェクトを渡すことによって、データを取得することで ある領域のみを取得できます。

getSeq(Hsapiens, "chr1")
getSeq(Hsapiens, gns["5467",])

The Biostrings package contains most of the code for dealing with these *StringSet objects - please see the Biostrings vignettes and help pages for more information.

Biostringsパッケージには、これらの *StringSet オブジェクトを処理するための ほとんどのコードが含まれています。 詳細については、Biostringsのビネットとヘルプページを参照してください。

BSgenome exercises

  • Get the sequences for all transcripts of the TP53 gene : TP53遺伝子のすべての転写産物の配列を取得してみましょう

AnnotationHub

AnnotationHub is a package that allows us to query and download many different annotation objects, without having to explicitly install them.

AnnotationHubは、明示的にインストールしなくても、 さまざまなアノテーションオブジェクトをクエリしてダウンロードできるように してくれるパッケージです。

library(AnnotationHub)
hub <- AnnotationHub()
library(AnnotationHub)
hub <- AnnotationHub()
hub

Querying AnnotationHub

Finding the 'right' resource on AnnotationHub is like using Google - a well posed query is necessary to find what you are after. Useful queries are based on

AnnotationHubで '適切な' リソースを見つけることは、Googleを使うようなものです。 目的物を見つけるには、適切なクエリが必要です。有用なクエリは

  • Data provider

  • Data class

  • Species

  • Data source

names(mcols(hub))

AnnotationHub Data providers

unique(hub$dataprovider)

AnnotationHub Data classes

unique(hub$rdataclass)

AnnotationHub Species

head(unique(hub$species))
length(unique(hub$species))

AnnotationHub Data sources

unique(hub$sourcetype)

AnnotationHub query

qry <- query(hub, c("granges","homo sapiens","ensembl"))
qry

AnnotationHub query

qry$sourceurl

Selecting AnnotationHub resource

whatIwant <- qry[["AH80077"]]
## fix for now
whatIwant <- keepStandardChromosomes(whatIwant, pruning.mode = "coarse")

We can use these data as they are, or convert to a TxDb format:

これらのデータをそのまま使用することも、TxDbフォーマットに変換することもできます:

GRCh38TxDb <- makeTxDbFromGRanges(whatIwant)
GRCh38TxDb

AnnotationHub exercises

  • How many resources are on AnnotationHub for Atlantic salmon (Salmo salar)? : AnnotationHubに 大西洋鮭 (Salmo salar) のリソースはいくつありますか?

  • Get the most recent Ensembl build for domesticated dog (Canis familiaris) and make a TxDb : 犬 (Canis familiaris) の最新のEnsemblビルドを取得し、TxDbを作ってみましょう

biomaRt

The biomaRt package allows queries to an Ensembl Biomart server. We can see the choices of servers that we can use:

biomaRtパッケージは、Ensembl Biomartサーバーへのクエリを可能にします。 下記で使用できるサーバーの選択肢を確認できます:

library(biomaRt)
listMarts(host = "useast.ensembl.org")
               biomart                version
1 ENSEMBL_MART_ENSEMBL      Ensembl Genes 100
2   ENSEMBL_MART_MOUSE      Mouse strains 100
3     ENSEMBL_MART_SNP  Ensembl Variation 100
4 ENSEMBL_MART_FUNCGEN Ensembl Regulation 100

biomaRt data sets

And we can then check for the available data sets on a particular server.

そして、特定のサーバーで利用可能なデータセットを確認できます。

mart <- useEnsembl("ensembl")
head(listDatasets(mart))
                     dataset                                  description
1   acalliptera_gene_ensembl             Eastern happy genes (fAstCal1.2)
2 acarolinensis_gene_ensembl               Anole lizard genes (AnoCar2.0)
3  acchrysaetos_gene_ensembl              Golden eagle genes (bAquChr1.2)
4  acitrinellus_gene_ensembl               Midas cichlid genes (Midas_v5)
5  amelanoleuca_gene_ensembl                        Panda genes (ailMel1)
6    amexicanus_gene_ensembl Mexican tetra genes (Astyanax_mexicanus-2.0)
                 version
1             fAstCal1.2
2              AnoCar2.0
3             bAquChr1.2
4               Midas_v5
5                ailMel1
6 Astyanax_mexicanus-2.0
> 

biomaRt queries

After setting up a mart object pointing to the server and data set that we care about, we can make queries. We first set up the mart object.

対象のサーバーとデータセットを指す mart オブジェクトを設定したら、 クエリを実行できます。最初に mart オブジェクトを設定します。

mart <- useEnsembl("ensembl","hsapiens_gene_ensembl"                   )

Queries are of the form

getBM(attributes, filters, values, mart)

where

  • attributes are the things we want : attributesは私たちがほしい情報です

  • filters are the types of IDs we have : filtersは私たちが持っているIDのタイプです

  • values are the IDs we have : valuesは私たちが持っているID群です

  • mart is the mart object we set up : martは設定した mart オブジェクトです

biomaRt attributes and filters

Both attributes and filters have rather inscrutable names, but a listing can be accessed using

attributes と filters はどちらもかなりわかりにくい名前を持っていますが、 リストには以下を使用してアクセスできます

atrib <- listAttributes(mart)
filts <- listFilters(mart)
head(atrib)
                           name                  description         page
1               ensembl_gene_id               Gene stable ID feature_page
2       ensembl_gene_id_version       Gene stable ID version feature_page
3         ensembl_transcript_id         Transcript stable ID feature_page
4 ensembl_transcript_id_version Transcript stable ID version feature_page
5            ensembl_peptide_id            Protein stable ID feature_page
6    ensembl_peptide_id_version    Protein stable ID version feature_page
head(filts)
                name                            description
1    chromosome_name               Chromosome/scaffold name
2              start                                  Start
3                end                                    End
4             strand                                 Strand
5 chromosomal_region e.g. 1:100:10000:-1, 1:100000:200000:1
6          with_ccds                        With CCDS ID(s)

biomaRt query

A simple example query

簡単なクエリ例

afyids <- c("1000_at","1001_at","1002_f_at","1007_s_at")
getBM(c("affy_hg_u95av2", "hgnc_symbol"), c("affy_hg_u95av2"), afyids, mart)
  affy_hg_u95av2 hgnc_symbol
1        1000_at       MAPK3
2      1007_s_at        DDR1
3        1001_at        TIE1
4      1002_f_at            
5      1002_f_at     CYP2C19

biomaRt exercises

  • Get the Ensembl gene IDs and HUGO symbol for Entrez Gene IDs 672, 5468 and 7157 : Entrez遺伝子ID 672、5468、7157のEnsembl遺伝子IDとHUGOシンボルを取得してみましょう

  • What do you get if you query for the 'gene_exon' for GAPDH? : GAPDHに対して 'gene_exon' をクエリすると何が得られるでしょうか?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment