Skip to content

Commit

Permalink
moves as.numeric(Intensity) before 0 assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
mstaniak authored Jun 17, 2020
1 parent c9d7e36 commit 7787cdf
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions R/OpenSWATHtoMSstatsFormat.R
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ OpenSWATHtoMSstatsFormat <- function(input,
input$PeptideSequence <- gsub(':', '_', input$PeptideSequence)
input$FragmentIon <- gsub(':', '_', input$FragmentIon)

## class of intensity is character, change it as numeric
input$Intensity <- as.numeric(input$Intensity)

## there are incomplete rows, which potentially NA
## if negative and 0 values should be replaced with NA
input[input$Intensity < 1, "Intensity"] <- 0
Expand Down Expand Up @@ -272,13 +275,7 @@ OpenSWATHtoMSstatsFormat <- function(input,
}

##############################
## 10. class of intensity is character, change it as numeric
##############################

input$Intensity <- as.numeric(input$Intensity)

##############################
## 11. merge annotation
## 10. merge annotation
##############################
input <- merge(input, annotinfo, by='Run', all=TRUE)

Expand Down

0 comments on commit 7787cdf

Please sign in to comment.