Skip to content

Commit

Permalink
messar fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Liu authored and Liu committed Apr 11, 2021
1 parent f4afc9d commit 28d70b6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 3 additions & 5 deletions R/average_spectrum.r
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,9 @@ average_spectrum<-function(splist, mz_window = 0.01){
#################################################
### Combine and average m/z with the same label##
#################################################

print(N_feature)
print(NBS)
#I_matrix = matrix(0,N_feature,NBS) # Intensity matrix N_feature x Nb of spectra
I_matrix <- big.matrix(N_feature, NBS, type='integer', init=0)

I_matrix = matrix(0,N_feature,NBS) # Intensity matrix N_feature x Nb of spectra
#I_matrix <- big.matrix(N_feature, NBS, type='integer', init=0)

avg_mzlist=rep(0,N_feature) # Averaged mass list
#dev_matrix = matrix(0,N_feature,NBS)
Expand Down
6 changes: 4 additions & 2 deletions R/process_lib2network.R
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,12 @@ process_lib2network<-function(input_library, networking = T, polarity = c("Posit

tmp_sp = splist[[i]]
tmp_prec = metadata$PEPMASS[i]
tmp_messar = library_messar(query_spectrum = tmp_sp, params.query.sp = list(prec_mz = tmp_prec, use_prec = T, compound.type = "Metabolite"))
tmp_messar1 = library_messar(query_spectrum = tmp_sp, params.search = list(mz_search = 0.01, tops = 2), params.query.sp = list(prec_mz = tmp_prec, use_prec = T, compound.type = "Metabolite"))
tmp_messar2 = library_messar(query_spectrum = tmp_sp, params.search = list(mz_search = 0.01, tops = 2), params.query.sp = list(prec_mz = tmp_prec, use_prec = T, compound.type = "Drug"))
tmp_messar = rbind(tmp_messar1, tmp_messar2)

if (!is.null(tmp_messar[,1])){
messar_output[[i]] = tmp_messar[,1]
messar_output[[i]] = unique(tmp_messar[,1])
} else {messar_output[[i]] = "0"}
}

Expand Down

0 comments on commit 28d70b6

Please sign in to comment.