Skip to content

Commit

Permalink
Update tidyMSFragger.R
Browse files Browse the repository at this point in the history
made column_before_quants an optional parameter
  • Loading branch information
jjGG authored Mar 26, 2024
1 parent 565f242 commit d36dd83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/tidyMSFragger.R
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,15 @@ tidy_FragPipe_combined_protein <- function(
#' @param purity_threshold purity threshold default = 0.5
#' @param PeptideProphetProb default 0.9
#'
tidy_FragPipe_psm <- function(psm_file, purity_threshold = 0.5, PeptideProphetProb = 0.9, abundance_threshold = 0){
tidy_FragPipe_psm <- function(psm_file, purity_threshold = 0.5, PeptideProphetProb = 0.9, abundance_threshold = 0, column_before_quants = "Quan Usage"){
psm <- readr::read_tsv(psm_file)

if (!"Purity" %in% colnames(psm) ) {
warning("no Purity column in psm file!")
psm <- psm |> mutate(Purity = 1, .before = "Quan Usage")
}

x <- which(colnames(psm) == "Quan Usage")
x <- which(colnames(psm) == column_before_quants)
colnamesQuan <- colnames(psm)[(x + 1):ncol(psm)]
psm_relevant <- psm |> dplyr::select(
dplyr::all_of(
Expand Down

0 comments on commit d36dd83

Please sign in to comment.