bwringe / hybriddetective

13 stars 7 forks source link

Error with hybridPowerComp #7

Open btmartin721 opened 5 years ago

btmartin721 commented 5 years ago

Hello, I have a SNP dataset (ddRAD) that I am running your pipeline on. When I try to run hybridPowerComp on the "NH.Results" file with all simulation results directories from parallelnewhybrid in it, it gives the following error:

hybridPowerComp(dir = paste0(my_path, "/NH.Results/")) Calculating Accuracy

Error in data.frame(simulation = as.character(rownames(sumtable)), means = means, : arguments imply differing number of rows: 3, 4 In addition: Warning message: In apply(X = sumtable, MARGIN = 1, FUN = mean, na.rm = TRUE)/apply(X = sumtable2, : longer object length is not a multiple of shorter object length

However, if I leave only one of the results directories in NH.Results, it runs. Are we supposed to only run it with one of the simulation output directories? Or is this a bug?

I have attached one of the output JPEGs that the function generated with only one of the results directories within NH.Results

plot_1 .

Thanks for your time.

btmartin721 commented 5 years ago

I have made some progress with this issue. Something was wrong with two of the simulations. I ran 10 simulations X 3 replicates each, and S7 and S9 were the culprits. I have included the PofZ and individuals files for S7R1-3 below. I don't know why those particluar simulations wouldn't work.

Also, another issue I found was that when running at least 10 simulations, the hybridPowerComp function doesn't like the double digits in the filenames and directories because the filenames for S10R1, for e.g., are one character longer than the rest of them. This error is listed here:

Error in dimnames(x) <- dn : length of 'dimnames' [2] not equal to array extent

Finally, issue #3 is that when running more than 3 simulations, I get an error where Plots 30 and 31 won't be generated. But if I just have three simulations it works. That error is:

Error: Insufficient values in manual scale. 7 needed but only 3 provided.

Bad simulation files:

EAGU_purePops_300_Loci_Panel_1_individuals.txt EAGU_purePops_300_Loci_Panel_1_S7R1_NH.txt_PofZ.txt EAGU_purePops_300_Loci_Panel_1_individuals.txt EAGU_purePops_300_Loci_Panel_1_S7R2_NH.txt_PofZ.txt EAGU_purePops_300_Loci_Panel_1_individuals.txt EAGU_purePops_300_Loci_Panel_1_S7R3_NH.txt_PofZ.txt

bwringe commented 5 years ago

Hi Bradley,

Thank you for bringing this to our attention. We didn’t ever try running it with that many simulations. We generally used three as we found that there wasn’t a large amount of variation between simulations for the most part.

I had a quick look at the issue, and we might have a solution. We will put some code together tomorrow and send it to you to have you try out if you don’t mind. If it works, we can update the package.

Could you please send me an email at the address listed on the paper so we can send the test code to you?

Thanks for your help,

Brendan

btmartin721 commented 5 years ago

Hi Brendan,

Sure thing. I can try out the code. I'll send you an email. Thanks for your help as well.

-Bradley