lgatto / synapter

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

regenerate synapterdata::synobj2 and create_synobj2.R #123

Closed sgibb closed 7 years ago

sgibb commented 7 years ago

has to be done after fixing #122.

Additional a new synapterdata/inst/scripts/create_synobj2.R is needed:

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

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

synobj2 <- synergise1(inlist, outputdir = tempdir())

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

Please note that we use synergise1 here (not synergise2) because we want to demonstrate the fragment matching in the vignette and explain step by step what synergise2 does.

sgibb commented 7 years ago

@lgatto I am thinking it would be useful to not run synergise1 (it doesn't take too much time) and then we could use synobj2 as example for synergise2 as well.

So just:

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

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

synobj2 <- Synapter(inlist, master=FALSE)

save(synobj2, file = "synobj2.rda")
sgibb commented 7 years ago

Using compress="xz" reduces the file size to nearly the half of the default gzip compression:

save(synobj2, file="synobj2.rda", compress="xz")
> du -sh *.rda
8,6M    synobj2.rda
4,7M    synobj2xz.rda
lgatto commented 7 years ago

synapterdata version 1.13.1 (also pushed to Bioc right now, also available here) now has a new data synobj3 which is equivalent to synobj2, but for synapter >= 1.99. See inst/scripts/create_synobj3.R for details.

@sgibb - sorry for taking so much time. Please close the issue if this works as needed.

sgibb commented 7 years ago

Unfortunately it is not working:

library(synapterdata)
foo <- synergise1(object=synobj3, outputdir=tempdir())
# ...
Error in .Call2("new_input_filexp", filepath, PACKAGE = "XVector") : 
  cannot open file '/disk2/lg390/synobj3/S.cerevisiae_Uniprot_reference_canonical_18_03_14.fasta'

We have to provide the fasta file in the package and a access function similar to synapterTinyData:

synobj3Data <- function () {
    f <- system.file("extdata", "S.cerevisiae_Uniprot_reference_canonical_18_03_14.fasta", package="synapter")
    data(synobj3, package="synapterdata", envir=.GlobalEnv)
    .GlobalEnv$synobj3$DbFastaFile <- f
    .GlobalEnv$synobj3 <- updateObject(.GlobalEnv$synobj3)
}

Sorry, I was not aware of this.

@lgatto Could you please add extdata/S.cerevisiae_Uniprot_reference_canonical_18_03_14.fasta to synapterdata. Should be synobj3Data be part of synapter or synapterdata?

I don't know who is using synobj2 with its old functionality (it was generated for the old crossmatching code) so it should be save to replace it completely.

lgatto commented 7 years ago

New synapterdata version 1.13.2 with fasta and updated synobj2 (pushed to Bioc right now, and available here).

Still need to add the function to get the object.

lgatto commented 7 years ago

Added synapterdata::synobj2Data to version 1.13.2.

sgibb commented 7 years ago

@lgatto sry, I should not code at night: synobj2Data is not working because system.file(..., package="synapter") has to be system.file(..., package="synapterdata").

lgatto commented 7 years ago

Shit yes, I should have spotted that, sorry. Will update now.

lgatto commented 7 years ago

Done.

sgibb commented 7 years ago

Thank you very much. Sorry for this inconvenience. Now synapter should build and pass R CMD check without warnings/errors (at least on my machine, a few NOTES because of two maintainer and usage of a few hidden MSnbase methods are still there).

How long do we need to wait for synapterdata 1.13.2 on bioconductor? (I thought we should have seen 1.13.1 today). Or do we upload synapter 1.99 without waiting for synapterdata 1.13.2?

lgatto commented 7 years ago

Data packages are build only twice a week, Wednesday and Saturday, if I remember well.

I am fine for pushing synapter 1.99 without waiting. Merge whenever you a happy and I will push to Bioc svn. We should probably ask for you to get write access.

sgibb commented 7 years ago

You are right. Data packages are build on Wednesday. Now synapter 2.0 builds on travis! I already merged 2.0 into master. Regarding the bioc svn push please see #135.