Skip to contents

Search through GenBank record for a keyword and return text up to the end_pattern.

Usage

extract_by_patterns(record, start_pattern, end_pattern = "\n")

Arguments

record

GenBank record in text format, character

start_pattern

REGEX pattern indicating the point to start extraction, character

end_pattern

REGEX pattern indicating the point to stop extraction, character

Value

character or NULL

Details

The start_pattern should be any of the capitalized elements in a GenBank record (e.g. LOCUS, DESCRIPTION, ACCESSION). The end_pattern depends on how much of the selected element a user wants returned. By default, the extraction will stop at the next newline. If keyword or end pattern not found, returns NULL.