Coder Social home page Coder Social logo

Comments (7)

thierrygosselin avatar thierrygosselin commented on August 17, 2024

Bonjour JB, je regarde le problème en fin de journée, heure du Québec.
merci!
Thierry

from stackr.

thierrygosselin avatar thierrygosselin commented on August 17, 2024

stackr v.0.4.6:
haplo2colony is now deprecated in favour of write_colony that uses more sophisticated codes that enables more input file formats. See the new version commit, or the function description for details.

try something simple first, with your batch_2.haplotypes.tsv directly (the function takes care of monomorphic markers. e.g.:

setwd("/media/XXX/")

test <- stackr::write_colony(data = "TRIM.haplotypes.tsv", strata = "you need a strata file here")

The strata file is described in the argument of the function write_colony, it's basically a STACKS population.map with headers.

Look at the new colony file in your working directory.
Try that one with COLONY if it works, then you can try out different argument parameters and imputations.

Cheers
Thierry

from stackr.

jblamyatifremer avatar jblamyatifremer commented on August 17, 2024

Dear Thierry,

I have tried your new stackR version, thanks for the quick response.

I got an error using your newest function write_colony (i provide my vcf and tsv file). I quickly look into your R code to find where the problem could come from... I did not find yet. I should spend more time on this (after 6 of december). Maybe you will be quicker.

I tried both type of input (.vcf and .tsv) with population map following the stack format. Below the outputs :

strataa <- read.table("/media/jean-baptiste/Passport0_5/002_PROJETS_CODES/RADSeq_HYSEA/14_reassignation/input/population_strata.csv", sep=",",stringsAsFactors = FALSE,header=TRUE)

write_colony("/media/jean-baptiste/Passport0_5/002_PROJETS_CODES/RADSeq_HYSEA/07_mendel_error_exploration/output/batch_2_3.vcf"

  •           , strata = strataa, pop.levels = NULL, pop.labels = NULL,
    
  •          blacklist.id = NULL, blacklist.genotype = NULL,
    
  •          whitelist.markers = NULL, monomorphic.out = TRUE, snp.ld = NULL,
    
  •          common.markers = TRUE, maf.thresholds = NULL, maf.pop.num.threshold = 1,
    
  •          maf.approach = "SNP", maf.operator = "OR", max.marker = NULL,
    
  •          sample.markers = NULL, pop.select = "all", allele.freq = "overall",
    
  •          inbreeding = 0, mating.sys.males = 0, mating.sys.females = 0,
    
  •          clone = 0, run.length = 1, analysis = 1, allelic.dropout = 0,
    
  •          error.rate = 0.02, print.all.colony.opt = FALSE,
    
  •          imputation.method = NULL, impute = "genotype",
    
  •          imputations.group = "populations", num.tree = 100, iteration.rf = 10,
    
  •          split.number = 100, verbose = TRUE,
    
  •          parallel.core = parallel::detectCores() - 1, filename = "/home/jean-baptiste/colony/colony2_v2.dat")
    

#######################################################################
######################## stackr::write_colony ########################
#######################################################################
File type: vcf.file
Importing data...
Error in if (biallelic > 4) { : missing value where TRUE/FALSE needed

write_colony("/media/jean-baptiste/Passport0_5/002_PROJETS_CODES/RADSeq_HYSEA/14_reassignation/input/TRIM.haplotypes.tsv"

  •           , strata = strataa, pop.levels = NULL, pop.labels = NULL,
    
  •          blacklist.id = NULL, blacklist.genotype = NULL,
    
  •          whitelist.markers = NULL, monomorphic.out = TRUE, snp.ld = NULL,
    
  •          common.markers = TRUE, maf.thresholds = NULL, maf.pop.num.threshold = 1,
    
  •          maf.approach = "SNP", maf.operator = "OR", max.marker = NULL,
    
  •          sample.markers = NULL, pop.select = "all", allele.freq = "overall",
    
  •          inbreeding = 0, mating.sys.males = 0, mating.sys.females = 0,
    
  •          clone = 0, run.length = 1, analysis = 1, allelic.dropout = 0,
    
  •          error.rate = 0.02, print.all.colony.opt = FALSE,
    
  •          imputation.method = NULL, impute = "genotype",
    
  •          imputations.group = "populations", num.tree = 100, iteration.rf = 10,
    
  •          split.number = 100, verbose = TRUE,
    
  •          parallel.core = parallel::detectCores() - 1, filename = "/home/jean-baptiste/colony/colony2_v2.dat")
    

#######################################################################
######################## stackr::write_colony ########################
#######################################################################
File type: haplo.file
Importing data...
Error in enc2utf8(col_names(col_labels, sep = sep)) :
argumemt is not a character vector

I juste change the extension from .tsv to .txt (the vcf file is to big) (Github only accepts conventional extensions

for attached files).

Cheers,
JB

PS : N'hesite pas à m'envoyer un MP si tu veux des precisions. Je peux t'envoyer le vcf sur filesender.
TRIM.haplotypes.txt

from stackr.

thierrygosselin avatar thierrygosselin commented on August 17, 2024

Ok send me the strata file please
I'll test your haplotypes file

from stackr.

jblamyatifremer avatar jblamyatifremer commented on August 17, 2024

from stackr.

thierrygosselin avatar thierrygosselin commented on August 17, 2024

Hi JB,

Try:

Test1: as mentioned above

test <- stackr::write_colony(data = "TRIM.haplotypes.tsv", strata = "you need a strata file here")

This works or not ?

Test2 with strata file already in the global environment:

strata <- readr::read_tsv(file = "strata.test.colony.tsv")
stackr::write_colony(data = "TRIM.haplotypes.txt", strata = strata)

This should also work

Comments

  • You don't have to specify the other arguments if your using the defaults.
  • Make sure you read carefully the argument of write_colony.
  • The argument pop.select:
    • the default value is pop.select = NULL
    • all is not an option.
    • you don't have any grouping, so leave it to the default so that write_colony takes care of it
    • however, if you need to specify a population use the save value as in your STRATA column.

Cheers
Thierry

from stackr.

jblamyatifremer avatar jblamyatifremer commented on August 17, 2024

Dear Thierry

Test1: as mentioned above
test <- stackr::write_colony(data = "TRIM.haplotypes.tsv", strata = "you need a strata file here")

My previous command was messy with non-existent option as you highlighted.
I was able to get colony input from the command above but Colony throw me an error (I do not have my linux station with me to reproduce the error message). Roughly, colony was complained about the format and the amount of data.

But i re-tried the same command with a ".vcf" from the same dataset (with the same strata file), No more error and Colony is still working on it.
That is good...

Tomorow, i tried again to get a colony input with stackr from the ".tsv" to figure out what is going on.

I also see that you are involved in Mapcomp... I will use it very soon. bravo for your work it is very usefull !

Test2 with strata file already in the global environment:
strata <- readr::read_tsv(file = "strata.test.colony.tsv")
stackr::write_colony(data = "TRIM.haplotypes.txt", strata = strata)

from stackr.

Related Issues (11)

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.