/usr/lib/R/site-library/annotate/doc/useHomology.Rnw is in r-bioc-annotate 1.56.1+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 | % \VignetteIndexEntry{Using the homology package}
% \VignetteDepends{hom.Hs.inp.db}
% \VignetteKeywords{Annotation}
%\VignettePackage{annotate}
\documentclass{article}
\newcommand{\Rfunction}[1]{{\texttt{#1}}}
\newcommand{\Rmethod}[1]{{\texttt{#1}}}
\newcommand{\Robject}[1]{{\texttt{#1}}}
\newcommand{\Rpackage}[1]{{\textit{#1}}}
\newcommand{\Rclass}[1]{{\textit{#1}}}
\usepackage{hyperref}
\usepackage[authoryear,round]{natbib}
\usepackage{times}
\begin{document}
\title{How to use the inparanoid packages}
\author{Marc Carlson}
\date{}
\maketitle
\section*{Introduction}
The inparanoid packages are based upon the gene to gene orthology
groupings as determined by the inparanoid algorithm. More details on
this algorithm can be found at the inparanoid website:
(\url{http://inparanoid.sbc.su.se/cgi-bin/index.cgi}). A nice brief
description of the inparanoid method is given by the FAQ at their
website: "The InParanoid program uses the pairwise similarity scores,
calculated using NCBI-Blast, between two complete proteomes for
constructing orthology groups. An orthology group is initially
composed of two so-called seed orthologs that are found by two-way
best hits between two proteomes. More sequences are added to the group
if there are sequences in the two proteomes that are closer to the
correpsonding seed ortholog than to any sequence in the other
proteome. These members of an orthology group are called inparalogs. A
confidence value is provided for each inparalog that shows how closely
related it is to its seed ortholog."
The Inparanoid algorithm has been run on 35 species so far. We
provide packages for five of these species, and within the packages
for these five supported species, we provide the mappings between that
species and all 35 of the Inparanoid species. The packages are named
as follows:
hom.Hs.inp.db for human mappings to the other 35 species
hom.Mm.inp.db for mouse mappings to the other 35 species
hom.Rn.inp.db for rat mappings to the other 35 species
hom.Dm.inp.db for fly mappings to the other 35 species
hom.Sc.inp.db for yeast mappings to the other 35 species
This vignette will discuss the different information contained within
these packages and how to use these packages to get information about
the genes that are most likely the orthologous match for a
particular gene.
\section*{Contents of the packages}
Within each inparanoid package there is a small database that contains
tables that map relationships between genes of one species and genes
of another. For the database that is inside of the human package
(hom.Hs.inp.db) the tables will be named according to the "other"
species that they will map to. As an example within the context of
the human package, the mus\_musculus table will map relationships
between humans and mouse. This particular table will be the exact
same table that will be inside of the mouse package (hom.Mm.inp.db),
but in that context the table will have the name homo\_sapiens to
denote that in this other context is provides a mapping relationship
between mouse and humans.
In addition to this database, there are also a series of prefabricated
mappings that can be used to get the information we anticipate most
users will want. Specifically, the reciprocal best matches or the
inparanoid "seed pairs". These are the matches that make up most of
the inparanoid tables, and which are intended to indicate the best
matches between one gene and another in a species match-up. So if you
have a human gene and you want to know what the likely equivalent of
that gene in mouse is, you can use the appropriate mapping to quickly
get that information. A quick look at the mappings that are available
when you load the human package will show you these:
<<loadAndListPackages>>=
library(DBI)
library("hom.Hs.inp.db")
ls("package:hom.Hs.inp.db")
@
What you will notice when you look at these is that these mappings all
have the format of "hom.Hs.inpXXXXX". This indicates that they are
mappings from the human package to their respective organisms give by
a 5 character code. Because a simple 2 letter species abbreviation is
too short to avoid redundancy when 35 species mappings are available,
we have adopted the inparanoid style of species abbreviations for
these mappings. This means that the 1st three letters designate the
genus, and the 2nd two designate the species. And so for example,
"MUSMU" is short for mus musculus, "DROME" is short for drosophila
melanogaster etc. One thign to note about these mappings is that
because they are maps, the data will have been formatted into a map
form. In most cases this detail will be completely irrelevant since
most seed pairs map 1:1. But some seed pairs map one to many or many
to many. In these cases, it is important to remember that the map
format will display the data as a 1:1 or 1:many relationship only. No
data has been lost in this transformation, but it is a good idea to
keep in mind that a tiny proportion of your keys may in fact map to
the same lists of values when using maps like this.
You can of course look at the contents of a mapping in the usual way:
<<listMapping>>=
as.list(hom.Hs.inpMUSMU[1:4])
@
When you do this you will probably notice that most of the seed
mappings are 1:1. But you might also notice that the IDs might not be
the kinds of IDs that you normally use.
The IDs in these mapping are the ones that were used by inparanoid in
their initial comparisons, but it is probably not a serious problem if
the inparanoid IDs are not the ones that you might have initially
wanted. For the mainstream organisms such as mouse, human, rat,
yeast, and fly, we also provide the needed data in the organism level
packages so that you can map back from inparanoid to a more familiar
set of IDs. Here is an example of how you can chain annotation
packages together to start with a common gene symbol for human (MSX2),
and then work over to the equivalent information in mouse (Msx2).
<<mapGeneExample>>=
# load the organism annotation data for human
library(org.Hs.eg.db)
# get the entrex gene ID and ensembl protein id for gene symbol "MSX2"
select(org.Hs.eg.db,
keys="MSX2",
columns=c("ENTREZID","ENSEMBLPROT"),
keytype="SYMBOL")
# use the inparanoid package to get the mouse gene that is considered
# equivalent to ensembl protein ID "ENSP00000239243"
select(hom.Hs.inp.db,
keys="ENSP00000239243",
columns="MUS_MUSCULUS",
keytype="HOMO_SAPIENS")
# load the organism annotation data for mouse
library(org.Mm.eg.db)
# get the entrez gene ID and gene Symbol for "ENSMUSP00000021922"
select(org.Mm.eg.db,
keys="ENSMUSP00000021922",
columns=c("ENTREZID","SYMBOL"),
keytype="ENSEMBLPROT")
@
The previous example demonstrates how the inparanoid mappings can give
you a shortcut to genes that are likely to be homologs. In addition,
this example shows how you can tap into a lot of desirable information
about whatever gene mappings you find by using the inparanoid package
in conjunction with the organism annotation packages and passing
through an entrez gene ID.
\subsection{Use \Rpackage{hom.Xx.Inp.db} to explore other paralogous
relationships among organisms}
As mentioned earlier, each database has a table that contains all the
information needed to make each of the standard mappings provided.
But there is other information contained in these tables as well such
as the inparalogs and their scores. This information can be accessed
by doing some simple queries using the DBI interface.
As an example consider the following seed pair mapping:
<<seedPairExample>>=
mget("ENSP00000301011", hom.Hs.inpMUSMU)
@
What if we wanted to know about other possible mappings that were not
seed mappings? To do this we could use the DBI interface. But in
order to do that we 1st have to look at what the underlying table
looks like. In order to that we will use the following 3 helper
functions to extablish a connection to the database, list the tables
contained by the database and list the fields within a table of
interest:
<<seedPairExample2>>=
# make a connection to the human database
mycon <- hom.Hs.inp_dbconn()
# make a list of all the tables that are available in the DB
head(dbListTables(mycon))
# make a list of the columns in the table of interest
dbListFields(mycon, "mus_musculus")
@
At this point we know the name of the table for the mouse data must be
mus\_musculus, and we also know the names of the colums that this
table contains thanks to \Rfunction{dbListFields}. So now we have all
the information we need to start querying the database directly. Lets
begin by probing the database with a simple query for all of the
infomation about the ensembl protein ID "ENSP00000301011":
<<seedPairExample3>>=
#make a query that will let us see which clust_id we need
sql <- "SELECT * FROM mus_musculus WHERE inp_id = 'ENSP00000301011';"
#retrieve the data
dataOut <- dbGetQuery(mycon, sql)
dataOut
@
From the results of this query, we can see that this ID belongs to
cluster ID \# 1731. Inparanoid groups genes that are considered to be
related into groupings that all share a common cluster ID. So now we
can adjust our query very slightly so that we pull out ALL of the
information about that entire group from the mus\_musculus table:
<<seedPairExample4>>=
#make a query that will let us see all the data that is affiliated with a clust id
sql <- "SELECT * FROM mus_musculus WHERE clust_id = '1731';"
#retrieve the data
dataOut <- dbGetQuery(mycon, sql)
dataOut
@
And there you have it, the complete inparanoid data about cluster\_id
1731, including the member of that grouping that we used to find the
group "ENSP00000301011". Because the database in this example is the
human inparanoid database, the mus\_musculus table shows us
information about both mouse and human genes, and which groups they
share. If for example you wanted to see a table about mouse and
zebrafish homologs, you would have to go look at the zebrafish table
contained in the mouse package.
\section{Session Information}
The version number of R and packages loaded for generating the vignette were:
<<echo=FALSE, results=tex>>=
toLatex(sessionInfo())
@
\end{document}
|