Offset 1, 2 lines modified | Offset 1, 2 lines modified | ||
1 | · | 1 | ·4de2cdf7a9c836de391e2e02a22a959e·1640820·gnu-r·optional·r-bioc-genomicfeatures_1.50.4+dfsg-1_all.deb |
Offset 1, 3 lines modified | Offset 1, 3 lines modified | ||
1 | -rw-r--r--···0········0········0········4·2023-01-30·12:34:26.000000·debian-binary | 1 | -rw-r--r--···0········0········0········4·2023-01-30·12:34:26.000000·debian-binary |
2 | -rw-r--r--···0········0········0·····2996·2023-01-30·12:34:26.000000·control.tar.xz | 2 | -rw-r--r--···0········0········0·····2996·2023-01-30·12:34:26.000000·control.tar.xz |
3 | -rw-r--r--···0········0········0··163 | 3 | -rw-r--r--···0········0········0··1637632·2023-01-30·12:34:26.000000·data.tar.xz |
Offset 20, 16 lines modified | Offset 20, 16 lines modified | ||
20 | drwxr-xr-x···0·root·········(0)·root·········(0)········0·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/R/ | 20 | drwxr-xr-x···0·root·········(0)·root·········(0)········0·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/R/ |
21 | -rw-r--r--···0·root·········(0)·root·········(0)·····1058·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/R/GenomicFeatures | 21 | -rw-r--r--···0·root·········(0)·root·········(0)·····1058·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/R/GenomicFeatures |
22 | -rw-r--r--···0·root·········(0)·root·········(0)··1156134·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/R/GenomicFeatures.rdb | 22 | -rw-r--r--···0·root·········(0)·root·········(0)··1156134·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/R/GenomicFeatures.rdb |
23 | -rw-r--r--···0·root·········(0)·root·········(0)····10015·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/R/GenomicFeatures.rdx | 23 | -rw-r--r--···0·root·········(0)·root·········(0)····10015·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/R/GenomicFeatures.rdx |
24 | drwxr-xr-x···0·root·········(0)·root·········(0)········0·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/doc/ | 24 | drwxr-xr-x···0·root·········(0)·root·········(0)········0·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/doc/ |
25 | -rw-r--r--···0·root·········(0)·root·········(0)·····4269·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/doc/GenomicFeatures.R | 25 | -rw-r--r--···0·root·········(0)·root·········(0)·····4269·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/doc/GenomicFeatures.R |
26 | -rw-r--r--···0·root·········(0)·root·········(0)····16695·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/doc/GenomicFeatures.Rmd | 26 | -rw-r--r--···0·root·········(0)·root·········(0)····16695·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/doc/GenomicFeatures.Rmd |
27 | -rw-r--r--···0·root·········(0)·root·········(0)····291 | 27 | -rw-r--r--···0·root·········(0)·root·········(0)····29189·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/doc/GenomicFeatures.html |
28 | -rw-r--r--···0·root·········(0)·root·········(0)····2149 | 28 | -rw-r--r--···0·root·········(0)·root·········(0)····21494·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/doc/GenomicFeatures.md |
29 | -rw-r--r--···0·root·········(0)·root·········(0)·····1783·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/doc/index.html | 29 | -rw-r--r--···0·root·········(0)·root·········(0)·····1783·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/doc/index.html |
30 | drwxr-xr-x···0·root·········(0)·root·········(0)········0·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/extdata/ | 30 | drwxr-xr-x···0·root·········(0)·root·········(0)········0·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/extdata/ |
31 | -rw-r--r--···0·root·········(0)·root·········(0)····45056·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/extdata/Biomart_Ensembl_sample.sqlite | 31 | -rw-r--r--···0·root·········(0)·root·········(0)····45056·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/extdata/Biomart_Ensembl_sample.sqlite |
32 | -rw-r--r--···0·root·········(0)·root·········(0)····34816·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/extdata/FeatureDb.sqlite | 32 | -rw-r--r--···0·root·········(0)·root·········(0)····34816·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/extdata/FeatureDb.sqlite |
33 | drwxr-xr-x···0·root·········(0)·root·········(0)········0·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/extdata/GFF3_files/ | 33 | drwxr-xr-x···0·root·········(0)·root·········(0)········0·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/extdata/GFF3_files/ |
34 | -rw-r--r--···0·root·········(0)·root·········(0)···263054·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/extdata/GFF3_files/NC_011025.gff | 34 | -rw-r--r--···0·root·········(0)·root·········(0)···263054·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/extdata/GFF3_files/NC_011025.gff |
35 | -rw-r--r--···0·root·········(0)·root·········(0)·····1760·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/extdata/GFF3_files/TheCanonicalGene_v1.gff3 | 35 | -rw-r--r--···0·root·········(0)·root·········(0)·····1760·2023-01-30·12:34:26.000000·./usr/lib/R/site-library/GenomicFeatures/extdata/GFF3_files/TheCanonicalGene_v1.gff3 |
Offset 92, 15 lines modified | Offset 92, 15 lines modified | ||
92 | <div·class="include-before"> | 92 | <div·class="include-before"> |
93 | </div> | 93 | </div> |
94 | <div·class="frontmatter"> | 94 | <div·class="frontmatter"> |
95 | <div·class="title"><h1>Making·and·Utilizing·TxDb·Objects</h1></div> | 95 | <div·class="title"><h1>Making·and·Utilizing·TxDb·Objects</h1></div> |
96 | <div·class="author"><h2>Marc·Carlson,·Patrick·Aboyoun,·Hervé·Pagès,·Seth·Falcon,·Martin·Morgan</h2></div> | 96 | <div·class="author"><h2>Marc·Carlson,·Patrick·Aboyoun,·Hervé·Pagès,·Seth·Falcon,·Martin·Morgan</h2></div> |
97 | <div·class="date"><h3> | 97 | <div·class="date"><h3>Friday,·January·12,·2024</h3></div> |
98 | </div> | 98 | </div> |
99 | <div·class="body"> | 99 | <div·class="body"> |
100 | <h2>Introduction</h2> | 100 | <h2>Introduction</h2> |
101 | <p>The·<code>GenomicFeatures</code>·package·retrieves·and·manages | 101 | <p>The·<code>GenomicFeatures</code>·package·retrieves·and·manages |
102 | transcript-related·features·from·the·UCSC·Genome | 102 | transcript-related·features·from·the·UCSC·Genome |
103 | Bioinformatics\footnote{(<a·href="http://genome.ucsc.edu/)%7D">http://genome.ucsc.edu/)}</a>·and | 103 | Bioinformatics\footnote{(<a·href="http://genome.ucsc.edu/)%7D">http://genome.ucsc.edu/)}</a>·and |
Offset 188, 24 lines modified | Offset 188, 24 lines modified | ||
188 | to·the·seqlevels·stored·in·the·db),·then·set·the·seqlevels·to | 188 | to·the·seqlevels·stored·in·the·db),·then·set·the·seqlevels·to |
189 | <code>seqlevels0(txdb)</code>.</p> | 189 | <code>seqlevels0(txdb)</code>.</p> |
190 | <pre><code·class="language-r">seqlevels(txdb)·<-·seqlevels0(txdb) | 190 | <pre><code·class="language-r">seqlevels(txdb)·<-·seqlevels0(txdb) |
191 | </code></pre> | 191 | </code></pre> |
192 | <pre><code>##·Error·in·seqlevels0(txdb):·could·not·find·function·"seqlevels0" | 192 | <pre><code>##·Error·in·seqlevels0(txdb):·could·not·find·function·"seqlevels0" |
193 | </code></pre> | 193 | </code></pre> |
194 | <p>\begin{Exercise}·Use·</code>seqlevels<code>·to·set·only·chromsome·15·to·be·active.··BTW,·the·rest·of·this·vignette·will·assume·you·have·succeeded·at·this.·\end{Exercise} | 194 | <p>\begin{Exercise}·Use·</code>seqlevels<code>·to·set·only·chromsome·15·to·be·active.··BTW,·the·rest·of·this·vignette·will·assume·you·have·succeeded·at·this.·\end{Exercise} |
195 | `J | 195 | `JJ\begin{Solution}</p> |
196 | <pre><code·class="language-r">seqlevels(txdb)·<-·"chr15" | 196 | <pre><code·class="language-r">seqlevels(txdb)·<-·"chr15" |
197 | </code></pre> | 197 | </code></pre> |
198 | <pre><code>##·Error·in·seqlevels(txdb)·<-·"chr15":·object·'txdb'·not·found | 198 | <pre><code>##·Error·in·seqlevels(txdb)·<-·"chr15":·object·'txdb'·not·found |
199 | </code></pre> | 199 | </code></pre> |
200 | <pre><code·class="language-r">seqlevels(txdb) | 200 | <pre><code·class="language-r">seqlevels(txdb) |
201 | </code></pre> | 201 | </code></pre> |
202 | <pre><code>##·Error·in·seqlevels(txdb):·could·not·find·function·"seqlevels" | 202 | <pre><code>##·Error·in·seqlevels(txdb):·could·not·find·function·"seqlevels" |
203 | </code></pre> | 203 | </code></pre> |
204 | <p>\end{Solution}J | 204 | <p>\end{Solution}JJ`</p> |
205 | <h3>Retrieving·data·using·the·select·method</h3> | 205 | <h3>Retrieving·data·using·the·select·method</h3> |
206 | <p>The·<code>TxDb</code>·objects·inherit·from·<code>AnnotationDb</code> | 206 | <p>The·<code>TxDb</code>·objects·inherit·from·<code>AnnotationDb</code> |
207 | objects·(just·as·the·<code>ChipDb</code>·and·<code>OrgDb</code>·objects·do). | 207 | objects·(just·as·the·<code>ChipDb</code>·and·<code>OrgDb</code>·objects·do). |
208 | One·of·the·implications·of·this·relationship·is·that·these·object | 208 | One·of·the·implications·of·this·relationship·is·that·these·object |
209 | ought·to·be·used·in·similar·ways·to·each·other.··Therefore·we·have | 209 | ought·to·be·used·in·similar·ways·to·each·other.··Therefore·we·have |
210 | written·supporting·<code>columns</code>,·<code>keytypes</code>,·<code>keys</code> | 210 | written·supporting·<code>columns</code>,·<code>keytypes</code>,·<code>keys</code> |
211 | and·<code>select</code>·methods·for·<code>TxDb</code>·objects.</p> | 211 | and·<code>select</code>·methods·for·<code>TxDb</code>·objects.</p> |
Offset 224, 25 lines modified | Offset 224, 25 lines modified | ||
224 | <pre><code>##·Error·in·keytypes(txdb):·could·not·find·function·"keytypes" | 224 | <pre><code>##·Error·in·keytypes(txdb):·could·not·find·function·"keytypes" |
225 | </code></pre> | 225 | </code></pre> |
226 | <pre><code·class="language-r">select(txdb,·keys·=·keys,·columns="TXNAME",·keytype="GENEID") | 226 | <pre><code·class="language-r">select(txdb,·keys·=·keys,·columns="TXNAME",·keytype="GENEID") |
227 | </code></pre> | 227 | </code></pre> |
228 | <pre><code>##·Error·in·select(txdb,·keys·=·keys,·columns·=·"TXNAME",·keytype·=·"GENEID"):·could·not·find·function·"select" | 228 | <pre><code>##·Error·in·select(txdb,·keys·=·keys,·columns·=·"TXNAME",·keytype·=·"GENEID"):·could·not·find·function·"select" |
229 | </code></pre> | 229 | </code></pre> |
230 | <p>\begin{Exercise}·For·the·genes·in·the·example·above,·find·the·chromosome·and·strand·information·that·will·go·with·each·of·the·transcript·names.·\end{Exercise} | 230 | <p>\begin{Exercise}·For·the·genes·in·the·example·above,·find·the·chromosome·and·strand·information·that·will·go·with·each·of·the·transcript·names.·\end{Exercise} |
231 | `J | 231 | `JJ\begin{Solution}</p> |
232 | <pre><code·class="language-r">columns(txdb) | 232 | <pre><code·class="language-r">columns(txdb) |
233 | </code></pre> | 233 | </code></pre> |
234 | <pre><code>##·Error·in·columns(txdb):·could·not·find·function·"columns" | 234 | <pre><code>##·Error·in·columns(txdb):·could·not·find·function·"columns" |
235 | </code></pre> | 235 | </code></pre> |
236 | <pre><code·class="language-r">cols·<-·c("TXNAME",·"TXSTRAND",·"TXCHROM") | 236 | <pre><code·class="language-r">cols·<-·c("TXNAME",·"TXSTRAND",·"TXCHROM") |
237 | select(txdb,·keys=keys,·columns=cols,·keytype="GENEID") | 237 | select(txdb,·keys=keys,·columns=cols,·keytype="GENEID") |
238 | </code></pre> | 238 | </code></pre> |
239 | <pre><code>##·Error·in·select(txdb,·keys·=·keys,·columns·=·cols,·keytype·=·"GENEID"):·could·not·find·function·"select" | 239 | <pre><code>##·Error·in·select(txdb,·keys·=·keys,·columns·=·cols,·keytype·=·"GENEID"):·could·not·find·function·"select" |
240 | </code></pre> | 240 | </code></pre> |
241 | <p>\end{Solution}J | 241 | <p>\end{Solution}JJ`</p> |
242 | <h3>Methods·for·returning·<code>GRanges</code>·objects</h3> | 242 | <h3>Methods·for·returning·<code>GRanges</code>·objects</h3> |
243 | <p>Retrieving·data·with·select·is·useful,·but·sometimes·it·is·more | 243 | <p>Retrieving·data·with·select·is·useful,·but·sometimes·it·is·more |
244 | convenient·to·extract·the·result·as·<code>GRanges</code>·objects.··This·is | 244 | convenient·to·extract·the·result·as·<code>GRanges</code>·objects.··This·is |
245 | often·the·case·when·you·are·doing·counting·or·specialized·overlap | 245 | often·the·case·when·you·are·doing·counting·or·specialized·overlap |
246 | operations·downstream.··For·these·use·cases·there·is·another·family·of | 246 | operations·downstream.··For·these·use·cases·there·is·another·family·of |
247 | methods·available.</p> | 247 | methods·available.</p> |
248 | <p>Perhaps·the·most·common·operations·for·a·<code>TxDb</code>·object | 248 | <p>Perhaps·the·most·common·operations·for·a·<code>TxDb</code>·object |
Offset 317, 15 lines modified | Offset 317, 15 lines modified | ||
317 | </code></pre> | 317 | </code></pre> |
318 | <pre><code>##·Error·in·eval(expr,·envir,·enclos):·object·'PR'·not·found | 318 | <pre><code>##·Error·in·eval(expr,·envir,·enclos):·object·'PR'·not·found |
319 | </code></pre> | 319 | </code></pre> |
320 | <p>The·<code>exons</code>·and·<code>cds</code>·functions·can·also·be·used | 320 | <p>The·<code>exons</code>·and·<code>cds</code>·functions·can·also·be·used |
321 | in·a·similar·fashion·to·retrive·genomic·coordinates·for·exons·and | 321 | in·a·similar·fashion·to·retrive·genomic·coordinates·for·exons·and |
322 | coding·sequences.</p> | 322 | coding·sequences.</p> |
323 | <p>\begin{Exercise}·Use·</code>exons<code>to·retrieve·all·the·exons·from·chromosome·15.·How·does·the·length·of·this·compare·to·the·value·returned·by</code>transcripts<code>?·\end{Exercise} | 323 | <p>\begin{Exercise}·Use·</code>exons<code>to·retrieve·all·the·exons·from·chromosome·15.·How·does·the·length·of·this·compare·to·the·value·returned·by</code>transcripts<code>?·\end{Exercise} |
324 | `J | 324 | `JJ\begin{Solution}</p> |
325 | <pre><code·class="language-r">EX·<-·exons(txdb) | 325 | <pre><code·class="language-r">EX·<-·exons(txdb) |
326 | </code></pre> | 326 | </code></pre> |
327 | <pre><code>##·Error·in·exons(txdb):·could·not·find·function·"exons" | 327 | <pre><code>##·Error·in·exons(txdb):·could·not·find·function·"exons" |
328 | </code></pre> | 328 | </code></pre> |
329 | <pre><code·class="language-r">EX[1:4] | 329 | <pre><code·class="language-r">EX[1:4] |
330 | </code></pre> | 330 | </code></pre> |
331 | <pre><code>##·Error·in·eval(expr,·envir,·enclos):·object·'EX'·not·found | 331 | <pre><code>##·Error·in·eval(expr,·envir,·enclos):·object·'EX'·not·found |
Offset 334, 15 lines modified | Offset 334, 15 lines modified | ||
334 | </code></pre> | 334 | </code></pre> |
335 | <pre><code>##·Error·in·eval(expr,·envir,·enclos):·object·'EX'·not·found | 335 | <pre><code>##·Error·in·eval(expr,·envir,·enclos):·object·'EX'·not·found |
336 | </code></pre> | 336 | </code></pre> |
337 | <pre><code·class="language-r">length(GR) | 337 | <pre><code·class="language-r">length(GR) |
338 | </code></pre> | 338 | </code></pre> |
339 | <pre><code>##·Error·in·eval(expr,·envir,·enclos):·object·'GR'·not·found | 339 | <pre><code>##·Error·in·eval(expr,·envir,·enclos):·object·'GR'·not·found |
340 | </code></pre> | 340 | </code></pre> |
341 | <p>\end{Solution}J | 341 | <p>\end{Solution}JJ`</p> |
342 | <h3>Working·with·Grouped·Features</h3> | 342 | <h3>Working·with·Grouped·Features</h3> |
343 | <p>Often·one·is·interested·in·how·particular·genomic·features·relate·to | 343 | <p>Often·one·is·interested·in·how·particular·genomic·features·relate·to |
344 | each·other,·and·not·just·their·location.··For·example,·it·might·be·of | 344 | each·other,·and·not·just·their·location.··For·example,·it·might·be·of |
345 | interest·to·group·transcripts·by·gene·or·to·group·exons·by·transcript. | 345 | interest·to·group·transcripts·by·gene·or·to·group·exons·by·transcript. |
346 | Such·groupings·are·supported·by·the·<code>transcriptsBy</code>, | 346 | Such·groupings·are·supported·by·the·<code>transcriptsBy</code>, |
347 | <code>exonsBy</code>,·and·<code>cdsBy</code>·functions.</p> | 347 | <code>exonsBy</code>,·and·<code>cdsBy</code>·functions.</p> |
348 | <p>The·following·call·can·be·used·to·group·transcripts·by·genes:</p> | 348 | <p>The·following·call·can·be·used·to·group·transcripts·by·genes:</p> |
Offset 405, 28 lines modified | Offset 405, 28 lines modified | ||
405 | unique·identifier·for·all·features.··In·this·situation,·the·group | 405 | unique·identifier·for·all·features.··In·this·situation,·the·group |
406 | label·will·be·a·synthetic·ID·created·by·<code>GenomicFeatures</code>·to | 406 | label·will·be·a·synthetic·ID·created·by·<code>GenomicFeatures</code>·to |
407 | keep·the·relations·between·features·consistent·in·the·database·this | 407 | keep·the·relations·between·features·consistent·in·the·database·this |
408 | was·the·case·in·the·2nd·example.··Even·though·the·results·will | 408 | was·the·case·in·the·2nd·example.··Even·though·the·results·will |
409 | sometimes·have·to·come·back·to·you·as·synthetic·IDs,·you·can·still | 409 | sometimes·have·to·come·back·to·you·as·synthetic·IDs,·you·can·still |
410 | always·retrieve·the·original·IDs.</p> | 410 | always·retrieve·the·original·IDs.</p> |
411 | <p>\begin{Exercise}·Starting·with·the·tx_ids·that·are·the·names·of·the·GRList·object·we·just·made,·use·</code>select<code>to·retrieve·that·matching·transcript·names.··Remember·that·the·list·used·a</code>by<code>·argument·=·"tx",·so·the·list·is·grouped·by·transcript·IDs.·\end{Exercise} | 411 | <p>\begin{Exercise}·Starting·with·the·tx_ids·that·are·the·names·of·the·GRList·object·we·just·made,·use·</code>select<code>to·retrieve·that·matching·transcript·names.··Remember·that·the·list·used·a</code>by<code>·argument·=·"tx",·so·the·list·is·grouped·by·transcript·IDs.·\end{Exercise} |
412 | `J | 412 | `JJ\begin{Solution}</p> |
413 | <pre><code·class="language-r">GRList·<-·exonsBy(txdb,·by·=·"tx") | 413 | <pre><code·class="language-r">GRList·<-·exonsBy(txdb,·by·=·"tx") |
414 | </code></pre> | 414 | </code></pre> |
415 | <pre><code>##·Error·in·exonsBy(txdb,·by·=·"tx"):·could·not·find·function·"exonsBy" | 415 | <pre><code>##·Error·in·exonsBy(txdb,·by·=·"tx"):·could·not·find·function·"exonsBy" |
416 | </code></pre> | 416 | </code></pre> |
417 | <pre><code·class="language-r">tx_ids·<-·names(GRList) | 417 | <pre><code·class="language-r">tx_ids·<-·names(GRList) |
418 | </code></pre> | 418 | </code></pre> |
419 | <pre><code>##·Error·in·eval(expr,·envir,·enclos):·object·'GRList'·not·found | 419 | <pre><code>##·Error·in·eval(expr,·envir,·enclos):·object·'GRList'·not·found |
420 | </code></pre> | 420 | </code></pre> |
421 | <pre><code·class="language-r">head(select(txdb,·keys=tx_ids,·columns="TXNAME",·keytype="TXID")) | 421 | <pre><code·class="language-r">head(select(txdb,·keys=tx_ids,·columns="TXNAME",·keytype="TXID")) |
422 | </code></pre> | 422 | </code></pre> |
423 | <pre><code>##·Error·in·select(txdb,·keys·=·tx_ids,·columns·=·"TXNAME",·keytype·=·"TXID"):·could·not·find·function·"select" | 423 | <pre><code>##·Error·in·select(txdb,·keys·=·tx_ids,·columns·=·"TXNAME",·keytype·=·"TXID"):·could·not·find·function·"select" |
424 | </code></pre> | 424 | </code></pre> |
425 | <p>\end{Solution}J | 425 | <p>\end{Solution}JJ`</p> |
426 | <p>Finally,·the·order·of·the·results·in·a·<code>GRangesList</code>·object·can | 426 | <p>Finally,·the·order·of·the·results·in·a·<code>GRangesList</code>·object·can |
427 | vary·with·the·way·in·which·things·were·grouped.·In·most·cases·the | 427 | vary·with·the·way·in·which·things·were·grouped.·In·most·cases·the |
428 | grouped·elements·of·the·<code>GRangesList</code>·object·will·be·listed·in | 428 | grouped·elements·of·the·<code>GRangesList</code>·object·will·be·listed·in |
429 | the·order·that·they·occurred·along·the·chromosome.··However,·when | 429 | the·order·that·they·occurred·along·the·chromosome.··However,·when |
430 | exons·or·CDS·are·grouped·by·transcript,·they·will·instead·be·grouped | 430 | exons·or·CDS·are·grouped·by·transcript,·they·will·instead·be·grouped |
431 | according·to·their·position·along·the·transcript·itself.··This·is | 431 | according·to·their·position·along·the·transcript·itself.··This·is |
432 | important·because·alternative·splicing·can·mean·that·the·order·along | 432 | important·because·alternative·splicing·can·mean·that·the·order·along |
Max diff block lines reached; 1790/9084 bytes (19.70%) of diff not shown. |
Offset 1, 13 lines modified | Offset 1, 13 lines modified | ||
1 | ******·Making·and·Utilizing·TxDb·Objects·****** | 1 | ******·Making·and·Utilizing·TxDb·Objects·****** |
2 | *****·Marc·Carlson,·Patrick·Aboyoun,·Hervé·Pagès,·Seth·Falcon,·Martin·Morgan | 2 | *****·Marc·Carlson,·Patrick·Aboyoun,·Hervé·Pagès,·Seth·Falcon,·Martin·Morgan |
3 | ***** | 3 | ***** |
4 | ****· | 4 | ****·Friday,·January·12,·2024·**** |
5 | *****·Introduction·***** | 5 | *****·Introduction·***** |
6 | The·GenomicFeatures·package·retrieves·and·manages·transcript-related·features | 6 | The·GenomicFeatures·package·retrieves·and·manages·transcript-related·features |
7 | from·the·UCSC·Genome·Bioinformatics\footnote{(http://genome.ucsc.edu/)}·and | 7 | from·the·UCSC·Genome·Bioinformatics\footnote{(http://genome.ucsc.edu/)}·and |
8 | BioMart\footnote{(http://www.biomart.org/)}·data·resources.·The·package·is | 8 | BioMart\footnote{(http://www.biomart.org/)}·data·resources.·The·package·is |
9 | useful·for·ChIP-chip,·ChIP-seq,·and·RNA-seq·analyses. | 9 | useful·for·ChIP-chip,·ChIP-seq,·and·RNA-seq·analyses. |
10 | suppressPackageStartupMessages(library('GenomicFeatures')) | 10 | suppressPackageStartupMessages(library('GenomicFeatures')) |
11 | ##·Error·in·library("GenomicFeatures"):·there·is·no·package·called | 11 | ##·Error·in·library("GenomicFeatures"):·there·is·no·package·called |
Offset 69, 20 lines modified | Offset 69, 20 lines modified | ||
69 | would·be·consulted·when·you·call·the·various·retrieval·methods⦷If·you·need | 69 | would·be·consulted·when·you·call·the·various·retrieval·methods⦷If·you·need |
70 | to·reset·back·to·the·original·seqlevels·(i.e.·to·the·seqlevels·stored·in·the | 70 | to·reset·back·to·the·original·seqlevels·(i.e.·to·the·seqlevels·stored·in·the |
71 | db),·then·set·the·seqlevels·to·seqlevels0(txdb). | 71 | db),·then·set·the·seqlevels·to·seqlevels0(txdb). |
72 | seqlevels(txdb)·<-·seqlevels0(txdb) | 72 | seqlevels(txdb)·<-·seqlevels0(txdb) |
73 | ##·Error·in·seqlevels0(txdb):·could·not·find·function·"seqlevels0" | 73 | ##·Error·in·seqlevels0(txdb):·could·not·find·function·"seqlevels0" |
74 | \begin{Exercise}·Use | 74 | \begin{Exercise}·Use |
75 | seqlevelsto·set·only·chromsome·15·to·be·active.·BTW,·the·rest·of·this·vignette | 75 | seqlevelsto·set·only·chromsome·15·to·be·active.·BTW,·the·rest·of·this·vignette |
76 | will·assume·you·have·succeeded·at·this.·\end{Exercise}·`J | 76 | will·assume·you·have·succeeded·at·this.·\end{Exercise}·`JJ\begin{Solution} |
77 | seqlevels(txdb)·<-·"chr15" | 77 | seqlevels(txdb)·<-·"chr15" |
78 | ##·Error·in·seqlevels(txdb)·<-·"chr15":·object·'txdb'·not·found | 78 | ##·Error·in·seqlevels(txdb)·<-·"chr15":·object·'txdb'·not·found |
79 | seqlevels(txdb) | 79 | seqlevels(txdb) |
80 | ##·Error·in·seqlevels(txdb):·could·not·find·function·"seqlevels" | 80 | ##·Error·in·seqlevels(txdb):·could·not·find·function·"seqlevels" |
81 | \end{Solution}J | 81 | \end{Solution}JJ` |
82 | ****·Retrieving·data·using·the·select·method·**** | 82 | ****·Retrieving·data·using·the·select·method·**** |
83 | The·TxDb·objects·inherit·from·AnnotationDb·objects·(just·as·the·ChipDb·and | 83 | The·TxDb·objects·inherit·from·AnnotationDb·objects·(just·as·the·ChipDb·and |
84 | OrgDb·objects·do).·One·of·the·implications·of·this·relationship·is·that·these | 84 | OrgDb·objects·do).·One·of·the·implications·of·this·relationship·is·that·these |
85 | object·ought·to·be·used·in·similar·ways·to·each·other.·Therefore·we·have | 85 | object·ought·to·be·used·in·similar·ways·to·each·other.·Therefore·we·have |
86 | written·supporting·columns,·keytypes,·keys·and·select·methods·for·TxDb·objects. | 86 | written·supporting·columns,·keytypes,·keys·and·select·methods·for·TxDb·objects. |
87 | These·methods·can·be·a·useful·way·of·extracting·data·from·a·TxDb·object.·And | 87 | These·methods·can·be·a·useful·way·of·extracting·data·from·a·TxDb·object.·And |
88 | they·are·used·in·the·same·way·that·they·would·be·used·to·extract·information | 88 | they·are·used·in·the·same·way·that·they·would·be·used·to·extract·information |
Offset 94, 22 lines modified | Offset 94, 22 lines modified | ||
94 | keytypes(txdb) | 94 | keytypes(txdb) |
95 | ##·Error·in·keytypes(txdb):·could·not·find·function·"keytypes" | 95 | ##·Error·in·keytypes(txdb):·could·not·find·function·"keytypes" |
96 | select(txdb,·keys·=·keys,·columns="TXNAME",·keytype="GENEID") | 96 | select(txdb,·keys·=·keys,·columns="TXNAME",·keytype="GENEID") |
97 | ##·Error·in·select(txdb,·keys·=·keys,·columns·=·"TXNAME",·keytype·=·"GENEID"): | 97 | ##·Error·in·select(txdb,·keys·=·keys,·columns·=·"TXNAME",·keytype·=·"GENEID"): |
98 | could·not·find·function·"select" | 98 | could·not·find·function·"select" |
99 | \begin{Exercise}·For·the·genes·in·the·example·above,·find·the·chromosome·and | 99 | \begin{Exercise}·For·the·genes·in·the·example·above,·find·the·chromosome·and |
100 | strand·information·that·will·go·with·each·of·the·transcript·names.·\end | 100 | strand·information·that·will·go·with·each·of·the·transcript·names.·\end |
101 | {Exercise}·`J | 101 | {Exercise}·`JJ\begin{Solution} |
102 | columns(txdb) | 102 | columns(txdb) |
103 | ##·Error·in·columns(txdb):·could·not·find·function·"columns" | 103 | ##·Error·in·columns(txdb):·could·not·find·function·"columns" |
104 | cols·<-·c("TXNAME",·"TXSTRAND",·"TXCHROM") | 104 | cols·<-·c("TXNAME",·"TXSTRAND",·"TXCHROM") |
105 | select(txdb,·keys=keys,·columns=cols,·keytype="GENEID") | 105 | select(txdb,·keys=keys,·columns=cols,·keytype="GENEID") |
106 | ##·Error·in·select(txdb,·keys·=·keys,·columns·=·cols,·keytype·=·"GENEID"): | 106 | ##·Error·in·select(txdb,·keys·=·keys,·columns·=·cols,·keytype·=·"GENEID"): |
107 | could·not·find·function·"select" | 107 | could·not·find·function·"select" |
108 | \end{Solution}J | 108 | \end{Solution}JJ` |
109 | ****·Methods·for·returning·GRanges·objects·**** | 109 | ****·Methods·for·returning·GRanges·objects·**** |
110 | Retrieving·data·with·select·is·useful,·but·sometimes·it·is·more·convenient·to | 110 | Retrieving·data·with·select·is·useful,·but·sometimes·it·is·more·convenient·to |
111 | extract·the·result·as·GRanges·objects.·This·is·often·the·case·when·you·are | 111 | extract·the·result·as·GRanges·objects.·This·is·often·the·case·when·you·are |
112 | doing·counting·or·specialized·overlap·operations·downstream.·For·these·use | 112 | doing·counting·or·specialized·overlap·operations·downstream.·For·these·use |
113 | cases·there·is·another·family·of·methods·available. | 113 | cases·there·is·another·family·of·methods·available. |
114 | Perhaps·the·most·common·operations·for·a·TxDb·object·is·to·retrieve·the·genomic | 114 | Perhaps·the·most·common·operations·for·a·TxDb·object·is·to·retrieve·the·genomic |
115 | coordinates·or·ranges·for·exons,·transcripts·or·coding·sequences.·The·functions | 115 | coordinates·or·ranges·for·exons,·transcripts·or·coding·sequences.·The·functions |
Offset 156, 24 lines modified | Offset 156, 24 lines modified | ||
156 | function·"promoters" | 156 | function·"promoters" |
157 | PR | 157 | PR |
158 | ##·Error·in·eval(expr,·envir,·enclos):·object·'PR'·not·found | 158 | ##·Error·in·eval(expr,·envir,·enclos):·object·'PR'·not·found |
159 | The·exons·and·cds·functions·can·also·be·used·in·a·similar·fashion·to·retrive | 159 | The·exons·and·cds·functions·can·also·be·used·in·a·similar·fashion·to·retrive |
160 | genomic·coordinates·for·exons·and·coding·sequences. | 160 | genomic·coordinates·for·exons·and·coding·sequences. |
161 | \begin{Exercise}·Use | 161 | \begin{Exercise}·Use |
162 | exonsto·retrieve·all·the·exons·from·chromosome·15.·How·does·the·length·of·this | 162 | exonsto·retrieve·all·the·exons·from·chromosome·15.·How·does·the·length·of·this |
163 | compare·to·the·value·returned·bytranscripts?·\end{Exercise}·`J | 163 | compare·to·the·value·returned·bytranscripts?·\end{Exercise}·`JJ\begin{Solution} |
164 | EX·<-·exons(txdb) | 164 | EX·<-·exons(txdb) |
165 | ##·Error·in·exons(txdb):·could·not·find·function·"exons" | 165 | ##·Error·in·exons(txdb):·could·not·find·function·"exons" |
166 | EX[1:4] | 166 | EX[1:4] |
167 | ##·Error·in·eval(expr,·envir,·enclos):·object·'EX'·not·found | 167 | ##·Error·in·eval(expr,·envir,·enclos):·object·'EX'·not·found |
168 | length(EX) | 168 | length(EX) |
169 | ##·Error·in·eval(expr,·envir,·enclos):·object·'EX'·not·found | 169 | ##·Error·in·eval(expr,·envir,·enclos):·object·'EX'·not·found |
170 | length(GR) | 170 | length(GR) |
171 | ##·Error·in·eval(expr,·envir,·enclos):·object·'GR'·not·found | 171 | ##·Error·in·eval(expr,·envir,·enclos):·object·'GR'·not·found |
172 | \end{Solution}J | 172 | \end{Solution}JJ` |
173 | ****·Working·with·Grouped·Features·**** | 173 | ****·Working·with·Grouped·Features·**** |
174 | Often·one·is·interested·in·how·particular·genomic·features·relate·to·each | 174 | Often·one·is·interested·in·how·particular·genomic·features·relate·to·each |
175 | other,·and·not·just·their·location.·For·example,·it·might·be·of·interest·to | 175 | other,·and·not·just·their·location.·For·example,·it·might·be·of·interest·to |
176 | group·transcripts·by·gene·or·to·group·exons·by·transcript.·Such·groupings·are | 176 | group·transcripts·by·gene·or·to·group·exons·by·transcript.·Such·groupings·are |
177 | supported·by·the·transcriptsBy,·exonsBy,·and·cdsBy·functions. | 177 | supported·by·the·transcriptsBy,·exonsBy,·and·cdsBy·functions. |
178 | The·following·call·can·be·used·to·group·transcripts·by·genes: | 178 | The·following·call·can·be·used·to·group·transcripts·by·genes: |
179 | GRList·<-·transcriptsBy(txdb,·by·=·"gene") | 179 | GRList·<-·transcriptsBy(txdb,·by·=·"gene") |
Offset 217, 23 lines modified | Offset 217, 23 lines modified | ||
217 | relations·between·features·consistent·in·the·database·this·was·the·case·in·the | 217 | relations·between·features·consistent·in·the·database·this·was·the·case·in·the |
218 | 2nd·example.·Even·though·the·results·will·sometimes·have·to·come·back·to·you·as | 218 | 2nd·example.·Even·though·the·results·will·sometimes·have·to·come·back·to·you·as |
219 | synthetic·IDs,·you·can·still·always·retrieve·the·original·IDs. | 219 | synthetic·IDs,·you·can·still·always·retrieve·the·original·IDs. |
220 | \begin{Exercise}·Starting·with·the·tx_ids·that·are·the·names·of·the·GRList | 220 | \begin{Exercise}·Starting·with·the·tx_ids·that·are·the·names·of·the·GRList |
221 | object·we·just·made,·use | 221 | object·we·just·made,·use |
222 | selectto·retrieve·that·matching·transcript·names.·Remember·that·the·list·used | 222 | selectto·retrieve·that·matching·transcript·names.·Remember·that·the·list·used |
223 | abyargument·=·"tx",·so·the·list·is·grouped·by·transcript·IDs.·\end{Exercise} | 223 | abyargument·=·"tx",·so·the·list·is·grouped·by·transcript·IDs.·\end{Exercise} |
224 | `J | 224 | `JJ\begin{Solution} |
225 | GRList·<-·exonsBy(txdb,·by·=·"tx") | 225 | GRList·<-·exonsBy(txdb,·by·=·"tx") |
226 | ##·Error·in·exonsBy(txdb,·by·=·"tx"):·could·not·find·function·"exonsBy" | 226 | ##·Error·in·exonsBy(txdb,·by·=·"tx"):·could·not·find·function·"exonsBy" |
227 | tx_ids·<-·names(GRList) | 227 | tx_ids·<-·names(GRList) |
228 | ##·Error·in·eval(expr,·envir,·enclos):·object·'GRList'·not·found | 228 | ##·Error·in·eval(expr,·envir,·enclos):·object·'GRList'·not·found |
229 | head(select(txdb,·keys=tx_ids,·columns="TXNAME",·keytype="TXID")) | 229 | head(select(txdb,·keys=tx_ids,·columns="TXNAME",·keytype="TXID")) |
230 | ##·Error·in·select(txdb,·keys·=·tx_ids,·columns·=·"TXNAME",·keytype·=·"TXID"): | 230 | ##·Error·in·select(txdb,·keys·=·tx_ids,·columns·=·"TXNAME",·keytype·=·"TXID"): |
231 | could·not·find·function·"select" | 231 | could·not·find·function·"select" |
232 | \end{Solution}J | 232 | \end{Solution}JJ` |
233 | Finally,·the·order·of·the·results·in·a·GRangesList·object·can·vary·with·the·way | 233 | Finally,·the·order·of·the·results·in·a·GRangesList·object·can·vary·with·the·way |
234 | in·which·things·were·grouped.·In·most·cases·the·grouped·elements·of·the | 234 | in·which·things·were·grouped.·In·most·cases·the·grouped·elements·of·the |
235 | GRangesList·object·will·be·listed·in·the·order·that·they·occurred·along·the | 235 | GRangesList·object·will·be·listed·in·the·order·that·they·occurred·along·the |
236 | chromosome.·However,·when·exons·or·CDS·are·grouped·by·transcript,·they·will | 236 | chromosome.·However,·when·exons·or·CDS·are·grouped·by·transcript,·they·will |
237 | instead·be·grouped·according·to·their·position·along·the·transcript·itself. | 237 | instead·be·grouped·according·to·their·position·along·the·transcript·itself. |
238 | This·is·important·because·alternative·splicing·can·mean·that·the·order·along | 238 | This·is·important·because·alternative·splicing·can·mean·that·the·order·along |
239 | the·transcript·can·be·different·from·that·along·the·chromosome. | 239 | the·transcript·can·be·different·from·that·along·the·chromosome. |
Offset 268, 22 lines modified | Offset 268, 22 lines modified | ||
268 | suppressWarnings(translate(tx_seqs1)) | 268 | suppressWarnings(translate(tx_seqs1)) |
269 | ##·Error·in·translate(tx_seqs1):·could·not·find·function·"translate" | 269 | ##·Error·in·translate(tx_seqs1):·could·not·find·function·"translate" |
270 | \begin{Exercise}·But·of·course·this·is·not·a·meaningful·translation,·because | 270 | \begin{Exercise}·But·of·course·this·is·not·a·meaningful·translation,·because |
271 | the·call·to | 271 | the·call·to |
272 | extractTranscriptSeqswill·have·extracted·all·the·transcribed·regions·of·the | 272 | extractTranscriptSeqswill·have·extracted·all·the·transcribed·regions·of·the |
273 | genome·regardless·of·whether·or·not·they·are·translated.·Look·at·the·manual | 273 | genome·regardless·of·whether·or·not·they·are·translated.·Look·at·the·manual |
274 | page·forextractTranscriptSeqsand·see·how·you·can·use·cdsBy·to·only·translate | 274 | page·forextractTranscriptSeqsand·see·how·you·can·use·cdsBy·to·only·translate |
275 | only·the·coding·regions.·\end{Exercise}·`J | 275 | only·the·coding·regions.·\end{Exercise}·`JJ\begin{Solution} |
276 | cds_seqs·<-·extractTranscriptSeqs(Hsapiens, | 276 | cds_seqs·<-·extractTranscriptSeqs(Hsapiens, |
277 | ··································cdsBy(txdb,·by="tx",·use.names=TRUE)) | 277 | ··································cdsBy(txdb,·by="tx",·use.names=TRUE)) |
278 | ##·Error·in·extractTranscriptSeqs(Hsapiens,·cdsBy(txdb,·by·=·"tx",·use.names·= | 278 | ##·Error·in·extractTranscriptSeqs(Hsapiens,·cdsBy(txdb,·by·=·"tx",·use.names·= |
279 | TRUE)):·could·not·find·function·"extractTranscriptSeqs" | 279 | TRUE)):·could·not·find·function·"extractTranscriptSeqs" |
280 | translate(cds_seqs) | 280 | translate(cds_seqs) |
281 | ##·Error·in·translate(cds_seqs):·could·not·find·function·"translate" | 281 | ##·Error·in·translate(cds_seqs):·could·not·find·function·"translate" |
282 | \end{Solution}J | 282 | \end{Solution}JJ` |
283 | *****·Creating·New·TxDb·Objects·or·Packages·***** | 283 | *****·Creating·New·TxDb·Objects·or·Packages·***** |
284 | The·GenomicFeatures·package·provides·functions·to·create·TxDb·objects·based·on | 284 | The·GenomicFeatures·package·provides·functions·to·create·TxDb·objects·based·on |
285 | data·downloaded·from·UCSC·Genome·Bioinformatics·or·BioMart.·The·following | 285 | data·downloaded·from·UCSC·Genome·Bioinformatics·or·BioMart.·The·following |
286 | subsections·demonstrate·the·use·of·these·functions.·There·is·also·support·for | 286 | subsections·demonstrate·the·use·of·these·functions.·There·is·also·support·for |
287 | creating·TxDb·objects·from·custom·data·sources·using·makeTxDb;·see·the·help | 287 | creating·TxDb·objects·from·custom·data·sources·using·makeTxDb;·see·the·help |
Max diff block lines reached; 34/7473 bytes (0.45%) of diff not shown. |
Offset 1, 11 lines modified | Offset 1, 11 lines modified | ||
1 | --- | 1 | --- |
2 | title:·"Making·and·Utilizing·TxDb·Objects" | 2 | title:·"Making·and·Utilizing·TxDb·Objects" |
3 | author:·"Marc·Carlson,·Patrick·Aboyoun,·Hervé·Pagès,·Seth·Falcon,·Martin·Morgan" | 3 | author:·"Marc·Carlson,·Patrick·Aboyoun,·Hervé·Pagès,·Seth·Falcon,·Martin·Morgan" |
4 | date:·" | 4 | date:·"Friday,·January·12,·2024" |
5 | package:·GenomicFeatures | 5 | package:·GenomicFeatures |
6 | output: | 6 | output: |
7 | ··BiocStyle::html_document: | 7 | ··BiocStyle::html_document: |
8 | ····df_print:·paged | 8 | ····df_print:·paged |
9 | ····toc_float:·true | 9 | ····toc_float:·true |
10 | vignette:·> | 10 | vignette:·> |
11 | ··%\VignetteIndexEntry{Making·and·Utilizing·TxDb·Objects} | 11 | ··%\VignetteIndexEntry{Making·and·Utilizing·TxDb·Objects} |