GithubHelp home page GithubHelp logo

vcfcomp returns NAs about vcfppr HOT 3 CLOSED

kiran-lee avatar kiran-lee commented on June 6, 2024
vcfcomp returns NAs

from vcfppr.

Comments (3)

kiran-lee avatar kiran-lee commented on June 6, 2024 1

Thank you so much for our email discussion troubleshooting my NAs.

We realised this was due to missing genotypes in the "truth" vcf file. Removing missing genotypes in the "truth" dataset beforehand produced a sensible r2 value. This was the script used:

library(vcfppR)

truth <- vcftable("x.vcf.gz", setid = T, info = F)
test <- vcftable("y.vcf.gz", setid = T, format = "DS", info = F)

N <- 22 ### number of samples is 22
truth$gt <- truth$gt[,1:N]
truth$samples <- test$samples[1:N]

remove sites with genotypes being NA in truth

w <- which(!is.na(rowSums(truth$gt)))
truth$gt <- truth$gt[w,]
truth[2:9] <- lapply(truth[2:9], function(a) a[w])
saveRDS(truth, file = "truth.rds")

names <- truth$samples[1:22]
samples <- paste0(names, collapse = ",")

res <- vcfcomp(test = "y.vcf.gz" ,
truth = "truth.rds",
stats = "r2",
names = names,
samples = samples,
bins = c(0,1))

str(res)
res

from vcfppr.

Zilong-Li avatar Zilong-Li commented on June 6, 2024

Hi Kiran,

I think the input region is not valid, which should be in the form of chr:start-end, or just chr.

I'll add validators for the input in next release. Thanks for the feedback.

from vcfppr.

Zilong-Li avatar Zilong-Li commented on June 6, 2024

Also make sure the af.tsv is valid, which should have a header line and five columns. If the af is calculated from the truth file, you can just make vcfcomp doing the job by ignoring the af option ie af=NULL

from vcfppr.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.