chrX 10331 10331 0.00 0 3 3
chrX 10335 10335 100.00 3 0 3
chrX 10337 10337 100.00 3 0 3
chrX 10365 10365 100.00 3 0 3
我想把这48个文件合并起来,所用代码如下:
- #!~/miniconda2/bin/Rscript
- library(data.table)
- a = list.files("/public/home/05_sample_merge/00_normal")
- dir = paste("/public/home/05_sample_merge/00_normal/",a,sep="")
- n = length(dir)
- merge_data = fread(file = dir[1],sep="\t",header=TRUE)
- for (i in 2:n){
- new_data = fread(file = dir[i],sep="\t",header=TRUE)
- merge_data = merge(merge_data,new_data,by=c("Chr","Start","End"),all=TRUE)
- }
- fwrite(merge_data,file = "all_sample_raw_merge.txt",row.names=F)


雷达卡






京公网安备 11010802022788号







