Skip to content

Commit 18e4c67

Browse files
committed
change rename
1 parent 7dc0be1 commit 18e4c67

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

R/getAnnotationFiles.R

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,15 @@ getAnnotationFiles <- function(verbose = FALSE, vignette= FALSE) {
6262
bfcrpath(bfc, rids = c(rid,rid2))
6363

6464
path_out=base::file.path(bfcrpath(bfc, rids= rid))
65+
bed= sub("(.*)\\..*$", replacement = "\\1", basename(path_out))
66+
67+
#rename1=base::gsub('[[:digit:]].*', 'sorted.bed.gz', path_out)
68+
rename1=base::gsub(bed, 'sorted.bed.gz', path_out)
6569

66-
rename1=base::gsub('[[:digit:]].*', 'sorted.bed.gz', path_out)
6770

6871
path_tbi= base::file.path(bfcrpath(bfc, rids= rid2))
69-
rename2=base::gsub('[[:digit:]].*', 'sorted.bed.gz.tbi', path_tbi)
72+
tbi_p= sub("(.*)\\..*$", replacement = "\\1", basename(path_tbi))
73+
rename2=base::gsub(tbi_p, 'sorted.bed.gz.tbi', path_tbi)
7074

7175
if(!file.exists(rename1[1])){
7276
if( verbose )
@@ -105,12 +109,15 @@ getAnnotationFiles <- function(verbose = FALSE, vignette= FALSE) {
105109

106110
bfcrpath(example_bfc, rids = c(example_rid,example_rid2))
107111

112+
108113
example_path_out=base::file.path(bfcrpath(example_bfc, rids= example_rid))
114+
ex_bed= sub("(.*)\\..*$", replacement = "\\1", basename(example_path_out))
109115

110-
example_rename1=base::gsub('[[:digit:]].*', 'POLG.bed.gz', example_path_out)
116+
example_rename1=base::gsub(ex_bed, 'POLG.bed.gz', example_path_out)
111117

112118
example_path_tbi= base::file.path(bfcrpath(example_bfc, rids= example_rid2))
113-
example_rename2=base::gsub('[[:digit:]].*', 'POLG.bed.gz.tbi', example_path_tbi)
119+
ex_bed_tbi= sub("(.*)\\..*$", replacement = "\\1", basename(example_path_tbi))
120+
example_rename2=base::gsub(ex_bed_tbi, 'POLG.bed.gz.tbi', example_path_tbi)
114121

115122
if(!file.exists(example_rename1[1])){
116123
if( verbose )

0 commit comments

Comments
 (0)