Skip to content
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

Running detectRUNS in draft assemblies #34

Open
micadiz opened this issue May 2, 2022 · 1 comment
Open

Running detectRUNS in draft assemblies #34

micadiz opened this issue May 2, 2022 · 1 comment

Comments

@micadiz
Copy link

micadiz commented May 2, 2022

Hi,

We have some issues running detectRUNs in SNP data generated from a draft assembly of a nonmodel genome.

When we execute the command summaryRuns, we obtain the following error:

Error in names(x) <- value : ‘names’ attribute [2] must be the same length as the vector [1]

We tried the workaround you described in issue #23 (replacing the chromosome names), but it didn’t work. We then realised that in issue #24 you mentioned that the function Froh_inbreeding could have issues when the input contains > 100 chromosomes (as in our case).

Diving in your source code, we saw that in line 121 of the file Stats.R you hardcoded the maximum number of chromosomes to 100 (chr_order <- c((0:99),“X”,“Y”,“XY”,“MT”,“Z”,“W”)). Still, the smallest chromosome id in our dataset is bigger than 99. Thus, after line 121, summaryRuns produces an empty list, and hence, the error mentioned above. Renaming the chromosomes is not a solution for us either as we have more than 100 scaffolds.

Would be a problem is we change line 121 to: c(0:max(sort(as.numeric(list_chr))), “X”,“Y”, “XY”, “MT”, “Z”, “W”)?, which makes the maximum number of chromosomes dependent on the input file.

Nevertheless, we are unsure if the change we propose will be effective as we don’t know if you also hardcoded the number of chromosomes in other files of your library.

Thanks

@bunop bunop added the bug label May 2, 2022
@bunop
Copy link
Contributor

bunop commented May 2, 2022

Dear @micadiz ,

Thank you for your interest in detectRUNS and reporting this: I'm not sure if your solution will apply in all cases, for example when chromosomes are textual. I think we have to change this in a more general way, and check if there are others magic values like this.

In the meantime, you could clone this repository locally, try to fix it for your case as suggested and the install this package from your local files.

Please, tell us if it work as expected

@bunop bunop added the question label May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants