Comments (4)
A good point. I’ll fix it.
On Jul 8, 2016, at 1:03 PM, Eric Sobel [email protected] wrote:
A trivial edge case issue: In either summarize() function if m = 0 (i.e., the SnpArray is empty), then each calculation of maf includes a divide by zero. I suggest simply making those statements conditional on m > 0.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub #4, or mute the thread https://github.com/notifications/unsubscribe/AEwHsSKr5U3uGSkADgIvTP2rwVqqXpV2ks5qTq0QgaJpZM4JIWhh.
from snparrays.jl.
One a second thought, the cases m=0 or a column having all missing genotypes do produce NaN for maf. Try
s = SnpArray(0, 5)
summarize(s)
gives
([NaN,NaN,NaN,NaN,NaN],Bool[false,false,false,false,false],[0,0,0,0,0],Int64[])
This is a sensible answer to me: maf cannot be calculated in these cases. Is this better to keep the current code?
from snparrays.jl.
I see your point. Of course if there are no genotypes, then which is the minor allele is also unknown (rather than the "allele2" implied by maf == NaN). I don't have a strong feeling about it, but I'd think with no genotypes, the minor (and the major) allele frequency should be 0.0 (since the count of alleles is zero), and the minor_allele boolean could be true or false. Edge cases certainly can be ambiguous. If you want to leave the code as is, I'm OK with that. (I've now rewritten Ken's code where he used summarize with a possibly empty SnpArray.)
from snparrays.jl.
I would follow the convention for regular array:
a = randn(0, 5)
mean(a)
produces
NaN NaN NaN NaN NaN
That means no change to the current summarize
functions, which output NaN
for maf
if input SnpArray has 0 rows or some columns have all missing genotypes.
from snparrays.jl.
Related Issues (20)
- feature request: copyto!(v, s) for SnpBitMatrix and SnpLinAlg HOT 8
- Breaking change from VectorizationBase.jl HOT 10
- how to subset the bed file based on individuals ID in Jupyter HOT 3
- SnpLinAlg broken for some data on master HOT 2
- A*x not correct if size(A, 1) % 4096 is 1, 2, or 3
- A*x not correct when impute = true
- No manifest.toml? HOT 3
- TagBot trigger issue HOT 11
- SnpArray view vs SnpArray.data matrix [question] HOT 3
- Linear algebra benchmarks are messed up HOT 1
- No Mmap option
- `SnpArrays.filter` `min_maf` keyword argument not working? HOT 5
- GRM factor HOT 3
- Linear Algebra is not actually parallel HOT 3
- different ways of constructing GRMs HOT 1
- LoopVectorization fails on some operations? HOT 3
- Out of memory with grm HOT 3
- Improved Tiling for Matrix-Vector Products HOT 8
- Support Absolute path for merge_plink HOT 1
- LoopVectorization deprecation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snparrays.jl.