Skip to contents

as_aastringset() turns a table or record that carries sequences (a protein or variant record, proteins_variants(), evidence_constructs()) into a Biostrings::AAStringSet. Names are the accessions (PlasticDB_<id> for the few records without one, as in the server's FASTA files); every other column goes into mcols(). Records without a sequence are dropped.

Usage

as_aastringset(x, ...)

Arguments

x

A tibble with a sequence column, or a record list from proteins_get() or variants_get().

...

Unused.

Value

An Biostrings::AAStringSet with metadata columns.

Details

Protein lists carry no sequence unless asked (proteins_list(include_sequence = TRUE) adds a sequence column, which as_aastringset() accepts). proteins_sequences() and variants_sequences() ask for it, live or pinned, so they need one list call; against a server that does not return it they fall back to the FASTA download with the same filters.

Examples

variants <- tibble::tibble(id = 1:2, accession = c("PB0001", NA),
    variant_name = c("A", "B"), sequence = c("MKV", "MKL"))
as_aastringset(variants)