peptide_matrix_count: Convert a character vector of peptides to a matrix of amino...

View source: R/peptide2matrix.R

peptide_matrix_countR Documentation

Convert a character vector of peptides to a matrix of amino acids and count the occurrence of each amino acid in each position

Description

This function takes a character vector of peptides, where each element represents a peptide of length 20, and converts it into a matrix where each row represents a peptide and each column represents an amino acid position within that peptide. Each element of the matrix is a single character representing the amino acid at that position. Additionally, the function counts the number of times a particular amino acid appears in a particular position and generates a new matrix, in which each column is an amino acid position, and each row represents an amino acid. The intersection represents the number of amino acids that showed up in that position.

Usage

peptide_matrix_count(peptides, p_number = 5)

Arguments

peptides

A character vector of peptides

p_number

An integer value. How many elements before and after the cleavage site to show.

Value

A list containing two elements: - peptide_matrix: a matrix where each row represents a peptide and each column represents an amino acid position within that peptide. Each element of the matrix is a single character representing the amino acid at that position. - amino_acid_count: a matrix where each row represents an amino acid and each column represents an amino acid position within the peptide. The intersection represents the number of times that amino acid showed up in that position.

Examples

peptides <- c("AKKGSKRHYVWALDMTFEH", "VAVFDELLKIVPNLGSYKR")
peptide_matrix_count(peptides)


MiguelCos/fragNterminomics documentation built on Oct. 13, 2023, 5:31 a.m.