Search
Question: Passing multiple arguments (like mapply) to the MAP-function in GenomicFiles.
1
9 months ago by
UCPH
maltethodberg60 wrote:

reduceByRange with iterate=TRUE is a great way to analyse a collection of large files on laptop.

Say I have a set of files and a set of ranges. In addition, for every file I have an additional variable, say a normalisation factor, that can't be calculated on each individual range/file combination.

For every call of MAP by reduceByRange, I would like to pass the appropriate normalisation factor to the calculation along with the file, in the same way you would call mapply on multiple parallel arguments (mapply(function, files, normalisationFactor)).

Is such a thing possible with GenomicFiles?

modified 9 months ago by Valerie Obenchain ♦♦ 6.5k • written 9 months ago by maltethodberg60
2
9 months ago by
Valerie Obenchain ♦♦ 6.5k
United States
Valerie Obenchain ♦♦ 6.5k wrote:

Unfortunately I don't think there is a straightforward way of doing this. There is no metadata per se associated with the files.

Valerie

I found a somewhat hacky workaround: If you have a named file list (i.e. named BigWigFileList) you can pass the the names to the files argument and use that as an index to retrieve correct values from additional lists or vectors in ...
Passing the index directly fails, since files must be a character or file-object.