Ensembl / WiggleTools

Basic operations on the space of numerical functions defined on the genome using lazy evaluators for flexibility and efficiency
Apache License 2.0
142 stars 24 forks source link

Skipping zeros when computing statistics over regions #94

Open IsaacDiaz026 opened 2 months ago

IsaacDiaz026 commented 2 months ago

Hello, Is there a way to exclude values of zero when computing summary statistics using apply_paste ? I understand that by default missing data is not counted in computing stats, but I would also like to exclude values of zero.

Thanks!

dzerbino commented 2 months ago

Hello @IsaacDiaz026 ,

If all your values are positive, you can use the gt 0 unary operator.

If you have negative values you wish to preserve, it would be more complicated. The abs operator could help but you would lose sign.

Hope this helps,

Daniel