diff --git a/DESCRIPTION b/DESCRIPTION index e9d6727..d889706 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: FLAMES Title: FLAMES: Full Length Analysis of Mutations and Splicing in long read RNA-seq data -Version: 2.1.4 +Version: 2.1.5 Date: 2023-03-27 Authors@R: c( person("Luyi", "Tian", role=c("aut"), diff --git a/NAMESPACE b/NAMESPACE index be9bf91..93a15be 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -22,7 +22,6 @@ export(get_GRangesList) export(get_coverage) export(minimap2_align) export(minimap2_realign) -export(parse_gff_tree) export(plot_coverage) export(plot_demultiplex) export(plot_isoform_heatmap) diff --git a/R/find_isoform.R b/R/find_isoform.R index 600bd66..abeb28b 100644 --- a/R/find_isoform.R +++ b/R/find_isoform.R @@ -94,8 +94,6 @@ find_isoform_bambu <- function(annotation, genome_fa, genome_bam, outdir, config file.remove(bambuTempAnnot); } - # isoform_objects <- list(transcript_dict = NULL, transcript_dict_i = parse_gff_tree(isoform_gtf)$transcript_dict) - # isoform_objects } #' @importFrom reticulate import_from_path @@ -144,6 +142,7 @@ find_isoform_flames <- function(annotation, genome_fa, genome_bam, outdir, confi #' Fake stranded GFF file #' @description Check if all the transcript in the annotation is stranded. If not, convert to '+'. +#' @return Path to the temporary file with unstranded transcripts converted to '+'. #' @keywords internal fake_stranded_gff <- function(gff_file) { # check if all the transcript in the annotation is stranded diff --git a/R/parse_gene_anno.R b/R/parse_gene_anno.R deleted file mode 100755 index 2b01d46..0000000 --- a/R/parse_gene_anno.R +++ /dev/null @@ -1,42 +0,0 @@ -#' Parse Gff3 file -#' -#' @description -#' Parse a Gff3 file into 3 components: chromasome to gene name, a transcript dictionary, a gene to transcript dictionary -#' and a transcript to exon dictionary. -#' These components are returned in a named list. -#' -#' @param gff_file the file path to the gff3 file to parse -#' @return a named list with the elements -#' "chr_to_gene", "transcript_dict", "gene_to_transcript", "transcript_to_exon", containing -#' the data parsed from the gff3 file. -#' @importFrom reticulate import_from_path -#' @importFrom basilisk basiliskRun -#' -#' @examples -#' temp_path <- tempfile() -#' bfc <- BiocFileCache::BiocFileCache(temp_path, ask = FALSE) -#' file_url <- -#' "https://raw.githubusercontent.com/OliverVoogd/FLAMESData/master/data" -#' gff <- bfc[[names(BiocFileCache::bfcadd(bfc, "GFF", paste(file_url, "SIRV_isoforms_multi-fasta-annotation_C_170612a.gtf", sep = "/")))]] -#' \dontrun{parsed_gff <- parse_gff_tree(gff)} -#' @export -parse_gff_tree <- function(gff_file) { - ret <- basiliskRun(env = flames_env, fun = function(args) { - python_path <- system.file("python", package = "FLAMES") - parse <- - reticulate::import_from_path("parse_gene_anno", python_path) - - ret <- parse$parse_gff_tree(gff_file) - names(ret) <- - c( - "chr_to_gene", - "transcript_dict", - "gene_to_transcript", - "transcript_to_exon" - ) - - ret - }, args = args) - - ret -} diff --git a/R/sc_long_pipeline.R b/R/sc_long_pipeline.R index b6cd261..edd7de3 100644 --- a/R/sc_long_pipeline.R +++ b/R/sc_long_pipeline.R @@ -464,6 +464,7 @@ create_sce_from_dir <- function(outdir, annotation, quantification = "FLAMES") { #' Assumes rownames are transcript_ids #' Assumes transcript_id is present in the annotation file #' @importFrom SummarizedExperiment rowRanges rowRanges<- +#' @return a \code{SummarizedExperiment} object with rowRanges added #' @keywords internal addRowRanges <- function(sce, annotation, outdir) { if (is.null(S4Vectors::metadata(sce)$OutputFiles)) { diff --git a/man/addRowRanges.Rd b/man/addRowRanges.Rd index 07eac90..fa5076b 100644 --- a/man/addRowRanges.Rd +++ b/man/addRowRanges.Rd @@ -8,6 +8,9 @@ Assumes transcript_id is present in the annotation file} \usage{ addRowRanges(sce, annotation, outdir) } +\value{ +a \code{SummarizedExperiment} object with rowRanges added +} \description{ Add rowRanges by rownames to \code{SummarizedExperiment} object Assumes rownames are transcript_ids diff --git a/man/fake_stranded_gff.Rd b/man/fake_stranded_gff.Rd index c94ea68..9dadd4b 100644 --- a/man/fake_stranded_gff.Rd +++ b/man/fake_stranded_gff.Rd @@ -6,6 +6,9 @@ \usage{ fake_stranded_gff(gff_file) } +\value{ +Path to the temporary file with unstranded transcripts converted to '+'. +} \description{ Check if all the transcript in the annotation is stranded. If not, convert to '+'. } diff --git a/man/parse_gff_tree.Rd b/man/parse_gff_tree.Rd deleted file mode 100755 index 3898bad..0000000 --- a/man/parse_gff_tree.Rd +++ /dev/null @@ -1,29 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/parse_gene_anno.R -\name{parse_gff_tree} -\alias{parse_gff_tree} -\title{Parse Gff3 file} -\usage{ -parse_gff_tree(gff_file) -} -\arguments{ -\item{gff_file}{the file path to the gff3 file to parse} -} -\value{ -a named list with the elements -"chr_to_gene", "transcript_dict", "gene_to_transcript", "transcript_to_exon", containing -the data parsed from the gff3 file. -} -\description{ -Parse a Gff3 file into 3 components: chromasome to gene name, a transcript dictionary, a gene to transcript dictionary -and a transcript to exon dictionary. -These components are returned in a named list. -} -\examples{ -temp_path <- tempfile() -bfc <- BiocFileCache::BiocFileCache(temp_path, ask = FALSE) -file_url <- - "https://raw.githubusercontent.com/OliverVoogd/FLAMESData/master/data" -gff <- bfc[[names(BiocFileCache::bfcadd(bfc, "GFF", paste(file_url, "SIRV_isoforms_multi-fasta-annotation_C_170612a.gtf", sep = "/")))]] -\dontrun{parsed_gff <- parse_gff_tree(gff)} -} diff --git a/pkgdown/_pkgdown.yml b/pkgdown/_pkgdown.yml index 2fdf86f..725de34 100644 --- a/pkgdown/_pkgdown.yml +++ b/pkgdown/_pkgdown.yml @@ -72,7 +72,6 @@ reference: - filter_annotation - get_GRangesList - demultiplex_sockeye - - parse_gff_tree - scmixology_lib10 - scmixology_lib10_transcripts - scmixology_lib90