seq_crop_position: Crop sequences between two positions

View source: R/seq_string_operation.R

seq_crop_positionR Documentation

Crop sequences between two positions

Description

Crop sequences between two positions

Usage

seq_crop_position(x, position_in = 1, position_out = -1)

Arguments

x

a DNA, RNA or AA vector.

position_in

an integer giving the position where to start cropping.

position_out

an integer giving the position where to stop cropping.

Value

A cropped DNA, RNA or AA vector.

See Also

stri_sub from stringi and str_sub from stringr for the underlying implementation.

Other string operations: seq-replace, seq_combine(), seq_count_pattern(), seq_crop_pattern(), seq_detect_pattern(), seq_extract_pattern(), seq_extract_position(), seq_remove_pattern(), seq_remove_position(), seq_replace_position(), seq_split_kmer(), seq_split_pattern()

Examples


x <- dna("ACGTTAGTGTAGCCGT")

# Drop the first 3 nucleotides (ACG)
seq_crop_position(x, position_in = 4)

# Crop codon between position 4 and 6
seq_crop_position(x, position_in = 4, position_out = 6)


bioseq documentation built on Sept. 6, 2022, 5:07 p.m.