% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/retrieve_longest_isoforms.R
\name{retrieve_longest_isoforms}
\alias{retrieve_longest_isoforms}
\title{Retrieve the longest isoforms from a proteome file and save results as fasta file}
\usage{
retrieve_longest_isoforms(
  proteome_file,
  annotation_file,
  new_file,
  annotation_format = "gff"
)
}
\arguments{
\item{proteome_file}{file path to proteome in \code{fasta} file format.}

\item{annotation_file}{file path to the corresponding annotation file in \code{gtf} file format.}

\item{new_file}{file path to new file storing only peptide sequences of the longest isoforms.}

\item{annotation_format}{format of \code{annotation_file}. Options are:
\itemize{
\item \code{annotation_file = "gff"} (default)
\item \code{annotation_file = "gtf"} 
}}
}
\description{
Based on a fasta file storing the peptide isoforms of gene loci and
an annotation file in \code{gtf} file format, this function extracts the longest
isoform per gene locus and stores the results in a new \code{fasta} file.
This procedure enables easier downstream analyses such as orthology inference etc
when dealing with proteome \code{fasta} files which usually include isoform peptides.
}
\examples{
\dontrun{
# retrieve example data from ENSEMBLGENOMES
proteome <- biomartr::getProteome(db = "refseq", organism = "Arabidopsis thaliana")
annotation <- biomartr::getGFF(db = "refseq", organism = "Arabidopsis thaliana")
# retrieve longest isoforms and store in new file
retrieve_longest_isoforms(proteome_file = proteome, 
                          annotation_file = annotation, 
                          new_file = "Athaliana_pep_longest.fa")
# import new file into R session                          
Athaliana_pep_longest <- Biostrings::readAAStringSet("Athaliana_pep_longest.fa")
}
}
\author{
Hajk-Georg Drost
}
