is_sequence: Ensures a string is an acceptable amino acid sequence

is_sequenceR Documentation

Ensures a string is an acceptable amino acid sequence

Description

A simple test function to ensure the provided sequence is an acceptable amino acid sequence. ProForma sequences are accepted.

Usage

is_sequence(Sequence, Message = FALSE, AlternativeGlossary = NULL)

Arguments

Sequence

An amino acid sequence which should be a single string. Required.

Message

Explain why the test failed. Default is FALSE.

AlternativeGlossary

Try a different glossary. See system.file("extdata", "Unimod_v20220602.csv", package = "pspecterlib) for formatting.

Details

The output will either be a "TRUE" acceptable sequence, or "FALSE" unacceptable sequence. An acceptable sequence cannot be NULL, will not have any spaces or non-letter characters, will be longer than 1 amino acid, and will not contain the letters B, J, O, U, X, or Z. ProForma notation (i.e. "TES[Acetyl]T") is now accepted.

Examples

## Not run: 

# An acceptable sequence will return TRUE
is_sequence("TEST")
is_sequence("TES[Acetyl]T")
is_sequence("T[58.77]E[Acetyl]ST")

# Unacceptable sequences will return FALSE
is_sequence("TESTSEQUENCE")
is_sequence("TIRED $CIENTIST WORKING L8")
is_sequence("T")
is_sequence("T[UnfinishedEST")


## End(Not run)


EMSL-Computing/pspecterlib documentation built on Jan. 28, 2024, 8:13 p.m.