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

Error in dplyr::bind_rows(): ! Can't combine ..1$X35 <double> and ..9$X35 <character>. #92

Closed
HajkD opened this issue Jun 18, 2023 · 1 comment

Comments

@HajkD
Copy link
Member

HajkD commented Jun 18, 2023

Message from Pablo FRESIA, PhD:

Hi Hajk,
I am trying to download a set of genomes from NCBI based on txid.

library(biomartr)
organisms <- c("9606", "10090", "10116")
class(organisms)
[1] "character"
getGenomeSet(db="refseq", organisms, reference=F, release=NULL, clean_retrieval=T, gunzip=T, update=F, path="genomes-by-txid", assembly_type="toplevel")
Starting genome retrieval of the following genomes: 9606, 10090, 10116 ...
Starting genome retrieval of '9606' from refseq ...

It seems that this is the first time you run this command for refseq.
Thus, 'assembly_summary.txt' files for all kingdoms will be retrieved from refseq. 
Don't worry this has to be done only once if you don't restart your R session.

Error in `dplyr::bind_rows()`:                                                                                     
! Can't combine `..1$X35` <double> and `..9$X35` <character>.
Run `rlang::last_trace()` to see where the error occurred.

I couldn't solve this error, didn't find anything that helps me on the web. Appreciate any help from your side!

Thanks in advance!
Best,
pablo

@HajkD
Copy link
Member Author

HajkD commented Jun 18, 2023

Hi Pablo,

Thank you so much for letting me know!

The issue was that the assembly file for viruses (column X35) has the total_gene count stored as character while all other assembly files correctly as integers. So the error was on the NCBI side.

However, I now worked around this and can push a refined function so that your download process will work now.

You can reproduce the issue as follows:

test_viral <- biomartr::getSummaryFile(db =refseq', kingdom = ‘viral') 

str(test_viral$X35)

test_plant <- biomartr::getSummaryFile(db =refseq', kingdom = ‘plant') 

str(test_plant$X35)

This is why dplyr::bind_rows() cannot join the columns with different data types:

`dplyr::bind_rows()`:                                                                                     
! Can't combine `..1$X35` <double> and `..9$X35` <character>

HajkD added a commit that referenced this issue Jun 18, 2023
…e to wrong parsing of NCBI files when internally calling `getAssemblySummary()` #92
@HajkD HajkD closed this as completed Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant