View source: R/peptide_cluster_quantification.R
calculate_PSM | R Documentation |
Calculate Spectra Count (PSM) for one row of the input sequence dataframe
calculate_PSM(
row,
matching_result,
matching_columns,
distinct_columns,
with_PTM = FALSE,
reps = FALSE
)
row |
A row of dataframe containing the sequence for the 'Character' column in region_data. |
matching_result |
The dataframe that contains the matched results and PTM information. |
matching_columns |
Vector of column names that should match between the 'row' and 'matching_result' dataframes. |
distinct_columns |
Vector of column names that should be used to calculate PSM separately for each unique combination of these columns. |
with_PTM |
A boolean parameter indicating whether PTM should be considered. If |
reps |
A boolean parameter indicating whether the area/intensity should be divided by the number of replicates. Default is |
This function returns the modified region_data
dataframe that includes the "PSM" column, and optionally "PTM" and "PTM_type" columns.
If the 'filter_conditions' do not match, an empty dataframe will be returned early.
An AttributeError is raised if 'PTM_position' and 'PTM_type' columns do not exist in the 'result' dataframe when 'with_PTM' is TRUE
.
row <- data.frame(
Region_Sequence = c("XYZDDD"),
Condition_1 = c("Drug2"),
Region_1 = c("VL"),
Region_2 = c("Arm_2")
)
matching_result <- data.frame(
Sequence = c("AAA", "DDD", "DDD"),
Condition_1 = c("Drug1", "Drug2", "Drug2"),
Condition_2 = c("Donor1", "Donor2", "Donor2"),
Region_1 = c("VH", "VL", "VL"),
Region_2 = c("Arm_1", "Arm_2", "Arm_2"),
Start_Position = c(4, 4, 4),
End_Position = c(6, 6, 6),
PTM_position = c(NA, 2, 0),
PTM_type = c(NA,"O","C"),
Area = c(100, 200, 200),
reps = c(1, 2, 2)
)
matching_columns <- c("Condition_1", "Region_2")
result <- calculate_PSM(
row,
matching_result,
matching_columns,
distinct_columns = c("Condition_2", "Region_1"),
with_PTM = TRUE,
reps = TRUE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.