IFIproteomics / LFQbench

Other
24 stars 13 forks source link

errors meet in example 6.12 in page 162 in the Supplementary Text and Figures of paper "A multicenter study benchmarks software tools for label-free proteome quantification" #7

Closed little-jun closed 4 years ago

little-jun commented 4 years ago

when i execute the example 6.12 in page 162 in the Supplementary Text and Figures of your paper "A multicenter study benchmarks software tools for label-free proteome quantification", when i run the code : nix = sapply( inputFiles, FSWE.generateReports, softwareSource = "guess", keep_original_names = T, singleHits = F, plotHistogram = T, plotHistNAs = T, reportSequences = F ) i meet errors "Error in guessSoftwareSource(experimentFile, FSWE.softwareNames) : Software source can not be guessed by filename! Review file names: they should start by the software source!File: LFQbench.R" Can you explain the reason for me , thank you .

mesontau commented 4 years ago

Hi, could you please provide your input files? Thanks, Pedro Navarro.

little-jun commented 4 years ago

Hi, could you please provide your input files? Thanks, Pedro Navarro.

i have solved the error, but i meet a new error. my input file is in the folder \ext\data\vignette_examples\hye124

my code is `## ----include=FALSE-------------------------------------------------------

define here global settings

knitr::opts_chunk$set(echo=TRUE, warning=FALSE, message=FALSE, results="hide", fig.width = 7, fig.height = 5)

----defineSampleSetComosition-------------------------------------------

sampleComposition = data.frame( species = c("HUMAN","YEAST", "ECOLI"), A = c( 67, 30, 3 ), B = c( 67, 3, 30 ) )

----defineDatasets------------------------------------------------------

dataSets = data.frame( "HYE110_SynaptG2S" = c( paste(rep("HYE110_A"), 1:3, sep = "."), paste(rep("HYE110_B"), 1:3, sep = ".") ), row.names = c( "A1", "A2", "A3", "B1", "B2", "B3" ) )

----defineSpeciesTags---------------------------------------------------

speciesTags = list( HUMAN = "_HUMAN", YEAST = "_YEAS", ECOLI = "_ECOLI" )

----initLFQbench--------------------------------------------------------

library(LFQbench)

LFQbench.initConfiguration( SampleComposition = sampleComposition )

FSWE.initConfiguration( injectionNames = dataSets, speciesTags = speciesTags )

----sourceDir-----------------------------------------------------------

srcDir = "D:/LFQbench/LFQbench-master/ext/data/vignette_examples/hye110"

LFQbench.setDataRootFolder( rootFolder = srcDir, createSubfolders = T )

----listSoftwareConfig, results="asis"----------------------------------

print( paste( FSWE.softwareNames, collapse="," ) )

----addSoftwareConfig---------------------------------------------------

FSWE.addSoftwareConfiguration(

Software configuration name

softwareName = "ISOQuant_pep",

# input_format can be wide or long. 
# Wide contains all quantitative values (all samples and replicates) 
# for a peptide in a single row, 
# whereas long contains a single quantitative value (just one replicate) in a row.
input_format = "wide",

# it is important to know that LFQbench honours the extension: 
# csv are COMMA separated values, 
# tsv are TAB separated values
input.extension = "*.csv$",

# how NA (not available) values are reported
nastrings = " ",

# in long formats, how the quantitative value column is named
quantitative.var = make.names("intensity in"),

# in wide formats, how quantitative values are tagged 
#(they also should include the injection names reported at the datasets object)
quantitative.var.tag = make.names("intensity in"),

# name of the protein name variable. 
# Remember: protein names should include species information (speciesTags)
protein.var = "entry",

# variable name of sequence 
# (including modifications as defined in FSWE.modificationsToUniMod)
sequence.mod.var = "sequence",

# variable name of the precursar charge state.
charge.var = make.names("signal_charge")

)

----addModification-----------------------------------------------------

FSWE.addModification( modificationRegExps = "\[Oxi\]", UniModStrings = "\(UniMod:35\)" )

list modifications available

print( FSWE.modificationsToUniMod )

----Generate reports in LFQbench format----------------------------------

inputFiles=list.files( path=LFQbench.Config$DataRootFolder, pattern="\..+" ) nix = sapply( inputFiles, FSWE.generateReports, softwareSource = "guess", keep_original_names = T, singleHits = F, plotHistogram = T, plotHistNAs = T, reportSequences = F )

----Perform LFQbench analysis----------------------------------------------

some configuration changes for beautifying plots

LFQbench.changeConfiguration( LogIntensityPlotRange = c( 9,21), LogRatioPlotRange = c(-7,7) )

run batch analysis and keep resultset

res = LFQbench.batchProcessRootFolder( )

----Display metrics---------------------------------------------

getting the result set of the first benchmarked file

rs = res[[1]] m = LFQbench.getMetrics( resultSet = rs )

get local accuracy and precision(byintensitytertiles)

acc = m$Local accuracy$A:B prec = m$Local precision$A:B

----Display plots---------------------------------------------

get the benchmark result for the first sample pair of the recently used result set

samplePairRes = rs$result[[1]]

display the scatter plot

LFQbench.showScatterAndBoxPlot( samplePair = samplePairRes, showLegend = T )

display the distributions of log ratios

LFQbench.showDistributionDensityPlot( samplePair = samplePairRes , showLegend = F )

----defineSampleSetComosition-------------------------------------------

sampleComposition = data.frame( species = c("HUMAN","YEAST", "ECOLI"), A = c( 65, 30, 05 ), B = c( 65, 15, 20 ) )

----defineDatasets------------------------------------------------------

dataSets = data.frame( "HYE124_TTOF6600_64var" = c( " lgillet_I150211_008", "lgillet_I150211_010", "lgillet_I150211_012", ## A " lgillet_I150211_009", "lgillet_I150211_011", "lgillet_I150211_013 " ## B ) , row.names = c ( "A1" , "A2" , "A3" , "B1" , "B2" , "B3" ) )

----defineSpeciesTags---------------------------------------------------

speciesTags = list( HUMAN = "_HUMAN", YEAST = "_YEAS", ECOLI = "_ECOLI" )

LFQbench.initConfiguration( SampleComposition = sampleComposition )

FSWE.initConfiguration( injectionNames = dataSets, speciesTags = speciesTags )

we don't need to define new software report format in this example

because Spect ronaut and PeakView (SWATH 2.0) report formats are predefined in FSWE

----sourceDir-----------------------------------------------------------

srcDir = "D:/LFQbench/LFQbench-master/ext/data/vignette_examples/hye124"

LFQbench.setDataRootFolder( rootFolder = srcDir, createSubfolders = T )

inputFiles=list.files( path=LFQbench.Config$DataRootFolder, pattern="\..+" )

nix = sapply( inputFiles, FSWE.generateReports, softwareSource = "guess", keep_original_names = T, singleHits = F, plotHistogram = T, plotHistNAs = T, reportSequences = F )

hye124.res = LFQbench.batchProcessRootFolder( )`

