-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgetOccupancyGenome.Rd
More file actions
64 lines (56 loc) · 1.94 KB
/
Copy pathgetOccupancyGenome.Rd
File metadata and controls
64 lines (56 loc) · 1.94 KB
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/implementation-genome.R
\name{getOccupancyGenome}
\alias{getOccupancyGenome}
\title{Compute Read Occupancy on the Genome}
\usage{
getOccupancyGenome(
bam_file = NULL,
gene_name = NULL,
features = NULL,
total_reads = NULL,
assignment_mode = NULL,
coordinate_to_trans = FALSE,
return_all_position = FALSE
)
}
\arguments{
\item{bam_file}{Character. Path to the BAM file.}
\item{gene_name}{Character. The gene name for which read occupancy is extracted.}
\item{features}{A \code{data.frame} or \code{GRanges} object containing transcript annotation.}
\item{total_reads}{Numeric. The total number of mapped reads (for RPM normalization).}
\item{assignment_mode}{Character. Specifies the read assignment strategy: \code{"end5"} (5' end) or \code{"end3"} (3' end).}
\item{coordinate_to_trans}{Logical. Whether to convert genomic coordinates to transcript
coordinates. Default is FALSE.}
\item{return_all_position}{Logical; if \code{TRUE}, extracts data for \strong{all mapped regions},
not just the specified gene (default: \code{FALSE}).}
}
\value{
A \code{data.frame} with read occupancy information:
\itemize{
\item \code{rname}: Transcript and gene identifier (\code{"transcript_id|gene_name"}).
\item \code{pos}: Transcriptomic read position.
\item \code{count}: Number of reads at the position.
\item \code{rpm}: Reads per million (RPM) normalized occupancy.
}
}
\description{
The \code{getOccupancyGenome()} function extracts read positions from a BAM file
for a given gene, converts them to transcriptome positions, and calculates
normalized read occupancy (RPM).
}
\examples{
\dontrun{
bam_file <- "example.bam"
gene <- "TP53"
total_mapped_reads <- 1e7
features <- prepareTransInfo_forGenome(gtf_file = "example.gtf")
occupancy_data <- getOccupancyGenome(
bam_file = bam_file,
gene_name = gene,
features = features,
total_reads = total_mapped_reads
)
head(occupancy_data)
}
}