find_orfs: Find ORFs

Description Usage Arguments Details Value Author(s) Examples

View source: R/LncFinder.R

Description

This function can find all the ORFs in one sequence.

Usage

1
find_orfs(OneSeq, reverse.strand = FALSE, max.only = TRUE)

Arguments

OneSeq

Is one sequence. Can be a FASTA file read by package "seqinr" seqinr-package or just a string.

reverse.strand

Logical. Whether find ORF on the reverse strand. Default: FALSE

max.only

Logical. If TRUE, only the longest ORF will be returned. Default: TRUE

Details

This function can extract ORFs of one sequence. It returns ORF region, length and coverage of the longest ORF when max.only = TRUE or ORF region, start position, end position, length and coverage of all the ORFs when max.only = FALSE. Coverage is the the ratio of the ORF to transcript length. If reverse.strand = TRUE, ORF will also be found on reverse strand.

Value

If max.only = TRUE, the function returns a list which consists the ORF region (ORF.Max.Seq), length (ORF.Max.Len) and coverage (ORF.Max.Cov) of the longest ORF. If max.only = FALSE, the function returns a dataframe which consists all the ORF sequences.

Author(s)

HAN Siyu

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
### For one sequence:
OneSeq <- c("cccatgcccagctagtaagcttagcc")
orf.info_1 <- find_orfs(OneSeq, reverse.strand = TRUE, max.only = FALSE)

### For a FASTA file contains several sequences:
## Not run: 
### Use "read.fasta" function of package "seqinr" to read a FASTA file:
Seqs <- seqinr::read.fasta(file =
"http://www.ncbi.nlm.nih.gov/WebSub/html/help/sample_files/nucleotide-sample.txt")

## End(Not run)

### Or just try to use our data "demo_DNA.seq"
data(demo_DNA.seq)
Seqs <- demo_DNA.seq

### Use apply function to find the longest ORF:
orf.info_2 <- sapply(Seqs, find_orfs, reverse.strand = FALSE, max.only = FALSE)

LncFinder documentation built on Dec. 11, 2021, 9:39 a.m.