the error is "Can't use numeric NA as column index with [." when i execute the code in the last. `nix = sapply( inputFiles, FSWE.generateReports, softwareSource = "guess", keep_original_names = T, singleHits = F, plotHistogram = T, plotHistNAs = T, reportSequences = F )'

the correct error is "错误: Can't use numeric NA as column index with [. Run rlang::last_error() to see where the error occurred.

rlang::last_error() <error/rlang_error> Can't use numeric NA as column index with [. Backtrace:

  1. base::source(...)
  2. base::sapply(...) LFQbench-master/vignettes/LFQbench.R:52:0
  3. base::lapply(X = X, FUN = FUN, ...)
  4. LFQbench:::FUN(X[[i]], ...)
  5. tibble:::[.tbl_df(peptides_wide, , c(c(1:3), experiment.order))
  6. tibble:::check_names_df(j, x)
  7. tibble:::check_names_df_numeric(j, x) Run rlang::last_trace() to see the full context. rlang::last_trace() <error/rlang_error> Can't use numeric NA as column index with [. Backtrace: x
  8. +-base::source(...)
  9. | +-base::withVisible(eval(ei, envir))
  10. | -base::eval(ei, envir)
  11. | -base::eval(ei, envir)
  12. -base::sapply(...) LFQbench-master/vignettes/LFQbench.R:52:0
  13. -base::lapply(X = X, FUN = FUN, ...)
  14. -LFQbench:::FUN(X[[i]], ...)
  15. +-peptides_wide[, c(c(1:3), experiment.order)]
  16. +-dplyr:::[.grouped_df(peptides_wide, , c(c(1:3), experiment.order))
  17. +-base::NextMethod()
  18. -tibble:::[.tbl_df(peptides_wide, , c(c(1:3), experiment.order))
  19. -tibble:::check_names_df(j, x)
  20. -tibble:::check_names_df_numeric(j, x)"
mesontau commented 4 years ago

my input file is in the folder \ext\data\vignette_examples\hye124

In that folder there is not any file related to a Synapt G2S, as your code suggests:

 dataSets = data.frame(
 "HYE110_SynaptG2S" = c(
 paste(rep("HYE110_A"), 1:3, sep = "."),
 paste(rep("HYE110_B"), 1:3, sep = ".")
 ),

Also later in your code you change your source directory:

srcDir = "D:/LFQbench/LFQbench-master/ext/data/vignette_examples/hye110"

And later again you change the datasets:

dataSets = data.frame(
"HYE124_TTOF6600_64var" = c(
" lgillet_I150211_008", "lgillet_I150211_010", "lgillet_I150211_012", ## A
" lgillet_I150211_009", "lgillet_I150211_011", "lgillet_I150211_013 " ## B
) ,
row.names = c ( "A1" , "A2" , "A3" , "B1" , "B2" , "B3" )
)

Could you please clarify your code? It is hard to know what data you are trying to analyse.

Thanks, Pedro Navarro.