Learn R Programming

bioseq (version 0.1.4)

seq_crop_position: Crop sequences between two positions

Description

Crop sequences between two positions

Usage

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

Value

A cropped DNA, RNA or AA vector.

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.

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

Run this code

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)

Run the code above in your browser using DataLab