Dear all: I want to obtain chi-square statistics for following data by element wise. My apology to ask this statistical question from this community. However, my data contains list of overlap's significance score of 3 GRanges objects, I want to get its global score by element-wise. How can I get this in R?

# This is the data that I want to get its global score by element wise:

```
[[1]]
NumericList of length 7
[[1]] 1e-22
[[2]] 1e-19
[[3]] 1e-18
[[4]] 1e-16
[[5]] 1e-24
[[6]] 1e-20
[[7]] 1e-15
[[2]]
NumericList of length 7
[[1]] 1e-24
[[2]] 1e-24
[[3]] 1e-20
[[4]] 1e-25
[[5]] 0.1
[[6]] 1e-19
[[7]] 1e-18
[[3]]
NumericList of length 7
[[1]] 1e-11
[[2]] 1e-11
[[3]] 1e-10
[[4]] numeric(0)
[[5]] numeric(0)
[[6]] 1e-15
[[7]] numeric(0)
```

if you wonder third list element contains numeric(0), which refers to non-overlapped regions, so I can replace it with zero:

```
li.3 <- <- lapply(li.3, function(x) {
res <- ifelse(length(x)>0, x, 0)
})
```

# this is reproducible example :

```
data <- DataFrame(
v1=c(1e-22,1e-19,1e-18,1e-16,1e-24,1e-20, 1e-15),
v2=c(1e-24,1e-24,1e-20,1e-25,0.1,1e-19,1e-18),
v3=c(1e-11,1e-11,1e-10,numeric(0),numeric(0),1e-15,numeric(0)))
```

# my desired output something like (just example by element wise) :

```
global fisher score of `(1e-22, 1e-24, 1e-11)` = ?
global fisher score of `(1e-19, 1e-24, 1e-11)` = ?
...
global fisher score of `(1e-24, 1e-01, numeric(0))` = ?
```

I want to get global score by element wise. How can I get this in R? Alternatively, I also prefer to see fisher exact test result for above data. I will be grateful if anyone can give me any idea for doing this. Thanks a lot

Where are the GRanges objects?

Dear Giovanni M Dall'Olio:

I afraid it would be bit of long thread if I listed all step here (from finding overlap, conditionally filtering,expand them as GRanges), so I did not show reproducible step here. However, the data that I want to get global score is from the result of some sort of filtering by element-wise. so I have to make sure its geometric property of vector. To be specific, All I want to do is to get its global Fisher scores by element wise. To be clarify,

`v1`

refers to significant score of query, while`v2, v3`

are significance score (a.k.a, pvalueLog )of subjects (a.k.a, overlapped GRanges objects). I need to do element-wise operation to getting global score. I hope I would have some idea from this community.