gcContent: Get GC content

Description Usage Arguments Value Examples

View source: R/sequence_features.R

Description

0.5 means 50

Usage

1
gcContent(seqs, fa = NULL)

Arguments

seqs

a character vector of sequences, or ranges as GRangesList

fa

fasta index file .fai file, either path to it, or the loaded FaFile, default (NULL), only set if you give ranges as GRangesList

Value

a numeric vector of gc content scores

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Here we make an example from scratch
seqName <- "Chromosome"
ORF1 <- GRanges(seqnames = seqName,
                   ranges = IRanges(c(1007, 1096), width = 60),
                   strand = c("+", "+"))
ORF2 <- GRanges(seqnames = seqName,
                    ranges = IRanges(c(400, 100), width = 30),
                    strand = c("-", "-"))
ORFs <- GRangesList(tx1 = ORF1, tx2 = ORF2)
# get path to FaFile for sequences
faFile <- system.file("extdata", "genome.fasta", package = "ORFik")
gcContent(ORFs, faFile)

ORFik documentation built on March 27, 2021, 6 p.m.