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:

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)


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.

  • $\begingroup$ Easy with biopython if Ur open to answers outside of R $\endgroup$ Feb 1, 2021 at 20:21
  • $\begingroup$ @LiamMcIntyre Sure! I would like to know your suggestion. $\endgroup$
    – Lumimoto
    Feb 23, 2021 at 12:29


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.