Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
hechth committed Jul 25, 2024
2 parents 5e04d51 + 0cde01b commit 33e290b
Show file tree
Hide file tree
Showing 5 changed files with 1,945 additions and 1,869 deletions.
4 changes: 2 additions & 2 deletions R/IsoFiltR.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ filter_and_arrange_data <- function(peaks, sn) {
#' A list containing two elements: "Carblist" and "Sulflist," each representing a list of data chunks.
#' @export
create_data_chunks <- function(data1) {
sect <- ceiling(nrow(data1)) / 10
over <- round(sect) * 0.15
sect <- ceiling(ceiling(nrow(data1))/10)
over <- ceiling(round(sect) * 0.15)

data_chunks <- list()
for (i in 1:10) {
Expand Down
25 changes: 12 additions & 13 deletions R/MFAssign.R
Original file line number Diff line number Diff line change
Expand Up @@ -257,15 +257,19 @@ MFAssign <- function(peaks, isopeaks = "none", ionMode, lowMW=100,highMW=1000, P

Test <- dplyr::group_by(peaks, KMDTest, zstar)
Test <- dplyr::mutate(Test, CH2_num = round(mass - min(mass))/14)
peaksend <- dplyr::filter(Test, CH2_num !=0 & CH2_num != (min(CH2_num[CH2_num!=min(CH2_num)])+1)&
CH2_num != (min(CH2_num[CH2_num!=min(CH2_num)])+3))

names(peaksend)[1] <- "RA"
names(peaksend)[2] <- "Exp_mass"
peaksend <- peaksend[c(1,2)]
peaks1 <- dplyr::filter(Test, CH2_num == 0)
#peaks2 is just a dataframe to pull peaks3 and peaks4 from, not for additional usage
peaks2 <- dplyr::filter(Test, (CH2_num != 0 & CH2_num!=(min(CH2_num)+1)) == TRUE)
peaks3 <- dplyr::filter(peaks2, CH2_num == min(CH2_num))
peaks4 <- dplyr::filter(peaks2, (CH2_num==(min(CH2_num)+2)))

peaks <- dplyr::filter(Test, CH2_num ==0 | CH2_num == (min(CH2_num[CH2_num!=min(CH2_num)])+1) |
CH2_num == (min(CH2_num[CH2_num!=min(CH2_num)])+3))
peaks <- rbind(peaks1, peaks3, peaks4)
rm(peaks1)
rm(peaks2)
rm(peaks3)
rm(peaks4)
rm(Test)

peaks <- data.frame(RA = peaks[1], mass = peaks[2])
}else{
Expand All @@ -279,17 +283,12 @@ MFAssign <- function(peaks, isopeaks = "none", ionMode, lowMW=100,highMW=1000, P

Test <- dplyr::group_by(peaks, KMDTest, zstar)
Test <- dplyr::mutate(Test, CH2_num = round(mass - min(mass))/14)
peaksend <- dplyr::filter(Test, CH2_num !=0 & CH2_num != (min(CH2_num[CH2_num!=min(CH2_num)])+1)&
CH2_num != (min(CH2_num[CH2_num!=min(CH2_num)])+3))

names(peaksend)[1] <- "RA_CH2"
names(peaksend)[2] <- "mass_CH2"
peaksend <- peaksend[c(1,2,5,6,7)]
#
peaks <- dplyr::filter(Test, RA > 0)
#
peaks <- data.frame(RA = peaks[1], mass = peaks[2])

rm(Test)
}
#################################
Dummy <- data.frame(RA = c(-42,-42), mass = c(421.1147, 423.1293))
Expand Down
Loading

0 comments on commit 33e290b

Please sign in to comment.