Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add how-to-load-gene-from-gff #6

Merged
merged 6 commits into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ Authors@R: c(
person(
"Pedro", "Baldoni",
role = "aut"
),
person(
"Jenny", "Drnevich",
role = "aut"
)
)
Description: This package provides a crowd-sourced collection of 'How To'
Expand All @@ -61,6 +65,7 @@ Imports:
BiocStyle,
GenomicAlignments,
pasillaBamSubset,
txdbmaker,
mzR,
MsDataHub,
Spectra,
Expand Down
5 changes: 3 additions & 2 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ articles:
- how-to-read-single-end-reads-from-bam-file
- how-to-read-paired-end-reads-from-bam-file
- how-to-read-big-bam-file-in-chunks

- title: Mass spectrometry
contents:
- how-to-read-mass-spectrometry-data

- title: Accessing genomic annotation data
contents:
- how-to-retrieve-gene-model-from-annotationhub
- how-to-retrieve-gene-model-from-annotationhub
- how-to-load-gene-from-gff-gtf
75 changes: 75 additions & 0 deletions vignettes/how-to-load-gene-from-gff-gtf.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
title: How to load a gene model from a GFF or GTF file
author: Bioconductor Core Team
date: "`r Sys.Date()`"
vignette: >
%\VignetteIndexEntry{How to load a gene model from a GFF or GTF file}
%\VignetteEngine{quarto::html}
%\VignetteEncoding{UTF-8}
knitr:
opts_chunk:
collapse: true
comment: '#>'
format:
html:
toc: true
html-math-method: mathjax
---

```{r}
#| echo: false

suppressPackageStartupMessages({
library(BiocStyle)
})
```

A **gene model** is essentially a set of annotations that
describes the genomic locations of the known genes, transcripts, exons, and CDS, for
a given organism. The standardized file format to hold gene models is a **[GFF or GTF](https://useast.ensembl.org/info/website/upload/gff.html)**. In Bioconductor, gene model information is typically represented as a TxDb object but also sometimes as a GRanges or GRangesList object. We can use the `makeTxDbFromGFF()` function from the `r Biocpkg("txdbmaker")` package to import a GFF or GTF file as a *TxDb* object.


# Bioconductor packages used in this document

* `r Biocpkg("txdbmaker")`

# How to load a gene model from a GFF or GTF file

We will use a small .gff3 file provided by the `r Biocpkg("txdbmaker")` package.

```{r, warning=FALSE, message=FALSE}
suppressPackageStartupMessages({
library(txdbmaker)
})

gff_file <- system.file("extdata", "GFF3_files", "a.gff3", package="txdbmaker")

txdb <- makeTxDbFromGFF(gff_file, format="gff3")
txdb

```


See `?makeTxDbFromGFF` in the `r Biocpkg("txdbmaker")` package for more information.

Extract the exon coordinates grouped by gene from this gene model:

```{r}

exonsBy(txdb, by="gene")


```


# Session info

<details>
<summary><b>
Click to display session info
</b></summary>
```{r}
sessionInfo()
```
</details>

Loading