Commit 736bb9e2 authored by Aurelien Brionne's avatar Aurelien Brionne
Browse files

GenomeFeatures onattach

parent dd621ec6
......@@ -26,14 +26,14 @@ LazyData: TRUE
Author: Aurelien Brionne [aut, cre]
Maintainer: Aurelien Brionne <aurelien.brionne@inra.fr>
Repository: gitHub
RoxygenNote: 6.0.1
RoxygenNote: 6.1.1
Collate:
'GFF_att.R'
'overlapped_genome_features.R'
'Plot.R'
'onAttach.R'
'Table.R'
'genome_features.R'
'build_genome_features.R'
'genome_features_overlaps.R'
'onAttach.R'
'readPeakFile.R'
......@@ -28,7 +28,5 @@
if(!base::all(check)){
if (!requireNamespace("BiocManager")) install.packages("BiocManager")
BiocManager::install(toinstall[!check],dependencies=TRUE)
}
}
......@@ -5,7 +5,7 @@
#' @importFrom GenomicRanges GRanges
#' @importFrom IRanges IRanges
#' @param file peak file path.
#' @details This function read peaks coordinates file (bed file) and store the results in a \code{\link[GenomicRanges::]{GRanges}} object.
#' @details This function read peaks coordinates file (bed file) and store the results in a \code{\link[GenomicRanges]{GRanges}} object.
#' @return a \code{\link[GenomicRanges]{GRanges}} object.
#' @examples
#' ###################
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/GFF_att.R
\name{GFF_att}
\alias{GFF_att}
\title{Extract attributes from gff.}
\usage{
GFF_att(..., att.list = c("GeneID", "Name", "gene"))
}
\value{
a \code{\link[data.table]{data.table}}.
}
\description{
Extract attributes from gff file \code{\link[data.table]{data.table}}.
}
\details{
This internal function is use by \code{\link{build_genome_features}} in order to extract attributes from gff
and return a \code{\link[data.table]{data.table}}.
}
\keyword{internal}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Plot.R
\name{Plot}
\alias{Plot}
\title{Plot overlapped_genome_features graphs.}
\usage{
Plot(object, type)
}
\arguments{
\item{object}{an \code{\link{overlapped_genome_features-class}} object.}
\item{type}{a \code{\link[base]{character}} which coulde be "bar" or "line".}
}
\value{
a \code{\link[plotly]{plot_ly}} object.
}
\description{
Plot overlapped_genome_features graphs bar or line.
}
\details{
This method is a simple accessor to the stored \code{\link[plotly]{plot_ly}} bar or line plots from the \code{\link{overlapped_genome_features-class}} object.
}
\examples{
###################
# display bar plot
GenomeFeatures::Plot(features_overlaps,"bar")
###################
# display bar plot
GenomeFeatures::Plot(features_overlaps,"line")
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Table.R
\name{Table}
\alias{Table}
\title{extract the annotation table.}
\usage{
Table(object)
}
\arguments{
\item{object}{an \code{\link{overlapped_genome_features-class}} object.}
}
\value{
a \code{\link[data.table]{data.table}} object.
}
\description{
extract the annotation table from an \code{\link{overlapped_genome_features-class}} object.
}
\details{
This method is a simple accessor to the stored genomic coordinates annnotation \code{\link[data.table]{data.table}}
from an \code{\link{overlapped_genome_features-class}} object.
}
\examples{
###################
annot<-GenomeFeatures::Table(features_overlaps)
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/build_genome_features.R
\name{build_genome_features}
\alias{build_genome_features}
\title{build a convenient genomic features object.}
\usage{
build_genome_features(txdb, features = base::c("promoter", "UTR5", "UTR3",
"exon", "intron", "cds", "downstream"),
parameters = base::list(promoter_ranges = base::list(upstream = 3000,
downstream = 500), downstream_range = 1000))
}
\arguments{
\item{txdb}{a txdb database built with \pkg{GenomicFeatures} (see example).}
\item{features}{a \code{\link[base]{vector}} of features \code{\link[base]{character}} with by
default all the availables features ("promoter", "UTR5", "UTR3", "exon", "intron", "cds", and "downstream").}
\item{parameters}{a \code{\link[base]{list}} of parameters to use in order to define promoter and
downstream ranges distance to TSS (Transcript Start Site) or TES (Transcript End Site).
\itemize{
\item{promoter_ranges: a \code{\link[base]{list}} with upstream and dowstream elements distance (in base) to TSS}.
\item{downstream_range: the dowstream distance (in base) to the TES}.
}}
}
\value{
a \code{\link{genome_features-class}} object.
}
\description{
build a convenient \code{\link{genome_features-class}} object needed for find overlaps beetween
selected features and genomic coordinates in a single step.
}
\details{
This method build a convenient \code{\link{genomic_features-class}} object, in order to be used for finding overlaps beetween
all selected features and genomic coordinates with the \code{\link{genome_features_overlaps}} method.
}
\examples{
###################
utils::download.file("ftp://ftp.ncbi.nlm.nih.gov/genomes/Gallus_gallus/GFF/ref_Gallus_gallus-5.0_top_level.gff3.gz",
quiet=T,destfile = "galGal5_gff.gz")
##################
# uncompress the file
R.utils::gunzip("galGal5_gff.gz")
###################
# build the database
toplevel=GenomicFeatures::makeTxDbFromGFF(
file="galGal5_gff",
format="gff",
organism="Gallus gallus",
taxonomyId=9031,
dbxrefTag="ID"
)
###################
# build genome_features object from txdb
features<-GenomeFeatures::build_genome_features(
toplevel,
features=base::c("promoter","UTR5","UTR3","exon","intron","cds","downstream"),
parameters = base::list(
promoter_ranges=base::list(
upstream=3000,
downstream=500
),
downstream_range=1000
)
)
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/genome_features.R
\docType{class}
\name{genome_features-class}
\alias{genome_features-class}
\title{genome_features class object definition.}
\description{
This class is invoked by \code{\link{build_genome_features}} method in order to store for each features
a \code{\link[base]{list}} with \code{\link[GenomicRanges]{GRanges}} and \code{\link[data.table]{data.table}} elements.
}
\section{Slots}{
\describe{
\item{\code{metadata}}{a \code{\link[base]{list}} with provided txdb \code{\link[AnnotationDbi]{metadata}}.}
\item{\code{promoter}}{a \code{\link[base]{list}} with \code{\link[GenomicRanges]{GRanges}} and \code{\link[data.table]{data.table}} elements.}
\item{\code{UTR5}}{a \code{\link[base]{list}} with \code{\link[GenomicRanges]{GRanges}} and \code{\link[data.table]{data.table}} elements.}
\item{\code{exon}}{a \code{\link[base]{list}} with \code{\link[GenomicRanges]{GRanges}} and \code{\link[data.table]{data.table}} elements.}
\item{\code{intron}}{a \code{\link[base]{list}} with \code{\link[GenomicRanges]{GRanges}} and \code{\link[data.table]{data.table}} elements.}
\item{\code{cds}}{a \code{\link[base]{list}} with \code{\link[GenomicRanges]{GRanges}} and \code{\link[data.table]{data.table}} elements.}
\item{\code{UTR3}}{a \code{\link[base]{list}} with \code{\link[GenomicRanges]{GRanges}} and \code{\link[data.table]{data.table}} elements.}
\item{\code{downstream}}{a \code{\link[base]{list}} with \code{\link[GenomicRanges]{GRanges}} and \code{\link[data.table]{data.table}} elements.}
\item{\code{gff}}{a \code{\link[data.table]{data.table}} with the gff.}
}}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/genome_features_overlaps.R
\name{genome_features_overlaps}
\alias{genome_features_overlaps}
\title{find overlaps between genomic coordinates and features.}
\usage{
genome_features_overlaps(peaks, features, figs_path = "./data/figs/",
ignore.strand = T)
}
\arguments{
\item{peaks}{a \code{\link[base]{list}} of \code{\link[GenomicRanges]{GRanges}} objects elements provided by \code{\link{readPeakFile}}.}
\item{features}{a \code{\link[base]{vector}} of features \code{\link[base]{character}} with by
default all tha availables features ("promoter", "UTR5", "UTR3", "exon", "intron", "cds", and "downstream").}
\item{figs_path}{the path where print the \code{\link[UpSetR]{upstet}} plots. ("./data/figs/", by default).}
\item{ignore.strand}{ignore peak coordinate orientation (defaul to TRUE).}
}
\value{
an \code{\link{overlapped_genome_features-class}} object.
}
\description{
find overlaps between genomic coordinates and features, and store results in an \code{\link{overlapped_genome_features-class}} object.
}
\details{
This method build a convenient genomic features object, in order to be used for finding overlaps beetween
all needed features and peaks coordinates with \code{\link{genome_features_overlaps}}.
}
\examples{
###################
features_overlaps<-GenomeFeatures::genome_features_overlaps(
peaks,
features,
figs_path="./data/output/",
ignore.strand = T
)
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/overlapped_genome_features.R
\docType{class}
\name{overlapped_genome_features-class}
\alias{overlapped_genome_features-class}
\title{overlapped_genome_features class object definition.}
\description{
This class is invoked by \code{\link{genome_features_overlaps}} method in order to store
the genomic coordinates annotation \code{\link[data.table]{data.table}}, and features distribution
\code{\link[data.table]{data.table}} and \code{\link[plotly]{plot_ly}}.
}
\section{Slots}{
\describe{
\item{\code{annotation}}{a \code{\link[data.table]{data.table}}.}
\item{\code{distribution}}{a \code{\link[base]{list}} with \code{\link[data.table]{data.table}} and \code{\link[plotly]{plot_ly}} elements.}
}}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/readPeakFile.R
\name{readPeakFile}
\alias{readPeakFile}
\title{Read peakfile}
\usage{
readPeakFile(file)
}
\arguments{
\item{file}{peak file path.}
}
\value{
a \code{\link[GenomicRanges]{GRanges}} object.
}
\description{
This function is use to read peaks file, also known bed file, with genomic coordinates (chr, start, end, strand),
and to convert it in \code{\link[GenomicRanges]{GRanges}} object.
}
\details{
This function read peaks coordinates file (bed file) and store the results in a \code{\link[GenomicRanges::]{GRanges}} object.
}
\examples{
###################
# read peak file (package sample from NCBI)
peaks<-GenomeFeatures::readPeakFile(
base::system.file(
"extdata/data/input/NCBI_sample.bed",
package="GenomeFeatures"
)
)
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment