<p>I'm trying to extract the host field from the features table using the <a href="https://github.com/gschofl/biofiles" rel="nofollow noreferrer">biofiles</a> 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:</p>
<pre><code>library(biofiles)
x_search &lt;- reutils::esearch(db = &quot;nuccore&quot;, #retmax = 9999,
             term = &quot;((bacteria[ORGN]) AND host[ALL]) AND Loripes[ALL]&quot;)

x_fetch &lt;- reutils::efetch(x_search[1:3], &quot;nuccore&quot;,rettype = &quot;gbwithparts&quot;, 
            retmode = &quot;text&quot;)

x_rec &lt;- biofiles::gbRecord(x_fetch)

x_ft &lt;- biofiles::getFeatures(x_rec)

x_ft[1]
</code></pre>
<p>The last output should show the list of features for that entry, including the source with the qualifier &quot;host&quot;, which I would like to retrieve for all the ids.</p>
<p>EDIT: I'm open to solutions outside the biofiles package.</p>

CC BY-SA 4.0
2021-02-01T20:21:45.767Z
Easy with biopython if Ur open to answers outside of R
Liam McIntyre
CC BY-SA 4.0
2021-02-23T12:29:56.237Z
@LiamMcIntyre Sure! I would like to know your suggestion.
Lumimoto
<r><genbank>
How can I retreive specific qualifiers from genbank files in R?
# How can I retreive specific qualifiers from genbank files in R?

(Asked by: username_0 on 2021-02-01)

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.

**Tags:** r, genbank
> **Comments:**
> **username_1**: Easy with biopython if Ur open to answers outside of R  
> **username_0**: @LiamMcIntyre Sure! I would like to know your suggestion.  

---

## 0 answers

