-
Notifications
You must be signed in to change notification settings - Fork 4
Error in dimnames(x) <- dn : length of 'dimnames' [2] not equal to array extent #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@rsh249 Can you please elaborate on the directory structure you have? Are all the folders you are calling in aRchaic_prepare have CSV files in them? Since it works when you use the example directories, I would think the MFF format you have is fine. May be getting a better sense of the directory structure you have and how you are calling aRchaic_prepare would be helpful for me to answer. Thanks. |
@kkdey, the data I am testing are all in a single folder on my Desktop right now. I've tried other places but none work on my laptop or the server except in the archaic example data directories. The code I am using to call archaic_prepare is:
I've been digging into this a little bit more this morning. By running the code in archaic_prepare() line by line I have found that the problem arises because the indices variable inside that function is empty with my data. Since I'm not entirely sure what is going on with this part of the code I can't say if that's a problem per se. However, I solved the error by catching that instance before using the indices variable to filter the ancient_counts object. Since indices was empty, using:
fails. But replacing that with this:
works for me. Or, at least it let's me keep going through the aRchaic workflow and generate figures like the one attached. If these changes seem innocuous to the workflow then I could prepare a fork and submit a pull request. |
yes that indeed looks like a bug in the code, thanks for pointing it out. I have updated the script. Sorry for the inconvenience caused. |
I have a set of what I believe to be properly formatted mff files but aRchaic will not run when these are in a directory of their own. In that case I get an error when running archaic_prepare():
"Error in dimnames(x) <- dn :
length of 'dimnames' [2] not equal to array extent"
IF (and I don't know why this occurred to me to try) I put them in one of the example data folders (moderns or ancients) then I can run the model no problem but now my samples are labeled in the reference blocks so it's difficult to tell what's what.
I've looked at the code posted here for archaic_prepare() and found that this error tracks to the block of code starting on line 64, the section commented as "what if no .RData file is present and CSV files are present". The error itself occurs after line 116-120 is run and looking at the ancient_counts_filtered object is a matrix without columns so no column names can be assigned.
I would think it is something wrong with my data, but again these files work fine if they are placed in the aRchaic example directories.
Any help on resolving this will be appreciated.
Thanks!
The text was updated successfully, but these errors were encountered: