-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathget_longest_transcript.Rd
More file actions
49 lines (45 loc) · 1.73 KB
/
Copy pathget_longest_transcript.Rd
File metadata and controls
49 lines (45 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{get_longest_transcript}
\alias{get_longest_transcript}
\title{Extract sequences of longest transcripts from a GTF file}
\usage{
get_longest_transcript(gtf_file = NULL, genome_file = NULL, output_file = NULL)
}
\arguments{
\item{gtf_file}{Path to a GTF annotation file.}
\item{genome_file}{Path to a reference genome file or BSgenome object .}
\item{output_file}{Path where the extracted transcript sequences will be saved.}
}
\value{
Writes the transcript sequences to the specified output file and longest transcript information.
}
\description{
This function extracts the sequences of the longest transcript for each gene from a GTF file
using a reference genome. It first loads the GTF file, selects the longest transcript for each gene
based on CDS and transcript length, and then extracts the corresponding sequences from the genome file.
}
\details{
The function follows these steps:
\enumerate{
\item Loads the GTF file using rtracklayer
\item Processes transcript information using prepareTransInfo()
\item For each gene, selects the longest transcript prioritizing CDS length first, then total transcript length
\item Filters the GTF to keep only the selected transcripts
\item Extracts sequences for the selected transcripts from the reference genome
}
}
\note{
This function requires the 'rtracklayer' package for importing GTF files and uses
the internal functions 'prepareTransInfo' and 'get_transcript_sequence'.
}
\examples{
\dontrun{
# Extract longest transcript sequences and save to output file
get_longest_transcript(
gtf_file = "path/to/annotation.gtf",
genome_file = "path/to/genome.fa",
output_file = "path/to/output/longest_transcripts.fa"
)
}
}