find_orfs {LncFinder} | R Documentation |
Find ORFs
Description
This function can find all the ORFs in one sequence.
Usage
find_orfs(OneSeq, reverse.strand = FALSE, max.only = TRUE)
Arguments
OneSeq |
Is one sequence. Can be a FASTA file read by package "seqinr"
|
reverse.strand |
Logical. Whether find ORF on the reverse strand. Default: |
max.only |
Logical. If |
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
### 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)