thierrygosselin / assigner

Population assignment analysis using R
http://thierrygosselin.github.io/assigner
GNU General Public License v3.0
17 stars 6 forks source link

Syntax error #9

Closed ddrinan closed 7 years ago

ddrinan commented 7 years ago

Hi, I'm really excited about using assigner, but I keep getting an error when trying to run it. It seems to create 'fst.ranked_.tsv' and 'assignment_dataiteration_markers_10_no_imputation.txt" files, but then throws this error. I've run the file in genepop, so I'm relatively sure that it is formatted properly. I've also gotten a different genepop file to run through assigner without problems. Any insight on what might be holding up this file? Below is an example input file.

test.txt

Thanks, Dan Drinan

library(assigner) library(reshape2) library(ggplot2) library(stringr) library(stringi) library(plyr) library(dplyr) # load this package after plyr to work properly library(tidyr) library(readr) library(adegenet) library(randomForestSRC) library(doParallel) library(foreach) library(purrr) library(utils) library(iterators) library(stats) library(stackr)

my_data <-read.genepop("test.gen", ncode = 2) #save your genepop file as a genind object named mydata

Converting data from a Genepop .gen file to a genind object...

File description: #Title: removed loci with 3 alleles

...done.

mytidydata <- tidy_genomic_data(data = my_data) ####################################################################### ###################### stackr::tidy_genomic_data ###################### ####################################################################### Tidying the genind object ... Scanning for number of alleles per marker... Data is biallellic Generating vcf-style coding Erasing genotype: no Using markers common in all populations: Number of markers before = 50 Number of markers removed = 0 Number of markers after (common between populations) = 50 Removing monomorphic markers: yes Scanning for monomorphic markers... Number of markers before = 50 Number of monomorphic markers removed = 10 Number of markers after = 40 ############################### RESULTS ############################### Tidy data in your global environment Data format: tbl_df Biallelic data Number of common markers: 40 Number of chromosome/contig/scaffold: no chromosome info Number of individuals: 276 Number of populations: 8 Computation time: 0 sec ############################## completed ##############################

my_assignment <- assignment_ngs(mytidydata, #specify that your data file assignment.analysis = "gsi_sim", # specify that the analysis happens in gsi_sim sampling.method = "ranked", #specify that the assignment should happen using markers with high FST thl = 10, # specify that you want to use the training-holdout-leave one out assignment method. thl = 1, 1 individual sample is used as holdout. This individual is not participating in the markers ranking. iteration.method = 10, subsample = NULL,

iteration.subsample = 10,

common.markers = TRUE, marker.number = 10, verbose = TRUE, folder = NULL, keep.gsi.files = TRUE, random.seed = NULL, parallel.core = parallel::detectCores() - 1) ####################################################################### ###################### assigner::assignment_ngs ####################### ####################################################################### Assignment analysis with gsi_sim Map-independent imputations: no Folder: /home/dan/Dropbox (MERLAB)/Pacific_cod/cod_kristen/assigner/assignment_analysis_method_ranked_no_imputations_20170705@1527/ Scanning for monomorphic markers... Number of markers before = 40 Number of monomorphic markers removed = 0 Subsampling: not selected Conducting Assignment analysis with ranked markers Using thl method, ranking Fst with training samples... Holdout samples saved in your folder Starting parallel computations for the assignment analysis: ranked markers For progress: monitor activity in the folder... | | 0%, ETA NA sh: 1: Syntax error: "(" unexpected sh: 1: Syntax error: "(" unexpected sh: 1: Syntax error: "(" unexpected sh: 1: Syntax error: "(" unexpected sh: 1: Syntax error: "(" unexpected sh: 1: Syntax error: "(" unexpected sh: 1: Syntax error: "(" unexpected sh: 1: Syntax error: "(" unexpected sh: 1: Syntax error: "(" unexpected sh: 1: Syntax error: "(" unexpected

Compiling results Error in bindrows(x, .id) : 'getCharCE' must be called on a CHARSXP In addition: Warning message: In .assigner_parallel(X = iterations.list, FUN = assignment_ranking, : scheduled cores encountered errors in user code

ddrinan commented 7 years ago

FYI, I dug a little deeper into this and discovered that I had a '(' in the path where I was trying to write the output. Moving the output to a different directory fixed the problem.