ukaraoz / microtrait

Other
26 stars 5 forks source link

Only output files produced from extract.traits.parallel #5

Closed GeoMicroSoares closed 1 year ago

GeoMicroSoares commented 2 years ago

Hi there @ukaraoz ,

Running extract.traits.parallel as in the README, I have the right .rds files written to the output directory, but microtrait_results is only composed by "tic", "toc" and "msg", meaning the unlist(mcapply and make.genomeset.results commands don't work after this.

Given the extract.traits.parallel outputs are generated, do you have an alternative to that command? I'm currently trying rds_files_in <- unlist(lapply(rds_files, readRDS)) on the list of output .rds files to obtain a list of lists of the contents in the .rds files. However, make.genomeset.results doesn't seem to like it:

> genomeset_results = make.genomeset.results(rds_files = rds_files_in,
+                                            ids = sub(".microtrait.rds", "", basename(rds_files)),
+                                            ncores = 10)
Synthesizing traits at granularity 1
Warning in UseMethod("nextElem") :
  closing unused connection 8 (<-localhost:11388)
Warning in UseMethod("nextElem") :
  closing unused connection 7 (<-localhost:11388)
Error in { : task 1 failed - "bad 'file' argument"

Do you have any suggestions? No idea why extract.traits.parallel would generate an incomplete output file (microtrait_results), but if you could let me know what to do to check. I'll also be available to provide any other info you need to try and sort this out.

Thanks in advance.

MarineBergot commented 1 year ago

probably too late but if it can help someone else, do :

rds_files = list.files(file.path(genomes_dir), full.names = T, recursive = F, pattern = ".microtrait.rds$") genomeset_results = make.genomeset.results(rds_files = rds_files, ids = sub(".microtrait.rds", "", basename(rds_files)), ncores = 2)

(you can of course change the nb of ncores) and that's it it worked !

ukaraoz commented 1 year ago

Hi, This was a typo in the README file. The current README file reflects the use of the current make.genomeset.results function.