This function gets FASTA data from an httr2_response
and either saves it to a file or parses it in memory into a
Biostrings::AAStringSet or named character
vector.
Arguments
- resp
httr2_response
object, generated by e.g.httr2::req_perform()
orfetch_stream()
/fetch_paged()
.- con
string
or base::connection object (optional), the file in which to save the data.- encoding
string
(optional), character encoding of the body text. If not specified, will use the encoding specified by the content-type, falling back to"UTF8"
with a warning if it cannot be found. The resulting string is always re-encoded to UTF-8.
Value
By default, returns a Biostrings::AAStringSet object. If the
Biostrings
package is not installed, returns a named character
vector.
If con
is not NULL, returns nothing and saves the FASTA sequences to the
file specified by con
.