我的三个子文件夹 folder1,folder2,folder3 中有许多名为tst.bam
的对象。我想合并每个子文件夹中存在的bam文件,并将合并的bam
文件命名为子文件夹名称(folder1.bam,folder2.bam,folder3.bam)。
命令是
java -jar picard.jar MergeSamFiles \
I=input_1.bam \
I=input_2.bam \
O=merged_files.bam
bam.dir<- c("folder1","folder2","folder3")
for (i in 1:length(folder1)){
all.bam.files <- list.files(folder1[i], pattern = "pairs.bam",full.names=T)
szFiles <- list.files(path = folder1[i],pattern = "_pairs.bam$",full.names = TRUE)
szNewFiles <- dQuote(szFiles)
NszFiles <- paste(paste("I=", szNewFiles, sep =""),collapse = " ",sep ="")
system(paste0("java -XX:ParallelGCThreads=5 -Djava.io.tmpdir=tmp/ -Xmx8g -jar picard.jar MergeSamFiles"), cat(c(NszFiles,"\n")), "O= ", paste(basename(folder1[i]),".bam", sep = ""))
}
收到错误
系统错误(paste0(“java -XX:ParallelGCThreads = 5 -Djava.io.tmpdir = tmp / -Xmx8g -jar.jar MergeSamFiles“),:'intern'必须为TRUE或FALSE
我知道这不是最好的做法,而是渴望看到优雅的方式。
答案 0 :(得分:3)
由于您似乎倾向于使用R处理bam文件,因此您可能对override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let imageURL = NSURL(string: "https://upload.wikimedia.org/wikipedia/commons/thumb/9/98/Angels_Stadium.JPG/1920px-Angels_Stadium.JPG")!
let task = NSURLSession.sharedSession().dataTaskWithURL(imageURL) { (data, response, error) in
guard error == nil, let data = data else { return }
let downloadedImage = UIImage(data: data)
dispatch_async(dispatch_get_main_queue()) {
self.imageView.image = downloadedImage
}
}
task.resume()
}
感兴趣。它和samtools一样快,因为它在后台运行samtools编译的C代码。
https://bioconductor.org/packages/release/bioc/html/Rsamtools.html
例如:
Rsamtools