Coder Social home page Coder Social logo

Comments (10)

lvclark avatar lvclark commented on August 19, 2024

Hi Paulo,

Just run library(VariantAnnotation) before running your script.

from polyrad.

PauloBaleeiro avatar PauloBaleeiro commented on August 19, 2024

Unfortunately it is still not working. It might be the GRanges and IRanges. I'm using the zipfile cataloge.vcf file generated by Stacks, but I cannot work out where the problem is. I tried running without "which=...", but it didn't work either.

from polyrad.

lvclark avatar lvclark commented on August 19, 2024

What error are you getting?

from polyrad.

PauloBaleeiro avatar PauloBaleeiro commented on August 19, 2024

Hi Lindsay,

This is the beginning of script followed by error:
myRAD <- VCF2RADdata("catalog.alleles.tsv.gz",

  •                  svparam = ScanVcfParam(fixed = "ALT", info = NA, geno = "AD",
    
  •                                         which = GRanges("06", IRanges(1, 937644))),
    
  •                  yieldSize = NA)
    

Error in h(simpleError(msg, call)) :
error in evaluating the argument 'object' in selecting a method for function 'samples': [internal] _hts_rewind() failed

from polyrad.

lvclark avatar lvclark commented on August 19, 2024

from polyrad.

PauloBaleeiro avatar PauloBaleeiro commented on August 19, 2024

Hi Clark,

I'm a bit stuck in the "object" to be used. In one of your scripts you show the following path:
VCF2RADdata(file, phaseSNPs = TRUE, tagsize = 80, refgenome = NULL,
tol = 0.01, al.depth.field = "AD", min.ind.with.reads = 200,
min.ind.with.minor.allele = 10, possiblePloidies = list(2),
taxaPloidy = 2L, contamRate = 0.001,
samples = VariantAnnotation::samples(VariantAnnotation::scanVcfHeader(file)),
svparam = VariantAnnotation::ScanVcfParam(fixed = "ALT", info = NA,
geno = al.depth.field,
samples = samples),
yieldSize = 5000, expectedAlleles = 5e+05, expectedLoci = 1e+05,
maxLoci = NA)

I'm not sure which VCF files to use. Would it be "populations.snps.vcf? or "populations.haps.vcf"?
And what about the catalog.alleles.tsv?
I have tried many ways, but none worked.

Cheers

from polyrad.

lvclark avatar lvclark commented on August 19, 2024

Hi Paulo,

That looks like the usage section of the VCF2RADdata documentation. The argument defaults are shown, and you don't have to type the arguments if you are okay with the defaults.

I haven't used Stacks in a long time. If your VCF looks like this:
https://github.com/galaxyproject/tools-iuc/blob/main/tools/stacks2/test-data/populations/populations.haps.vcf
it won't work because the AD field is not included. However one like this should work: https://github.com/galaxyproject/tools-iuc/blob/main/tools/stacks2/test-data/populations/populations.snps.vcf

Your code (in its simplest version) would look like:

mydata <- VCF2RADdata("populations.snps.vcf")

You don't need catalog.alleles.tsv if you are using VCF2RADdata. That file is only needed for readStacks.

Best,

Lindsay

from polyrad.

PauloBaleeiro avatar PauloBaleeiro commented on August 19, 2024
Screenshot 2023-07-11 at 1 06 59 pm This is mine. I'll try once again. Thanks

from polyrad.

lvclark avatar lvclark commented on August 19, 2024

Should be okay. I was concerned about the missing AD field for missing genotypes (./.) but did a quick test and polyRAD handles those appropriately. If you continue to have issues, please provide your code and a small dataset so that I can reproduce the problem on my own machine.

from polyrad.

lvclark avatar lvclark commented on August 19, 2024

That being said, you will have to lower the values for the min.ind.with.reads and min.ind.with.minor.allele arguments to VCF2RADdata since you have so few samples. polyRAD's genotyping algorithms may perform poorly on a sample size this small but you can use the naΓ―ve protocol shown in https://lvclark.r-universe.dev/articles/polyRADtutorials/population_genetics.html (just search the page for mydataNaive and follow that protocol for genotyping).

from polyrad.

Related Issues (15)

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.