calculate_gc_content | R Documentation |
Computes the GC content percentage for exons or introns using genome sequence data from a BSgenome object.
calculate_gc_content(input, genome, verbose = TRUE)
input |
A data frame containing genomic features (exons/introns) with |
genome |
A BSgenome object representing the reference genome (e.g., |
verbose |
A logical indicating whether to print progress messages. Defaults to |
This function extracts the DNA sequence for each feature using genomic coordinates, then calculates the proportion of G and C nucleotides. Requires a BSgenome package for the relevant genome.
The input data frame with an additional gc_content
column containing GC percentages for each feature.
library(BSgenome.Hsapiens.UCSC.hg38)
file_v1 <- system.file("extdata", "gencode.v1.example.gtf.gz", package = "GencoDymo2")
gtf_v1 <- load_file(file_v1)
gtf_with_gc <- calculate_gc_content(gtf_v1, genome = BSgenome.Hsapiens.UCSC.hg38, verbose = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.