I'm trying to extract the host field from the features table using the biofiles package. From what I understand, the function filter (from the same package) could be of help but I can't extract the information of interest. This is the simplified series of steps that I'm following:
library(biofiles)
x_search <- reutils::esearch(db = "nuccore", #retmax = 9999,
term = "((bacteria[ORGN]) AND host[ALL]) AND Loripes[ALL]")
x_fetch <- reutils::efetch(x_search[1:3], "nuccore",rettype = "gbwithparts",
retmode = "text")
x_rec <- biofiles::gbRecord(x_fetch)
x_ft <- biofiles::getFeatures(x_rec)
x_ft[1]
The last output should show the list of features for that entry, including the source with the qualifier "host", which I would like to retrieve for all the ids.
EDIT: I'm open to solutions outside the biofiles package.