Output overlapping region after using function 'mean'
songxd17 opened this issue · 7 comments
Hi, I'm trying to calculate the average value of 4 input .bigwig files at every position, my code was like:
wiggletools mean f1.bw f2.bw f3.bw f4.bw
but the output contains some overlapping regions like this:
1 chr10 0 25000 0
2 chr10 0 35000 0
3 chr10 25000 30000 2
4 chr10 30000 50000 0
5 chr10 35000 40000 3.5
6 chr10 40000 45000 0
7 chr10 45000 50000 1
8 chr10 55000 60000 3
9 chr10 55000 60000 3
10 chr10 60000 65000 2.5
11 chr10 60000 65000 4
12 chr10 65000 70000 0
while what I expected was that all overlapping region across input files should be averaged and therefore returns a non-overlapping wig, could you tell me how to fix this? Thank you.
Dear @songxd17 ,
That is very odd, I would not have expected this.
What happens if you read each file separately with wiggletools, e.g.
wiggletools seek chr10 0 70000 f1.bw
wiggletools seek chr10 0 70000 f2.bw
etc...
Also, what happens if you read all files together as in:
wiggletools seek chr10 0 70000 mwrite_bg - f1.bw f2.bw f3.bw f4.bw
Finally, could you please tell me more about how you installed wiggletools?
Regards,
Daniel
Dear Daniel,
Thanks for your reply.
I tried one more time and there are still some duplicated regions in the output:
1 chr10 0 25000 0
2 chr10 0 25000 0
3 chr10 25000 30000 1
4 chr10 25000 30000 1
5 chr10 30000 50000 0
6 chr10 30000 35000 0
7 chr10 35000 40000 3.75
8 chr10 40000 45000 0.75
9 chr10 45000 50000 0
10 chr10 50000 55000 2
11 chr10 50000 55000 2
12 chr10 55000 60000 1.5
13 chr10 55000 60000 3
14 chr10 60000 65000 1.75
15 chr10 60000 65000 3.5
16 chr10 65000 80000 0.5
17 chr10 65000 75000 0.5
I tried run wiggletools seek chr10 0 70000
on each file:
f1:
chr10 0 50000 0.000000
chr10 50000 55000 4.000000
chr10 55000 60000 0.000000
chr10 60000 69999 2.000000
f2:
chr10 0 25000 0.000000
chr10 25000 30000 4.000000
chr10 30000 50000 0.000000
chr10 50000 55000 4.000000
chr10 55000 60000 6.000000
chr10 60000 65000 5.000000
chr10 65000 69999 0.000000
f3:
chr10 0 35000 0.000000
chr10 35000 40000 9.000000
chr10 40000 45000 2.000000
chr10 45000 50000 0.000000
chr10 50000 55000 4.000000
chr10 55000 60000 2.000000
chr10 60000 65000 6.000000
chr10 65000 69999 2.000000
f4:
chr10 0 25000 0.000000
chr10 25000 30000 4.000000
chr10 30000 35000 0.000000
chr10 35000 40000 6.000000
chr10 40000 45000 1.000000
chr10 45000 50000 0.000000
chr10 50000 55000 4.000000
chr10 55000 60000 10.000000
chr10 60000 65000 8.000000
chr10 65000 69999 0.000000
And I tried this :
wiggletools seek chr10 0 70000 mwrite_bg - f1.bw f2.bw f3.bw f4.bw
Could not recognize file format from suffix: mwrite_bg
I installed wiggletools from conda:
conda install wiggletools -c bioconda
Maybe it's the version problem?
Best regards,
Song
Hello @songxd17 ,
This is very curious. I tried to reproduce the bug, but was not successful. What do you get with:
conda list | grep wiggletools
Cheers,
Daniel
Hi Daniel,
conda list |grep wiggletools
wiggletools 1.2.3 hba6f200_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
Regards,
Song
Hello Song,
That version is quite old (more than 3 years old).
Could you please update your system with
conda update wiggletools
Then check the new version number and try again?
Regards,
Daniel
Hi Daniel,
I tried to use docker, and it works! This seems to be a pure version problem since the wiggletools version on my conda mirror is old.
Thanks for all your help!
Best regards,
Song
Hello Song,
Excellent, glad to hear it!
Best regards,
Daniel