So I’ve created an object of 12 binary files. As part of the analysis that I want to do, I compare one of the 12 against the other 11, using functions to do some analysis.
i.e.
In loop one, object$1 compared against object$1 2:12,
loop two, object$2 against object$ 1,3:12
…
loop 12, object$12 against object$1[1:11]
I can do it on a small scale manually, by specifying the file names. But as it involves comparing all 12 against each other, and I have many groups of 12 files (250 files in total) to work ok, how I automate this?
The eventual output is a data frame, so I’d like that to be created in each loop too (with the relevant file name, like object$1.csv or something).
firstbatch <-bams[1:12] #bams is character vector of the files
bedfile <- "filename.bed"
my.counts <- getBamCounts(bed.file = bedfile, bam.files = firstbatch) #creates object
my.test <- firstbatch$1
my.ref.samples <- firstbatch$2...firstbatch$12
series of functions comparing $1 against 2:12
maybe you cold use this procedure :