% \ VignetteIndexEntry{07。注释和范围练习}%\VignetteEngine{knitr::knitr} \documentclass{article} < >= options(max.print=1000) BiocStyle::latex() library(knitr) opts_chunk$set(cache=TRUE, tidy=FALSE) @ < >= suppressPackageStartupMessages({library(ShortRead) library(VariantAnnotation) library(parallel);options(mc.cores=detectCores())库(ggplot2)库(rnaseqdata . hnrnpc .bam. ch14)库(org.Hs.eg.db)库(TxDb.Hsapiens.UCSC.hg19.knownGene)库(BSgenome.Hsapiens.UCSC.hg19)库(AnnotationHub)库(rtracklayer)}) @ \title{实用:注释}\作者{Martin Morgan (mtmorgan@fhcrc.org)} \日期{2014年2月27-28日}\newcommand{\Hsap}{\emph{H. cn}~智人}}\ newcommand {\ Dmel} {\ emph {D。~melanogaster}} \usepackage{Exercise} \begin{document} \maketitle \tableofcontents \section{基因注释}\分段{数据包}有机体级(' org')包包含一个中心标识符(例如,Entrez基因id)和其他标识符(例如,GenBank或Uniprot登录号,RefSeq id等)之间的映射。org包的名称始终是\texttt{org的形式。 .db}(例如\Biocannopkg{org.Sc.sgd.db}) where \texttt{ }是生物体的两个字母缩写(例如\texttt{Sc}代表\emph{Saccharomyces cerevisiae})和\texttt{ }是描述中心标识符类型的缩写(小写)(例如\texttt{sgd}表示\emph{Saccharomyces}基因组数据库分配的基因标识符,\texttt{eg}表示Entrez基因标识符)。\Biocpkg{AnnotationDbi}包(org包只是一种“。db”注释包)中的“如何使用“。db”注释包”是一个关键参考。' .db'和大多数其他\Bioconductor{}注释包每6个月更新一次。注释包通常包含一个以包本身命名的对象。这些对象统称为\Rclass{AnnotationDb}对象,更具体的类命名为\Rclass{OrgDb}、\Rclass{ChipDb}或\Rclass{TranscriptDb}对象。可以应用于这些对象的方法包括\Rfunction{cols}、\Rfunction{keys}、\Rfunction{keytypes}和\Rfunction{select}。表~\ref{tab:select-ops}中总结了检索注释的常用操作。\begin{table} \居中\标题{检索和操作注释的常用操作。}{选项卡:select-ops} \ \标签开始{表格}{微光}类别和功能和描述\ \ \线\ noalign {\ smallskip}发现& \ Rfunction{列}&列表的列可以返回\ \ & \ Rfunction {keytypes} &列列表可以用作键\ \ & \ Rfunction{键}&列表值,可以预期给定keytype \ \ & \ Rfunction{选择}&匹配检索注释\ Rcode}{键,\ Rcode {keytype}和\ Rcode{列}\ \操作& \ Rfunction {setdiff}, \ Rfunction{联盟},\Rfunction{intersect} &对集合\\ & \Rfunction{duplicate}, \Rfunction{unique} &标记或删除重复的\\ & \Rfunction{\%in\%}, \Rfunction{match} &查找匹配\\ & \Rfunction{any}, \Rfunction{all} &是否有任何\Rcode{TRUE}? Are all? \\ & \Rfunction{merge} & Combine two different \Robject{data.frames} based on shared keys \\ \Rclass{GRanges*} & \Rfunction{transcripts}, \Rfunction{exons}, \Rfunction{cds} & Features (transcripts, exons, coding sequence) as \Rclass{GRanges}. \\ & \Rfunction{transcriptsBy} , \Rfunction{exonsBy} & Features group by gene, transcript, etc., as \Rclass{GRangesList}.\\ & \Rfunction{cdsBy}\\ \hline \end{tabular} \end{table} \begin{Exercise} This exercise illustrates basic use of the `select' interface to annotation packages. \begin{enumerate} \item What is the name of the org package for \emph{Homo sapiens}? Load it. Display the \Rclass{OrgDb} object for the \Biocpkg{org.Hs.eg.db} package. Use the \Rfunction{columns} method to discover which sorts of annotations can be extracted from it. \item Use the \Rfunction{keys} method to extract ENSEMBL identifiers and then pass those keys in to the \Rfunction{select} method in such a way that you extract the SYMBOL (gene symbol) and GENENAME information for each. Use the following ENSEMBL ids. \end{enumerate} < >= ensid <- c("ENSG00000130720", "ENSG00000103257", "ENSG00000156414", "ENSG00000144644", "ENSG00000159307", "ENSG00000144485") @ \end{练习}\begin{解决方案}\Rclass{OrgDb}对象命名为\Rcode{org.Hs.eg.db}。<