Skip to content

Commit 05436f2

Browse files
committed
Fix issue TSV files (new dependencies requirements)
1 parent 558a87e commit 05436f2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

server.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,14 @@ shinyServer(function(input, output,session){
205205
#validate(
206206
# need(length(names(ff))<=20,"samplenumber"),errorClass="numberofsamples"
207207
#)
208-
system(paste0('cat ', new_ff[i]))
209208
return(read_vcfs_as_granges(new_ff,names(ff),ref_genome(),group = "auto+sex", check_alleles = TRUE))
210209
}
211210

212211
#TSV
213212
if (input$datatype=="TSV"){
214213

215214
ff_list<-list()
215+
new_ff_list = list()
216216
for (w in 1:length(inFile$datapath)){
217217
aux<-fread(inFile$datapath[w],header=T,sep="\t",data.table=F)
218218

@@ -227,10 +227,12 @@ shinyServer(function(input, output,session){
227227
aux$FILTER<-"PASS"
228228
aux<-aux[,c("#CHROM","POS","ID","REF","ALT","QUAL","FILTER")]
229229
ff_list[[w]]<-tempfile("tp",fileext=".vcf")
230+
new_ff_list[[w]] = do.call("c",lapply(sapply(ff_list[[w]],strsplit,"[.]"),paste,collapse="_new."))
230231
write.table(aux,file=ff_list[[w]],row.names=F,quote=F,sep="\t")
232+
system(paste0('echo "##fileformat=VCFv4.2" | cat - ',ff_list[[w]],' > ',new_ff_list[[w]]))
231233
}
232234

233-
ff<-do.call("c",ff_list)
235+
ff<-do.call("c",new_ff_list)
234236

235237
return(read_vcfs_as_granges(ff,inFile$name,ref_genome(),group = "auto+sex", check_alleles = TRUE))
236238
}

0 commit comments

Comments
 (0)