Learn R Programming

LncFinder (version 1.1.5)

find_orfs: Find ORFs

Description

This function can find all the ORFs in one sequence.

Usage

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

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.

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

Author

HAN Siyu

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.

Examples

Run this code
### 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:
if (FALSE) {
### 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")
}

### 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)

Run the code above in your browser using DataLab