@@ -65,14 +65,19 @@ readQuantTable <- function(quant_table_path, type = "TMT", level=NULL, log2trans
65
65
}
66
66
} else { # DIA
67
67
if (level == " peptide" ) {
68
- # validate(fragpipe_DIA_input_test(temp_data))
69
- # temp_data <- temp_data[!grepl("contam", temp_data$Protein),]
70
- temp_data <- temp_data %> % select(. ,- c(" Proteotypic" , " Precursor.Charge" )) %> %
71
- group_by(Protein.Group , Protein.Names , Protein.Ids , Genes , Stripped.Sequence ) %> %
72
- summarise_if(is.numeric , max , na.rm = T )
73
- temp_data [sapply(temp_data , is.infinite )] <- NA
74
- temp_data $ Index <- paste0(temp_data $ Protein.Ids , " _" , temp_data $ Stripped.Sequence )
75
- temp_data <- temp_data %> % select(Index , everything())
68
+ if (! " SequenceWindow" %in% colnames(temp_data )) {
69
+ # validate(fragpipe_DIA_input_test(temp_data))
70
+ # temp_data <- temp_data[!grepl("contam", temp_data$Protein),]
71
+ temp_data <- temp_data %> % select(. ,- c(" Proteotypic" , " Precursor.Charge" )) %> %
72
+ group_by(Protein.Group , Protein.Names , Protein.Ids , Genes , Stripped.Sequence ) %> %
73
+ summarise_if(is.numeric , max , na.rm = T )
74
+ temp_data [sapply(temp_data , is.infinite )] <- NA
75
+ temp_data $ Index <- paste0(temp_data $ Protein.Ids , " _" , temp_data $ Stripped.Sequence )
76
+ temp_data <- temp_data %> % select(Index , everything())
77
+ } else {
78
+ mut.cols <- colnames(temp_data )[! colnames(temp_data ) %in% c(" Index" , " ProteinID" , " Gene" , " Peptide" , " SequenceWindow" )]
79
+ temp_data [mut.cols ] <- sapply(temp_data [mut.cols ], as.numeric )
80
+ }
76
81
}
77
82
}
78
83
return (temp_data )
@@ -264,9 +269,14 @@ make_se_from_files <- function(quant_table_path, exp_anno_path, type = "TMT", le
264
269
dimnames(data_se ) <- list (dimnames(data_se )[[1 ]], colData(data_se )$ sample_name )
265
270
colData(data_se )$ label <- colData(data_se )$ sample_name
266
271
} else { # level == "peptide"
267
- data_unique <- make_unique(quant_table , " Protein.Group" , " Index" )
272
+ if (" SequenceWindow" %in% colnames(quant_table )) { # single-site
273
+ data_unique <- make_unique(quant_table , " ProteinID" , " Index" )
274
+ } else {
275
+ data_unique <- make_unique(quant_table , " Protein.Group" , " Index" )
276
+ }
268
277
cols <- colnames(data_unique )
269
- selected_cols <- which(! (cols %in% c(" Index" , " Protein.Group" , " Protein.Ids" , " Stripped.Sequence" , " Protein.Names" , " Genes" , " First.Protein.Description" , " ID" , " name" )))
278
+ selected_cols <- which(! (cols %in% c(" Index" , " Protein.Group" , " Protein.Ids" , " Stripped.Sequence" , " Protein.Names" , " Genes" , " First.Protein.Description" , " ID" , " name" ,
279
+ " Gene" , " ProteinID" , " Peptide" , " SequenceWindow" )))
270
280
# test_match_DIA_column_design(data_unique, selected_cols, exp_design)
271
281
data_se <- make_se_customized(data_unique , selected_cols , exp_design , log2transform = log2transform , exp = " DIA" , level = " peptide" )
272
282
dimnames(data_se ) <- list (dimnames(data_se )[[1 ]], colData(data_se )$ sample_name )
0 commit comments