Code Monkey home page Code Monkey logo

Comments (3)

kevinmneal avatar kevinmneal commented on May 23, 2024 1

Fixed this by adding a filter.common.markers arg to the tidy_vcf call in the function (lines 67-74):

  if (data.type == "vcf.file") {
    if (verbose) 
      message("Importing and tidying the VCF...")
    input <- radiator::tidy_vcf(data = data, strata = strata.df, 
      parallel.core = parallel.core, verbose = verbose, 
      whitelist.markers = whitelist.markers, filename = NULL, 
      vcf.metadata = vcf.metadata, vcf.stats = vcf.stats, 
      gt.vcf.nuc = TRUE, gt.vcf = TRUE, gt = TRUE, gt.bin = TRUE, 
      path.folder = path.folder, internal = TRUE, tidy.check = FALSE, filter.common.markers = filter.common.markers)
    biallelic <- radiator::detect_biallelic_markers(input)
  }

from radiator.

kevinmneal avatar kevinmneal commented on May 23, 2024

Somewhat related: I'm importing the vcf that was output from a previous run of filter_rad. It would probably be easier to just directly import the .rad that filter_rad produced, but I ran filter_rad without strata but now want them. Using tidy_genomic_data() on the vcf seemed like the easiest way to do this. Is there a way to import a tidy genomic file into R an apply a strata, or change strata on a tidy genomic object already in memory?

edit: I just tried using read_rad + read_strata + join_strata, but get an error when running join_strata.

>tidy.test <- read_rad(data="sphanorth124spatial.radiator.50pctmsng.oneSNPmac3.rad")
>strata.test <- read_strata(strata="sphanorth124spatial_popcoords_radiator_strata.txt")
>tidy.test2 <- join_strata(data=tidy.test,
>                        strata=strata.test)

Synchronizing data and strata...
Error in UseMethod("filter_") : 
  no applicable method for 'filter_' applied to an object of class "list"

from radiator.

thierrygosselin avatar thierrygosselin commented on May 23, 2024

about the strata, the reason you're getting an error is that the function read_strata return a list (doc).
It was an internal function that I was using to blacklist id, set levels, etc. Made it public, but but realize that the return object is not natural and you have to read the function. This might change in the future.

so you could try this to add or change existing strata.

old.tidy <- radiator::read_rad(data="sphanorth124spatial.radiator.50pctmsng.oneSNPmac3.rad")
new.strata <- radiator::read_strata(strata="sphanorth124spatial_popcoords_radiator_strata.txt") %$% strata
new.tidy <- radiator::join_strata(
    data = old.tidy,
    strata = new.strata
)

I've change the example in read_strata to make it more obvious.
This will be covered in the vignette

from radiator.

Related Issues (20)

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.