Commit e74fed4b authored by Chaos's avatar Chaos
Browse files

modified gtf.R in R

parent 0ab056cf
Loading
Loading
Loading
Loading
+3 −10
Original line number Diff line number Diff line
@@ -13,13 +13,11 @@ chaos_anno <- function(organism,type = NA){

gtf <-	function(
			organism,
			type = NA,
			gtf_file = NA
			type = NA
){
	ref <- chaos_anno(organism,"ref")
	anno_v <- chaos_anno(organism,"anno_v")

	if(is.na(gtf_file)){
	gtf_file <- paste0(
					"~/Reference/",
					ref,
@@ -27,19 +25,14 @@ gtf <- function(
					anno_v,
					".annotation.gtf.gz"
				)
	}

	type.list <- c("gene","transcript","exon","CDS","start_codon","stop_codon","UTR","Selenocysteine")
	type <- type %>% .[. %in% type.list]

	if(length(type) == 0){
		type_str <- NULL
	}else{
	type_str <-	type.list %>% 
				.[. %in% type] %>%
					paste0(collapse = ".") %>% 
					paste0(".",.,".rds")
	}
				c("rds") %>%  
				paste0(".",.,collapse = ".")

	rds_file <-	paste0(
					chaos_info("data_dir"),