gussifinknottle
Programmer
I have a table that has 3 columns
Scaffold Position Pileup
-------- -------- ------
1 1 20
1 2 30
1 3 40
1 …
1 n 40
2 1 11
2 2 14
2 3 16
2 …
2 m 4
3 1 2
3 2 56
3 3 4
3 …
3 p 91
For every scaffold, I would like to be able to get a sum of the Pileup for a sliding window. The sliding window is taken as an input, can be anything between 1000 and 10000.
So for a sliding window of 1000, and for scaffold 1, pileups are to be summed for positions 1-1000, 1001-2000, ...., (n-999)-n. Similarly for scaffold 2, sums for positions 1-1000, 1001-2000, ...., (m-999)-m. Apriori I know what is the total number of positions for each scaffold and this can also be taken as an input if necessary.
Thanks for your help!
Anamika
Scaffold Position Pileup
-------- -------- ------
1 1 20
1 2 30
1 3 40
1 …
1 n 40
2 1 11
2 2 14
2 3 16
2 …
2 m 4
3 1 2
3 2 56
3 3 4
3 …
3 p 91
For every scaffold, I would like to be able to get a sum of the Pileup for a sliding window. The sliding window is taken as an input, can be anything between 1000 and 10000.
So for a sliding window of 1000, and for scaffold 1, pileups are to be summed for positions 1-1000, 1001-2000, ...., (n-999)-n. Similarly for scaffold 2, sums for positions 1-1000, 1001-2000, ...., (m-999)-m. Apriori I know what is the total number of positions for each scaffold and this can also be taken as an input if necessary.
Thanks for your help!
Anamika