I have a list of bigwig files from different data sets. We would like to create a table of all the genomic positions per chromosome to be able to compare the samples with each other.
As the peaks found in each samples are at different chromosomal positions, I would like to complete each chromosomes and add all the positions which have no reads with a 0. As an example
this is my file:
variableStep chrom=chrV 86 1.00 87 1.00 88 1.00 89 1.00 90 1.00 .... variableStep chrom=chrII 1 2.00 2 2.00 3 2.00 4 3.00 5 4.00
In this sample I would like for Chr V to add positions 1-85 with a 0.
And than split the bigwig file into separate chromosomes and creates a data.frame for each ofthe chromosomes.
I know it is possible to read bigwig files into R using rtracklayer and also to subset them per chromosome. What I don't know is if it is possible to add the empty positions into the GRanges object created from the bigwig file.
I was thinking about it a bit longer now and was wondering if it is possible to create a GRangeList object from all samples and than modify it within this object so that I can modify all samples at once and than reduce the list into a data.frame for the separate chromosomes