Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions R/converters_SpectronauttoMSstatsFormat.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,15 @@ SpectronauttoMSstatsFormat = function(

feature_columns = c("PeptideSequence", "PrecursorCharge",
"FragmentIon", "ProductCharge")

fill_isotope_label_type = if (is.null(heavyLabels))
list("IsotopeLabelType" = "L") else list()
preprocess_feature_columns = if ("IsotopeLabelType" %in% colnames(input))
c(feature_columns, "IsotopeLabelType") else feature_columns
fill_isotope_label_type = if ("IsotopeLabelType" %in% colnames(input))
list() else list("IsotopeLabelType" = "L")

input = MSstatsConvert::MSstatsPreprocess(
input,
annotation,
feature_columns,
preprocess_feature_columns,
remove_shared_peptides = useUniquePeptide,
remove_single_feature_proteins = removeProtein_with1Feature,
feature_cleaning = list(remove_features_with_few_measurements = removeFewMeasurements,
Expand Down
14 changes: 14 additions & 0 deletions inst/tinytest/test_converters_SpectronauttoMSstatsFormat.R
Original file line number Diff line number Diff line change
Expand Up @@ -427,3 +427,17 @@ output_leu = SpectronauttoMSstatsFormat(
use_log_file = FALSE
)
expect_false("H" %in% unique(output_leu$IsotopeLabelType))

# Verify intensity values for ANGYTTEYSASVK are preserved from FG.MS1Quantity
output_heavy = data.table::as.data.table(output_heavy)
angyt_input_intensities = sort(
boxcar_raw[PEP.StrippedSequence == "ANGYTTEYSASVK", FG.MS1Quantity])
angyt_output_intensities = sort(
output_heavy[grepl("ANGYTTEYSASVK", PeptideSequence, fixed = TRUE), Intensity])
expect_equivalent(angyt_input_intensities, angyt_output_intensities)

# Verify row count for ANGYTTEYSASVK is 2 * number of bioreplicates
# (one row per bioreplicate for heavy label, one for light label)
n_bioreplicates = length(unique(boxcar_raw$R.Replicate))
angyt_rows = subset(output_heavy, grepl("ANGYTTEYSASVK", PeptideSequence, fixed = TRUE))
expect_equal(nrow(angyt_rows), 2L * n_bioreplicates)
Loading