lgatto / synapter

Label-free data analysis pipeline for optimal identification and quantitation
https://lgatto.github.io/synapter/
4 stars 2 forks source link

Error when compiling fragmentmatching vignette #91

Closed lgatto closed 8 years ago

lgatto commented 8 years ago

When running the following code from the fragmentmatching vignette

> m <- plotFragmentMatchingPerformance(synobj2)
Error in 0:max(xtrain, na.rm = TRUE) : result would be too long a vector
In addition: Warning message:
In max(xtrain, na.rm = TRUE) :
  no non-missing arguments to max; returning -Inf

I traced it back to

confusion <- .fragmentMatchingConfusionMatrix(fm, what)

which fails at

thresholds <- 0:max(xtrain, na.rm=TRUE)

Not sure if this should be thresholds <- 0:max(xtrain, na.rm=TRUE). With this change, the code still fails when .fragmentMatchingConfusionMatrix is called a second time because xtrain is all NAs.

sgibb commented 8 years ago

During the change from crossMatching to fragmentMatching I changed the format how the fragments/spectra are stored. That's why the synobj2 in synapterdata is outdated. Here is the code to create a new one (the old script is not working anymore because synergise is broken):

## Please find the raw data at:
## http://proteome.sysbiol.cam.ac.uk/lgatto/synapter/data/
library("synapter")

inlist <- list(
  quantpeptide = "fermentor_02_sample_01_HDMSE_01_IA_final_peptide.csv.gz",
  quantpep3d = "fermentor_02_sample_01_HDMSE_01_Pep3DAMRT.csv.gz",
  identpeptide = "fermentor_03_sample_01_HDMSE_01_IA_final_peptide.csv.gz",
  identfragments = "fermentor_03_sample_01_HDMSE_01_IA_final_fragment.csv.gz",
  quantspectra = "fermentor_02_sample_01_HDMSE_01_Pep3D_Spectrum.xml.gz",
  fasta = "S.cerevisiae_Uniprot_reference_canonical_18_03_14.fasta")

## only for reproducibility
set.seed(1)
synobj2 <- Synapter(inlist)

filterUniqueDbPeptides(synobj2, verbose=TRUE)
filterPeptideLength(synobj2, 7)
fdr <- fpr <- 0.05
ppm <- 20

filterIdentPepScore(synobj2, method="BH", fdr=fdr)
filterQuantPepScore(synobj2, method="BH", fdr=fdr)
filterIdentProtFpr(synobj2, fpr=fpr)
filterQuantProtFpr(synobj2, fpr=fpr)
filterIdentPpmError(synobj2, ppm=ppm)
filterQuantPpmError(synobj2, ppm=ppm)

mergePeptides(synobj2)

modelRt(synobj2, span=0.05)

searchGrid(synobj2, verbose=FALSE)

setBestGridParams(synobj2)

findEMRTs(synobj2)

save(synobj2, file = "synobj2.rda")

With the new synobj2 the vignette compiles fine.

@lgatto I would suggest to not update synapterdata before we havn't finished synergise.

lgatto commented 8 years ago

Thanks!