Commit eefc0e4f authored by Chaos's avatar Chaos
Browse files

change the behavior of base_name()

parent 1f4e5301
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -487,7 +487,7 @@ rnaseqqc <- function(

	if(length(name) == 1){
		if(is.na(name)){
			name <- base_name(count_file,"ReadsPerGene.out.tab")
			name <- base_name(count_file,".ReadsPerGene.out.tab")
		}
	}

+2 −2
Original line number Diff line number Diff line
@@ -121,7 +121,7 @@ chaos_topdom <- function(
				as.data.table(
					single_result[[x]]
				)[
					,sample := base_name(hic_s,"hic")
					,sample := base_name(hic_s)
				][
					,normalization := toupper(nor_s)
				][
@@ -206,7 +206,7 @@ chaos_topdom_original <- function(
			as.data.table(
				single_result[[x]]
			)[
				,sample := base_name(hic_file,"hic")
				,sample := base_name(hic_file)
			][
				,normalization := toupper(normalization)
			][
+2 −2
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ txdb <- function(
	txdb_file <-	file.path(
						chaos_info("data_dir"),
						paste0(
							base_name(gtf_file,"gz"),
							base_name(gtf_file,".gz"),
							".txdb"
						)
					)
@@ -75,7 +75,7 @@ txdb <- function(
		chaos_info("data_dir") |> chaos_create_dir()
		txdb <-	gtf_file |>
				makeTxDbFromGFF(
					dataSource = base_name(gtf_file,"gz"),
					dataSource = base_name(gtf_file,".gz"),
					organism = organism,
					metadata = c("Genome",ref),
					chrominfo = chr_size(
+2 −2
Original line number Diff line number Diff line
@@ -21,12 +21,12 @@ base_name <- function(
	
			if(is.na(ext))
			{
				ext <- last_str(shortname)
				ext <- paste0(".",last_str(shortname))
			}
	
			shortname |>
			gsub(
				pattern = paste0(".",ext),
				pattern = ext,
				replacement = ""
			)
		}
+2 −2
Original line number Diff line number Diff line
@@ -222,8 +222,8 @@ wcpa_compare_plot <- function(
						max = 1.2,
						max_color = "#e64b35"
){
	if(is.na(control_name)){control_name <- base_name(control_hic,".hic")}
	if(is.na(observe_name)){observe_name <- base_name(observe_hic,".hic")}
	if(is.na(control_name)){control_name <- base_name(control_hic)}
	if(is.na(observe_name)){observe_name <- base_name(observe_hic)}

	control_matrix <- wcpa_matrix(
						control_hic,