diff --git a/Jamroot.jam b/Jamroot.jam index 04caed504d..9c7840f92f 100644 --- a/Jamroot.jam +++ b/Jamroot.jam @@ -107,7 +107,7 @@ local default_libraries_path = "./libraries" ; local libraries_path = [ MATCH --libraries-path=(.*) : [ modules.peek : ARGV ] ] ; libraries_path ?= $(default_libraries_path) ; # set default path in absence of command-line path -local default_boost_src = "$(libraries_path)/boost_1_76_0" ; +local default_boost_src = "$(libraries_path)/boost_1_86_0" ; local boost_src = [ MATCH --boost-src=(.*) : [ modules.peek : ARGV ] ] ; boost_src ?= $(default_boost_src) ; # set default path in absence of command-line path @@ -388,6 +388,7 @@ project pwiz gcc:_GLIBCXX_USE_CXX11_ABI=0 # set standard to C++14 + msvc:"/std:c++14" gcc:-std=c++14 darwin:-std=c++14 clang:-std=c++14 @@ -587,7 +588,7 @@ path-constant BOOST_SOURCE : $(boost_src) ; path-constant ZLIB_SOURCE : $(zlib_src) ; path-constant GD_SOURCE : $(PWIZ_LIBRARIES_PATH)/libgd-2.1.0alpha ; path-constant PNG_SOURCE : $(PWIZ_LIBRARIES_PATH)/libpng-1.5.6 ; -path-constant FREETYPE_SOURCE : $(PWIZ_LIBRARIES_PATH)/freetype-2.4.7 ; +path-constant FREETYPE_SOURCE : $(PWIZ_LIBRARIES_PATH)/freetype-VER-2-13-3 ; path-constant EXPAT_SOURCE : $(PWIZ_LIBRARIES_PATH)/expat-2.0.1 ; using ext-boost : $(BOOST_VERSION:J=.) : $(BOOST_SOURCE) : $(ZLIB_SOURCE) ; @@ -1731,7 +1732,6 @@ constant .common-sources : $(.common-src-exclusions) $(PWIZ_ROOT_PATH)/Jamroot.jam - $(PWIZ_ROOT_PATH)/NOTICE $(PWIZ_ROOT_PATH)/LICENSE $(PWIZ_ROOT_PATH)/quickbuild.bat $(PWIZ_ROOT_PATH)/quickbuild.sh diff --git a/clean.bat b/clean.bat index 557a6bb23c..9cbda307f9 100644 --- a/clean.bat +++ b/clean.bat @@ -22,11 +22,12 @@ IF EXIST libraries\boost_1_54_0 rmdir /s /q libraries\boost_1_54_0 IF EXIST libraries\boost_1_56_0 rmdir /s /q libraries\boost_1_56_0 IF EXIST libraries\boost_1_67_0 rmdir /s /q libraries\boost_1_67_0 IF EXIST libraries\boost_1_76_0 rmdir /s /q libraries\boost_1_76_0 +IF EXIST libraries\boost_1_86_0 rmdir /s /q libraries\boost_1_86_0 IF EXIST libraries\gd-2.0.33 rmdir /s /q libraries\gd-2.0.33 IF EXIST libraries\zlib-1.2.3 rmdir /s /q libraries\zlib-1.2.3 IF EXIST libraries\libgd-2.1.0alpha rmdir /s /q libraries\libgd-2.1.0alpha IF EXIST libraries\libpng-1.5.6 rmdir /s /q libraries\libpng-1.5.6 -IF EXIST libraries\freetype-2.4.7 rmdir /s /q libraries\freetype-2.4.7 +IF EXIST libraries\freetype-VER-2-13-3 rmdir /s /q libraries\freetype-VER-2-13-3 IF EXIST libraries\hdf5-1.8.7 rmdir /s /q libraries\hdf5-1.8.7 IF EXIST libraries\fftw-3.1.2 rmdir /s /q libraries\fftw-3.1.2 IF EXIST libraries\expat-2.0.1 rmdir /s /q libraries\expat-2.0.1 diff --git a/clean.sh b/clean.sh index f913ee3ec7..64086a4901 100755 --- a/clean.sh +++ b/clean.sh @@ -12,7 +12,7 @@ if [ -d libraries/gd-2.0.33 ]; then rm -fr libraries/gd-2.0.33; fi; if [ -d libraries/zlib-1.2.3 ]; then rm -fr libraries/zlib-1.2.3; fi; if [ -d libraries/libgd-2.1.0alpha ]; then rm -fr libraries/libgd-2.1.0alpha; fi; if [ -d libraries/libpng-1.5.6 ]; then rm -fr libraries/libpng-1.5.6; fi; -if [ -d libraries/freetype-2.4.7 ]; then rm -fr libraries/freetype-2.4.7; fi; +if [ -d libraries/freetype-VER-2-13-3 ]; then rm -fr libraries/freetype-VER-2-13-3; fi; if [ -d libraries/hdf5-1.8.7 ]; then rm -fr libraries/hdf5-1.8.7; fi; if [ -d libraries/fftw-3.1.2 ]; then rm -fr libraries/fftw-3.1.2; fi; if [ -d libraries/expat-2.0.1 ]; then rm -fr libraries/expat-2.0.1; fi; diff --git a/libraries/boost_1_76_0.tar.bz2 b/libraries/boost_1_86_0.tar.bz2 similarity index 60% rename from libraries/boost_1_76_0.tar.bz2 rename to libraries/boost_1_86_0.tar.bz2 index e0d42b3d94..c981df3823 100644 Binary files a/libraries/boost_1_76_0.tar.bz2 and b/libraries/boost_1_86_0.tar.bz2 differ diff --git a/libraries/boost_aux/tools/bcp/Jamfile.v2 b/libraries/boost_aux/tools/bcp/Jamfile.v2 index 8a9fcb905b..b89a153629 100644 --- a/libraries/boost_aux/tools/bcp/Jamfile.v2 +++ b/libraries/boost_aux/tools/bcp/Jamfile.v2 @@ -4,14 +4,12 @@ exe bcp : - add_path.cpp bcp_imp.cpp copy_path.cpp file_types.cpp + add_dependent_lib.cpp add_path.cpp bcp_imp.cpp copy_path.cpp file_types.cpp fileview.cpp main.cpp path_operations.cpp scan_cvs_path.cpp licence_info.cpp scan_licence.cpp output_licence_info.cpp /boost/filesystem//boost_filesystem /boost/regex//boost_regex - /boost/test//boost_prg_exec_monitor : - BOOST_REGEX_NO_LIB=1 : release ; diff --git a/libraries/boost_aux/tools/bcp/add_dependent_lib.cpp b/libraries/boost_aux/tools/bcp/add_dependent_lib.cpp index 8b4bb2dd3e..521b70d09b 100644 --- a/libraries/boost_aux/tools/bcp/add_dependent_lib.cpp +++ b/libraries/boost_aux/tools/bcp/add_dependent_lib.cpp @@ -1,216 +1,231 @@ -/* - * - * Copyright (c) 2009 Dr John Maddock - * Use, modification and distribution is subject to the - * Boost Software License, Version 1.0. (See accompanying file - * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - * - * This file implements the following: - * void bcp_implementation::add_path(const fs::path& p) - * void bcp_implementation::add_directory(const fs::path& p) - * void bcp_implementation::add_file(const fs::path& p) - * void bcp_implementation::add_dependent_lib(const std::string& libname, const fs::path& p, const fileview& view) - */ - -#include "bcp_imp.hpp" -#include "fileview.hpp" -#include -#include -#include -#include - -// -// This file contains the code required to work out whether the source/header file being scanned -// is actually dependent upon some library's source code or not. -// - -static std::map scanner; - -static std::map > free_function_names; -static std::map > class_names; -static std::map > variable_names; - -static void init_library_scanner(const fs::path& p, bool cvs_mode, const std::string& libname, bool recurse = false) -{ - /* - if(free_function_names.count(libname) == 0) - { - free_function_names[libname] = "[\\x0]"; - class_names[libname] = "[\\x0]"; - variable_names[libname] = "[\\x0]"; - } - */ - // - // Don't add files created by build system: - // - if((p.leaf() == "bin") || (p.leaf() == "bin-stage")) - return; - // - // Don't add version control directories: - // - if((p.leaf() == "CVS") || (p.leaf() == ".svn")) - return; - // - // don't add directories not under version control: - // - if(cvs_mode && !fs::exists(p / "CVS/Entries")) - return; - if(cvs_mode && !fs::exists(p / ".svn/entries")) - return; - // - // Enumerate files and directories: - // - fs::directory_iterator i(p); - fs::directory_iterator j; - while(i != j) - { - if(fs::is_directory(*i)) - init_library_scanner(*i, cvs_mode, libname, true); - if(bcp_implementation::is_source_file(*i)) - { - static boost::regex function_scanner( - "(?|" // Branch reset group - "(?:\\<\\w+\\>[^>;{},:]*)" // Return type - "(?:" - "(\\<\\w+\\>)" // Maybe class name - "\\s*" - "(?:<[^>;{]*>)?" // Maybe template specialisation - "::\\s*)?" - "(\\<(?!throw|if|while|for|catch)\\w+\\>)" // function name - "\\s*" - "\\(" - "[^\\(\\);{}]*" // argument list - "\\)" - "\\s*(?:BOOST[_A-Z]+\\s*)?" - "\\{" // start of definition - "|" - "(\\<\\w+\\>)" // Maybe class name - "\\s*" - "(?:<[^>;{]*>)?" // Maybe template specialisation - "::\\s*" - "~?\\1" // function name, same as class name - "\\s*" - "\\(" - "[^\\(\\);{}]*" // argument list - "\\)" - "\\s*(?:BOOST[_A-Z]+\\s*)?" - "\\{" // start of definition - ")" // end branch reset - ); - fileview view(*i); - boost::regex_iterator a(view.begin(), view.end(), function_scanner); - boost::regex_iterator b; - while(a != b) - { - if((*a)[1].matched) - { - std::string n = a->str(1); - class_names[libname].insert(n); - } - else - { - std::string n = a->str(2); - free_function_names[libname].insert(n); - } - ++a; - } - } - ++i; - } - - if(recurse == false) - { - // - // Build the regular expressions: - // - const char* e1 = - "^(?>[[:blank:]]*)(?!#)[^;{}\\r\\n]*" - "(?|" - "(?:class|struct)[^:;{}#]*" - "("; - // list of class names goes here... - const char* e2 = - ")\\s*(?:<[^;{>]*>\\s*)?(?::[^;{]*)?\\{" - "|" - "\\<(?!return)\\w+\\>[^:;{}#=<>!~%.\\w]*("; - // List of function names goes here... - const char* e3 = - ")\\s*\\([^;()]*\\)\\s*(?:BOOST[_A-Z]+\\s*)?;)"; - - std::string class_name_list; - std::set::const_iterator i = class_names[libname].begin(), j = class_names[libname].end(); - if(i != j) - { - class_name_list = *i; - ++i; - while(i != j) - { - class_name_list += "|" + *i; - ++i; - } - } - else - { - class_name_list = "[\\x0]"; - } - std::string function_name_list; - i = free_function_names[libname].begin(); - j = free_function_names[libname].end(); - if(i != j) - { - function_name_list = *i; - ++i; - while(i != j) - { - function_name_list += "|" + *i; - ++i; - } - } - else - { - function_name_list = "[\\x0]"; - } - - scanner[libname] = boost::regex(e1 + class_name_list + e2 + function_name_list + e3); - } -} - -void bcp_implementation::add_dependent_lib(const std::string& libname, const fs::path& p, const fileview& view) -{ - // - // if the boost library libname has source associated with it - // then add the source to our list: - // - if(fs::exists(m_boost_path / "libs" / libname / "src")) - { - if(!m_dependencies.count(fs::path("libs") / libname / "src")) - { - if(scanner.count(libname) == 0) - init_library_scanner(m_boost_path / "libs" / libname / "src", m_cvs_mode, libname); - boost::cmatch what; - if(regex_search(view.begin(), view.end(), what, scanner[libname])) - { - std::cout << "INFO: tracking source dependencies of library " << libname - << " due to presence of \"" << what << "\" in file " << p << std::endl; - //std::cout << "Full text match was: " << what << std::endl; - m_dependencies[fs::path("libs") / libname / "src"] = p; // set up dependency tree - add_path(fs::path("libs") / libname / "src"); - - if(fs::exists(m_boost_path / "libs" / libname / "build")) - { - if(!m_dependencies.count(fs::path("libs") / libname / "build")) - { - m_dependencies[fs::path("libs") / libname / "build"] = p; // set up dependency tree - add_path(fs::path("libs") / libname / "build"); - //m_dependencies[fs::path("boost-build.jam")] = p; - //add_path(fs::path("boost-build.jam")); - m_dependencies[fs::path("Jamroot")] = p; - add_path(fs::path("Jamroot")); - //m_dependencies[fs::path("tools/build")] = p; - //add_path(fs::path("tools/build")); - } - } - } - } - } -} +/* + * + * Copyright (c) 2009 Dr John Maddock + * Use, modification and distribution is subject to the + * Boost Software License, Version 1.0. (See accompanying file + * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * + * This file implements the following: + * void bcp_implementation::add_path(const fs::path& p) + * void bcp_implementation::add_directory(const fs::path& p) + * void bcp_implementation::add_file(const fs::path& p) + * void bcp_implementation::add_dependent_lib(const std::string& libname, const fs::path& p, const fileview& view) + */ + +#include "bcp_imp.hpp" +#include "fileview.hpp" +#include +#include +#include +#include +#include + +// +// This file contains the code required to work out whether the source/header file being scanned +// is actually dependent upon some library's source code or not. +// + +static std::map scanner; + +static std::map > free_function_names; +static std::map > class_names; +static std::map > variable_names; + +static void init_library_scanner(const fs::path& p, bool cvs_mode, const std::string& libname, bool recurse = false) +{ + /* + if(free_function_names.count(libname) == 0) + { + free_function_names[libname] = "[\\x0]"; + class_names[libname] = "[\\x0]"; + variable_names[libname] = "[\\x0]"; + } + */ + // + // Don't add files created by build system: + // + if((p.filename() == "bin") || (p.filename() == "bin-stage")) + return; + // + // Don't add version control directories: + // + if((p.filename() == "CVS") || (p.filename() == ".svn")) + return; + // + // don't add directories not under version control: + // + if(cvs_mode && !fs::exists(p / "CVS/Entries")) + return; + if(cvs_mode && !fs::exists(p / ".svn/entries")) + return; + // + // Enumerate files and directories: + // + fs::directory_iterator i(p); + fs::directory_iterator j; + while(i != j) + { + if(fs::is_directory(*i)) + init_library_scanner(*i, cvs_mode, libname, true); + if(bcp_implementation::is_source_file(*i)) + { + static boost::regex function_scanner( + "(?|" // Branch reset group + "(?:\\<\\w+\\>[^>;{},:]*)" // Return type + "(?:" + "(\\<\\w+\\>)" // Maybe class name + "\\s*" + "(?:<[^>;{]*>)?" // Maybe template specialisation + "::\\s*)?" + "(\\<(?!throw|if|while|for|catch)\\w+\\>)" // function name + "\\s*" + "\\(" + "[^\\(\\);{}]*" // argument list + "\\)" + "\\s*(?:BOOST[_A-Z]+\\s*)?" + "\\{" // start of definition + "|" + "(\\<\\w+\\>)" // Maybe class name + "\\s*" + "(?:<[^>;{]*>)?" // Maybe template specialisation + "::\\s*" + "~?\\1" // function name, same as class name + "\\s*" + "\\(" + "[^\\(\\);{}]*" // argument list + "\\)" + "\\s*(?:BOOST[_A-Z]+\\s*)?" + "\\{" // start of definition + ")" // end branch reset + ); + fileview view(*i); + boost::regex_iterator a(view.begin(), view.end(), function_scanner); + boost::regex_iterator b; + while(a != b) + { + if((*a)[1].matched) + { + std::string n = a->str(1); + class_names[libname].insert(n); + } + else + { + std::string n = a->str(2); + free_function_names[libname].insert(n); + } + ++a; + } + } + ++i; + } + + if(recurse == false) + { + // + // Build the regular expressions: + // + const char* e1 = + "^(?>[[:blank:]]*)(?!#)[^;{}\\r\\n]*" + "(?|" + "(?:class|struct)[^:;{}#]*" + "("; + // list of class names goes here... + const char* e2 = + ")\\s*(?:<[^;{>]*>\\s*)?(?::[^;{]*)?\\{" + "|" + "\\<(?!return)\\w+\\>[^:;{}#=<>!~%.\\w]*("; + // List of function names goes here... + const char* e3 = + ")\\s*\\([^;()]*\\)\\s*(?:BOOST[_A-Z]+\\s*)?;)"; + + std::string class_name_list; + std::set::const_iterator i = class_names[libname].begin(), j = class_names[libname].end(); + if(i != j) + { + class_name_list = *i; + ++i; + while(i != j) + { + class_name_list += "|" + *i; + ++i; + } + } + else + { + class_name_list = "[\\x0]"; + } + std::string function_name_list; + i = free_function_names[libname].begin(); + j = free_function_names[libname].end(); + if(i != j) + { + function_name_list = *i; + ++i; + while(i != j) + { + function_name_list += "|" + *i; + ++i; + } + } + else + { + function_name_list = "[\\x0]"; + } + + scanner[libname] = boost::regex(e1 + class_name_list + e2 + function_name_list + e3); + } +} + +void bcp_implementation::add_dependent_lib(const std::string& libname, const fs::path& p, const fileview& view) +{ + // + // if the boost library libname has source associated with it + // then add the source to our list: + // + if(fs::exists(m_boost_path / "libs" / libname / "src")) + { + if(!m_dependencies.count(fs::path("libs") / libname / "src")) + { + if(scanner.count(libname) == 0) + init_library_scanner(m_boost_path / "libs" / libname / "src", m_cvs_mode, libname); + boost::cmatch what; + if(regex_search(view.begin(), view.end(), what, scanner[libname])) + { + std::cout << "INFO: tracking source dependencies of library " << libname + << " due to presence of \"" << what << "\" in file " << p << std::endl; + //std::cout << "Full text match was: " << what << std::endl; + m_dependencies[fs::path("libs") / libname / "src"] = p; // set up dependency tree + add_path(fs::path("libs") / libname / "src"); + + if(fs::exists(m_boost_path / "libs" / libname / "build")) + { + if(!m_dependencies.count(fs::path("libs") / libname / "build")) + { + m_dependencies[fs::path("libs") / libname / "build"] = p; // set up dependency tree + add_path(fs::path("libs") / libname / "build"); + //m_dependencies[fs::path("boost-build.jam")] = p; + //add_path(fs::path("boost-build.jam")); + m_dependencies[fs::path("Jamroot")] = p; + add_path(fs::path("Jamroot")); + //m_dependencies[fs::path("tools/build")] = p; + //add_path(fs::path("tools/build")); + } + } + if(fs::exists(m_boost_path / "libs" / libname / "config")) + { + if(!m_dependencies.count(fs::path("libs") / libname / "config")) + { + m_dependencies[fs::path("libs") / libname / "config"] = p; // set up dependency tree + add_path(fs::path("libs") / libname / "config"); + //m_dependencies[fs::path("boost-build.jam")] = p; + //add_path(fs::path("boost-build.jam")); + m_dependencies[fs::path("Jamroot")] = p; + add_path(fs::path("Jamroot")); + //m_dependencies[fs::path("tools/build")] = p; + //add_path(fs::path("tools/build")); + } + } + } + } + } +} diff --git a/libraries/boost_aux/tools/bcp/add_path.cpp b/libraries/boost_aux/tools/bcp/add_path.cpp index 0de744a6aa..6c0b730fbb 100644 --- a/libraries/boost_aux/tools/bcp/add_path.cpp +++ b/libraries/boost_aux/tools/bcp/add_path.cpp @@ -1,538 +1,627 @@ -/* - * - * Copyright (c) 2003 Dr John Maddock - * Use, modification and distribution is subject to the - * Boost Software License, Version 1.0. (See accompanying file - * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - * - * This file implements the following: - * void bcp_implementation::add_path(const fs::path& p) - * void bcp_implementation::add_directory(const fs::path& p) - * void bcp_implementation::add_file(const fs::path& p) - * void bcp_implementation::add_dependent_lib(const std::string& libname, const fs::path& p, const fileview& view) - */ - -#include "bcp_imp.hpp" -#include "fileview.hpp" -#include -#include -#include -#include - - -void bcp_implementation::add_path(const fs::path& p) -{ - fs::path normalized_path = p; - normalized_path.normalize(); - if(fs::exists(m_boost_path / normalized_path)) - { - if(fs::is_directory(m_boost_path / normalized_path)) - add_directory(normalized_path); - else - add_file(normalized_path); - } - else - { - std::cerr << "CAUTION: dependent file " << p.string() << " does not exist." << std::endl; - std::cerr << " Found while scanning file " << m_dependencies[p].string() << std::endl; - } -} - -void bcp_implementation::add_directory(const fs::path& p) -{ - // - // Don't add files created by build system: - // - if((p.leaf() == "bin") || (p.leaf() == "bin-stage")) - return; - // - // Don't add version control directories: - // - if((p.leaf() == "CVS") || (p.leaf() == ".svn")) - return; - // - // don't add directories not under version control: - // - if(m_cvs_mode && !fs::exists(m_boost_path / p / "CVS/Entries")) - return; - if(m_svn_mode && !fs::exists(m_boost_path / p / ".svn/entries")) - return; - // - // enermerate files and directories: - // - fs::directory_iterator i(m_boost_path / p); - fs::directory_iterator j; - while(i != j) - { - // - // we need to convert *i back into - // a relative path, what follows is a hack: - // - std::string s(i->path().string()); - if(m_boost_path.string().size()) - s.erase(0, m_boost_path.string().size() + 1); - fs::path np = s; - if(!m_dependencies.count(np)) - { - m_dependencies[np] = p; // set up dependency tree - add_path(np); - } - ++i; - } -} - -void bcp_implementation::add_file(const fs::path& p) -{ - // - // if the file does not exist in cvs then don't do anything with it: - // - if((m_cvs_mode || m_svn_mode) && (m_cvs_paths.find(p) == m_cvs_paths.end())) - return; - // - // if we've already seen the file return: - // - if(m_copy_paths.find(p) != m_copy_paths.end()) - return; - // - // add the file to our list: - // - m_copy_paths.insert(p); - // - // if this is a source file, scan for dependencies: - // - if(is_source_file(p)) - { - add_file_dependencies(p, false); - } - if(is_jam_file(p) && m_namespace_name.size() && ((std::distance(p.begin(), p.end()) < 3) || (*p.begin() != "tools") || (*++p.begin() != "build"))) - { - // - // We're doing a rename of namespaces and library names - // so scan for names of libraries: - // - static const boost::regex e( - "\\ i(view.begin(), view.end(), e, 1); - boost::regex_token_iterator j; - while(i != j) - { - m_lib_names.insert(*i); - ++i; - } - static const std::pair specials_library_names[] = { - std::pair("libs/python/build/Jamfile.v2", "boost_python"), - std::pair("libs/python/build/Jamfile.v2", "boost_python3"), - }; - - for(unsigned int n = 0; n < (sizeof(specials_library_names)/sizeof(specials_library_names[0])); ++n) - { - if(0 == compare_paths(specials_library_names[n].first, p)) - { - m_lib_names.insert(specials_library_names[n].second); - } - } - } - // - // if this is a html file, scan for dependencies: - // - if(is_html_file(p)) - { - static const boost::regex e( - "<(?:img[^>]*src=|link[^>]*href=)(\"[^\"]+\"|\\w+)[^>]*>" - ); - - fileview view(m_boost_path / p); - boost::regex_token_iterator i(view.begin(), view.end(), e, 1); - boost::regex_token_iterator j; - while(i != j) - { - // - // extract the dependent name: - // - std::string s(*i); - if(s[0] == '\"') - { - // remove quotes: - assert(s.size() > 2); - s.erase(0, 1); - s.erase(s.size() - 1); - } - // - // Remove any target suffix: - // - std::string::size_type n = s.find('#'); - if(n != std::string::npos) - { - s.erase(n); - } - // - // if the name starts with ./ remove it - // or we'll get an error: - if(s.compare(0, 2, "./") == 0) - s.erase(0, 2); - if(s.find(':') == std::string::npos) - { - // only concatonate if it's a relative path - // rather than a URL: - fs::path dep(p.branch_path() / s); - if(!m_dependencies.count(dep)) - { - m_dependencies[dep] = p; // set up dependency tree - add_path(dep); - } - } - ++i; - } - } - // - // now scan for "special" dependencies: - // anything that we can't automatically detect... - // -static const std::pair - specials[] = { - std::pair("boost/atomic/capabilities.hpp", "boost/atomic/detail"), - std::pair("boost/chrono/chrono.hpp", "libs/chrono/src"), - std::pair("boost/chrono/chrono.hpp", "libs/chrono/build"), - std::pair("boost/cerrno.hpp", "libs/system/build"), - std::pair("boost/cerrno.hpp", "libs/system/src"), - std::pair("libs/thread/build", "boost/system"), - std::pair("libs/thread/build", "boost/cerrno.hpp"), - std::pair("libs/thread/build", "boost/chrono"), - std::pair("boost/filesystem/convenience.hpp", "boost/filesystem.hpp"), - std::pair("boost/filesystem/exception.hpp", "boost/filesystem.hpp"), - std::pair("boost/filesystem/fstream.hpp", "boost/filesystem.hpp"), - std::pair("boost/filesystem/operations.hpp", "boost/filesystem.hpp"), - std::pair("boost/filesystem/path.hpp", "boost/filesystem.hpp"), - std::pair("boost/filesystem.hpp", "libs/filesystem/build"), - std::pair("boost/filesystem.hpp", "libs/filesystem/v2"), - std::pair("boost/filesystem.hpp", "libs/filesystem/v3"), - std::pair("boost/config.hpp", "boost/config"), - std::pair("tools/build/boost-build.jam", "Jamrules"), - std::pair("tools/build/boost-build.jam", "project-root.jam"), - std::pair("tools/build/boost-build.jam", "boost-build.jam"), - std::pair("tools/build/boost-build.jam", "Jamfile.v2"), - std::pair("tools/build/boost-build.jam", "boostcpp.jam"), - std::pair("tools/build/boost-build.jam", "bootstrap.bat"), - std::pair("tools/build/boost-build.jam", "bootstrap.sh"), - std::pair("tools/build/boost-build.jam", "Jamroot"), - std::pair("tools/build/boost-build.jam", "INSTALL"), - std::pair("tools/build/boost-build.jam", "LICENSE_1_0.txt"), - std::pair("boost/preprocessor/iterate.hpp", "boost/preprocessor/iteration"), - std::pair("boost/preprocessor/slot/slot.hpp", "boost/preprocessor/slot/detail"), - std::pair("boost/function.hpp", "boost/function/detail"), - std::pair("boost/regex/config.hpp", "boost/regex/user.hpp"), - std::pair("boost/signals/signal_template.hpp", "boost/function"), - std::pair("boost/mpl/list.hpp", "boost/mpl/list"), - std::pair("boost/mpl/list_c.hpp", "boost/mpl/list"), - std::pair("boost/mpl/vector.hpp", "boost/mpl/vector"), - std::pair("boost/mpl/deque.hpp", "boost/mpl/vector"), - std::pair("boost/mpl/vector_c.hpp", "boost/mpl/vector"), - std::pair("boost/mpl/map.hpp", "boost/mpl/map"), - std::pair("boost/mpl/set.hpp", "boost/mpl/set"), - std::pair("boost/mpl/set_c.hpp", "boost/mpl/set"), - std::pair("boost/mpl/aux_/include_preprocessed.hpp", "boost/mpl/aux_/preprocessed"), - std::pair("boost/mpl/vector/aux_/include_preprocessed.hpp", "boost/mpl/vector/aux_/preprocessed"), - std::pair("boost/mpl/set/aux_/include_preprocessed.hpp", "boost/mpl/set/aux_/preprocessed"), - std::pair("boost/mpl/map/aux_/include_preprocessed.hpp", "boost/mpl/map/aux_/preprocessed"), - std::pair("boost/mpl/list/aux_/include_preprocessed.hpp", "boost/mpl/list/aux_/preprocessed"), - std::pair("libs/graph/src/python/visitor.hpp", "libs/graph/src/python"), - std::pair("boost/test/detail/config.hpp", "libs/test/src"), - std::pair("boost/test/detail/config.hpp", "libs/test/build"), - std::pair("boost/typeof.hpp", "boost/typeof/incr_registration_group.hpp"), - std::pair("boost/function_types/detail/pp_loop.hpp", "boost/function_types/detail/pp_cc_loop"), - std::pair("boost/function_types/components.hpp", "boost/function_types/detail/components_impl"), - std::pair("boost/function_types/detail/pp_loop.hpp", "boost/function_types/detail"), - std::pair("boost/math/tools/rational.hpp", "boost/math/tools/detail"), - std::pair("boost/proto/repeat.hpp", "boost/proto/detail/local.hpp"), - std::pair("boost/signals/signal_template.hpp", "boost/function"), - std::pair("boost/preprocessor/slot/counter.hpp", "boost/preprocessor/slot/detail/counter.hpp"), - std::pair("boost/graph/distributed/detail/tag_allocator.hpp", "libs/graph_parallel"), - std::pair("boost/graph/distributed/mpi_process_group.hpp", "libs/graph_parallel"), - std::pair("boost/parameter/parameters.hpp", "boost/parameter/aux_/overloads.hpp"), - }; - - for(unsigned int n = 0; n < (sizeof(specials)/sizeof(specials[0])); ++n) - { - if(0 == compare_paths(specials[n].first, p)) - { - if(!m_dependencies.count(specials[n].second)) - { - m_dependencies[specials[n].second] = p; // set up dependency tree - add_path(specials[n].second); - } - } - } - -} - -void bcp_implementation::add_file_dependencies(const fs::path& p, bool scanfile) -{ - static const boost::regex e( - "^[[:blank:]]*(?://@bcp[[:blank:]]+([^\\n]*)\n)?#[[:blank:]]*include[[:blank:]]*[\"<]([^\">]+)[\">]" - ); - - if(!m_dependencies.count(p)) - m_dependencies[p] = p; // set terminal dependency - - fileview view; - if(scanfile) - view.open(p); - else - view.open(m_boost_path / p); - if(m_license_mode && !scanfile) - scan_license(p, view); - const int subs[] = { 1, 2 }; - boost::regex_token_iterator i(view.begin(), view.end(), e, subs); - boost::regex_token_iterator j; - while(i != j) - { - // - // *i contains the name of the include file, - // check first for a file of that name in the - // same directory as the file we are scanning, - // and if that fails, then check the boost-root: - // - fs::path include_file; - try{ - std::string discart_message = *i; - ++i; - if(discart_message.size()) - { - // The include is optional and should be discarded: - std::cout << "Optional functionality won't be copied: " << discart_message << std::endl; - std::cout << "Add the file " << *i << " to the list of dependencies to extract to copy this functionality." << std::endl; - ++i; - continue; - } - include_file = i->str(); - fs::path test_file(m_boost_path / p.branch_path() / include_file); - if(fs::exists(test_file) && !fs::is_directory(test_file) && (p.branch_path().string() != "boost")) - { - if(!m_dependencies.count(p.branch_path() / include_file)) - { - m_dependencies[p.branch_path() / include_file] = p; - add_path(p.branch_path() / include_file); - } - } - else if(fs::exists(m_boost_path / include_file)) - { - if(!m_dependencies.count(include_file)) - { - m_dependencies[include_file] = p; - add_path(include_file); - } - } - ++i; - } - catch(const fs::filesystem_error&) - { - std::cerr << "Can't parse filename " << *i << " included by file " << p.string() << std::endl; - ++i; - continue; - } - } - // - // Now we need to scan for Boost.Preprocessor includes that - // are included via preprocessor iteration: - // - static const boost::regex ppfiles("^[[:blank:]]*#[[:blank:]]*define[[:blank:]]+(?:BOOST_PP_FILENAME|BOOST_PP_ITERATION_PARAMS|BOOST_PP_INDIRECT_SELF)(?:[^\\n]|\\\\\\n)+?[\"<]([^\">]+)[\">]"); - i = boost::regex_token_iterator(view.begin(), view.end(), ppfiles, 1); - while(i != j) - { - // - // *i contains the name of the include file, - // check first for a file of that name in the - // same directory as the file we are scanning, - // and if that fails, then check the boost-root: - // - fs::path include_file; - try{ - include_file = i->str(); - } - catch(const fs::filesystem_error&) - { - std::cerr << "Can't parse filename " << *i << " included by file " << p.string() << std::endl; - ++i; - continue; - } - fs::path test_file(m_boost_path / p.branch_path() / include_file); - if(fs::exists(test_file) && !fs::is_directory(test_file) && (p.branch_path().string() != "boost")) - { - if(!m_dependencies.count(p.branch_path() / include_file)) - { - m_dependencies[p.branch_path() / include_file] = p; - add_path(p.branch_path() / include_file); - } - } - else if(fs::exists(m_boost_path / include_file)) - { - if(!m_dependencies.count(include_file)) - { - m_dependencies[include_file] = p; - add_path(include_file); - } - } - else - { - std::cerr << "CAUTION: Boost.Preprocessor iterated file " << include_file.string() << " does not exist." << std::endl; - } - ++i; - } - - // - // Scan for any #include MACRO includes that we don't recognise. - // - // Begin by declaring all of the macros that get #included that - // we know about and are correctly handled as special cases: - // - static const std::string known_macros[] = { - "AUX778076_INCLUDE_STRING", - "BOOST_PP_STRINGIZE(boost/mpl/aux_/preprocessed/AUX778076_PREPROCESSED_HEADER)", - "BOOST_USER_CONFIG", - "BOOST_COMPILER_CONFIG", - "BOOST_STDLIB_CONFIG", - "BOOST_PLATFORM_CONFIG", - "BOOST_PP_FILENAME_1", - "BOOST_PP_ITERATION_PARAMS_1", - "BOOST_PP_FILENAME_2", - "BOOST_PP_ITERATION_PARAMS_2", - "BOOST_PP_FILENAME_3", - "BOOST_PP_ITERATION_PARAMS_3", - "BOOST_PP_FILENAME_4", - "BOOST_PP_ITERATION_PARAMS_4", - "BOOST_PP_FILENAME_5", - "BOOST_PP_ITERATION_PARAMS_5", - "BOOST_PP_INDIRECT_SELF", - "BOOST_PP_INCLUDE_SELF()", - "BOOST_PP_ITERATE", - "BOOST_PP_LOCAL_ITERATE", - "BOOST_PP_ITERATE()", - "BOOST_PP_LOCAL_ITERATE()", - "BOOST_PP_ASSIGN_SLOT(1)", - "BOOST_PP_ASSIGN_SLOT(2)", - "BOOST_PP_ASSIGN_SLOT(3)", - "BOOST_PP_ASSIGN_SLOT(4)", - "BOOST_PP_ASSIGN_SLOT(5)", - "BOOST_ABI_PREFIX", - "BOOST_ABI_SUFFIX", - "BOOST_PP_STRINGIZE(boost/mpl/aux_/preprocessed/AUX_PREPROCESSED_HEADER)", - "BOOST_PP_STRINGIZE(boost/mpl/list/AUX778076_HEADER)", - "BOOST_PP_STRINGIZE(boost/mpl/list/AUX778076_LIST_C_HEADER)", - "BOOST_PP_STRINGIZE(boost/mpl/list/AUX778076_LIST_HEADER)", - "BOOST_PP_STRINGIZE(boost/mpl/map/aux_/preprocessed/AUX778076_HEADER)", - "BOOST_PP_STRINGIZE(boost/mpl/map/AUX778076_MAP_HEADER)", - "BOOST_PP_STRINGIZE(boost/mpl/set/aux_/preprocessed/AUX778076_HEADER)", - "BOOST_PP_STRINGIZE(boost/mpl/set/AUX778076_SET_HEADER)", - "BOOST_PP_STRINGIZE(boost/mpl/set/AUX778076_SET_C_HEADER)", - "BOOST_PP_STRINGIZE(boost/mpl/vector/AUX778076_VECTOR_HEADER)", - "BOOST_PP_STRINGIZE(boost/mpl/vector/aux_/preprocessed/AUX778076_HEADER)", - "BOOST_PP_STRINGIZE(boost/mpl/vector/AUX778076_DEQUE_HEADER)", - "BOOST_PP_STRINGIZE(boost/mpl/vector/AUX778076_VECTOR_C_HEADER)", - "BOOST_REGEX_USER_CONFIG", - "BGL_PYTHON_EVENTS_HEADER", - "B1", - "B2", - "BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()", - "BOOST_SLIST_HEADER", - "BOOST_HASH_SET_HEADER", - "BOOST_HASH_MAP_HEADER", - "BOOST_INTRUSIVE_INVARIANT_ASSERT_INCLUDE", - "BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT_INCLUDE", - "BOOST_INTRUSIVE_SAFE_HOOK_DESTRUCTOR_ASSERT_INCLUDE", - "BOOST_FT_loop", - "BOOST_FT_AL_PREPROCESSED", - "BOOST_FT_AL_INCLUDE_FILE", - "__FILE__", - "BOOST_FT_cc_file", - "BOOST_FT_variate_file", - "BOOST_USER_CONFIG", - "BOOST_HEADER()", - "BOOST_TR1_STD_HEADER(utility)", - "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(tuple))", - "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(random))", - "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(array))", - "BOOST_TR1_HEADER(cmath)", - "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(complex))", - "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(functional))", - "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(memory))", - "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(regex))", - "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(type_traits))", - "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(unordered_map))", - "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(unordered_set))", - "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(utility))", - "BOOST_PROTO_LOCAL_ITERATE()", - "BOOST_SIGNAL_FUNCTION_N_HEADER", - "BOOST_PP_UPDATE_COUNTER()", - }; - - static const boost::regex indirect_includes("^[[:blank:]]*#[[:blank:]]*include[[:blank:]]+([^\"<][^\n]*?)[[:blank:]]*$"); - i = boost::regex_token_iterator(view.begin(), view.end(), indirect_includes, 1); - while(i != j) - { - const std::string* known_macros_end = known_macros + sizeof(known_macros)/sizeof(known_macros[0]); - if(known_macros_end == std::find(known_macros, known_macros_end, i->str())) - { - std::cerr << "CAUTION: don't know how to trace depenencies through macro: \"" << *i << "\" in file: " << p.string() << std::endl; - } - ++i; - } - // - // if the file contains a cpp_main / unit_test_main / test_main - // it is dependent upon Boost.test even if it doesn't - // include any of the Boost.test headers directly. - // - static const boost::regex m("^\\s*int\\s+(?:cpp_main|test_main|unit_test_main)"); - boost::cmatch what; - if(boost::regex_search(view.begin(), view.end(), what, m)) - { - add_dependent_lib("test", p, view); - } - if(!scanfile) - { - // - // grab the name of the library to which the header belongs, - // and if that library has source then add the source to our - // list: - // - // this regex catches boost/libname.hpp or boost/libname/whatever: - // - static const boost::regex lib1("boost/([^\\./]+)(?!detail).*"); - boost::smatch swhat; - std::string gs(p.generic_string()); - if(boost::regex_match(gs, swhat, lib1)) - { - add_dependent_lib(swhat.str(1), p, view); - } - // - // and this one catches boost/x/y/whatever (for example numeric/ublas): - // - static const boost::regex lib2("boost/([^/]+/[^/]+)/(?!detail).*"); - gs = p.generic_string(); - if(boost::regex_match(gs, swhat, lib2)) - { - add_dependent_lib(swhat.str(1), p, view); - } - } - if(m_list_namespaces) - { - // - // scan for top level namespaces and add to our list: - // - static const boost::regex namespace_scanner( - "^(?(view.begin(), view.end(), namespace_scanner, 1); - while(i != j) - { - if(m_top_namespaces.count(*i) == 0) - { - //std::cout << *i << " (Found in " << p << ")" << std::endl; - m_top_namespaces[*i] = p; - } - ++i; - } - } -} +/* + * + * Copyright (c) 2003 Dr John Maddock + * Copyright René Ferdinand Rivera Morell 2023 + * Use, modification and distribution is subject to the + * Boost Software License, Version 1.0. (See accompanying file + * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * + * This file implements the following: + * void bcp_implementation::add_path(const fs::path& p) + * void bcp_implementation::add_directory(const fs::path& p) + * void bcp_implementation::add_file(const fs::path& p) + * void bcp_implementation::add_dependent_lib(const std::string& libname, const fs::path& p, const fileview& view) + */ + +#include "bcp_imp.hpp" +#include "fileview.hpp" +#include +#include +#include +#include +#include + + +void bcp_implementation::add_path(const fs::path& p) +{ + if (m_excluded.find(p) != m_excluded.end()) + return; + fs::path normalized_path = p.lexically_normal(); + if(fs::exists(m_boost_path / normalized_path)) + { + if(fs::is_directory(m_boost_path / normalized_path)) + add_directory(normalized_path); + else + add_file(normalized_path); + } + else + { + std::cerr << "CAUTION: dependent file " << p.string() << " does not exist." << std::endl; + std::cerr << " Found while scanning file " << m_dependencies[p].string() << std::endl; + } +} + +void bcp_implementation::add_directory(const fs::path& p) +{ + auto is_good_path = [this](const fs::path& p) + { + // + // Don't add files created by build system: + // + if((p.filename() == "bin") || (p.filename() == "bin-stage")) + return false; + // + // Don't add version control directories: + // + if((p.filename() == "CVS") || (p.filename() == ".svn") || (p.filename() == ".git")) + return false; + // + // Don't add CI directories: + // + if((p.filename() == ".github") || (p.filename() == ".drone") + || (p.filename() == ".circleci") || (p.filename() == ".ci")) + return false; + // + // Don't add CI files: + // + if((p.filename() == ".travis.yml") || (p.filename() == "appveyor.yml") + || (p.filename() == ".drone.star") + || (p.filename() == ".drone.jsonnet") + || (p.filename() == ".cirrus.yml") + || (p.filename() == "azure-pipelines.yml")) + return false; + // + // don't add directories not under version control: + // + if(m_cvs_mode && !fs::exists(m_boost_path / p / "CVS/Entries")) + return false; + if(m_svn_mode && !fs::exists(m_boost_path / p / ".svn/entries")) + return false; + return true; + }; + if (!is_good_path(p)) return; + // + // enumerate files and directories: + // + fs::directory_iterator i(m_boost_path / p); + fs::directory_iterator j; + while(i != j) + { + // + // we need to convert *i back into + // a relative path, what follows is a hack: + // + std::string s(i->path().string()); + if(m_boost_path.string().size()) + s.erase(0, m_boost_path.string().size() + 1); + fs::path np = s; + if(is_good_path(np) && !m_dependencies.count(np)) + { + m_dependencies[np] = p; // set up dependency tree + if (m_excluded.find(np) == m_excluded.end()) + add_pending_path(np); + } + ++i; + } +} + +void bcp_implementation::add_file(const fs::path& p) +{ + // + // if the file does not exist in cvs then don't do anything with it: + // + if((m_cvs_mode || m_svn_mode) && (m_cvs_paths.find(p) == m_cvs_paths.end())) + return; + // + // if we've already seen the file return: + // + if(m_copy_paths.find(p) != m_copy_paths.end()) + return; + // + // add the file to our list: + // + m_copy_paths.insert(p); + // + // if this is a source file, scan for dependencies: + // + if(is_source_file(p)) + { + add_file_dependencies(p, false); + } + if(is_jam_file(p) && *p.begin() == "libs" && (std::distance(p.begin(), p.end()) >= 3)) + { + // + // Modular libs jamfile(s) have references to all the user level + // dependent libraries to also include. + // + auto lib = *(++p.begin()); + static const boost::regex e(">/boost/([a-zA-Z0-9_]+)"); + fileview view(m_boost_path / p); + boost::regex_token_iterator i(view.begin(), view.end(), e, 1); + boost::regex_token_iterator j; + while(i != j) + { + std::cout << "INFO: Adding modular lib reference from: " << lib << " to: " << *i << "\n"; + if (*i == "numeric_conversion") add_path(m_boost_path / "libs/numeric/conversion"); + else if (*i == "interval") add_path(m_boost_path / "libs/numeric/interval"); + else if (*i == "odeint") add_path(m_boost_path / "libs/numeric/odeint"); + else if (*i == "ublas") add_path(m_boost_path / "libs/numeric/ublas"); + else add_path(m_boost_path / "libs" / *i); + ++i; + } + add_path(m_boost_path / "libs" / lib); + } + else if(is_jam_file(p) && m_namespace_name.size() && ((std::distance(p.begin(), p.end()) < 3) || (*p.begin() != "tools") || (*++p.begin() != "build"))) + { + // + // We're doing a rename of namespaces and library names + // so scan for names of libraries: + // + static const boost::regex e( + "\\ i(view.begin(), view.end(), e, 1); + boost::regex_token_iterator j; + while(i != j) + { + m_lib_names.insert(*i); + ++i; + } + static const std::pair specials_library_names[] = { + std::pair("libs/python/build/Jamfile.v2", "boost_python"), + std::pair("libs/python/build/Jamfile.v2", "boost_python3"), + }; + + for(unsigned int n = 0; n < (sizeof(specials_library_names)/sizeof(specials_library_names[0])); ++n) + { + if(0 == compare_paths(specials_library_names[n].first, p)) + { + m_lib_names.insert(specials_library_names[n].second); + } + } + } + // + // if this is a html file, scan for dependencies: + // + if(is_html_file(p)) + { + static const boost::regex e( + "<(?:img[^>]*src=|link[^>]*href=)(\"[^\"]+\"|\\w+)[^>]*>" + ); + + fileview view(m_boost_path / p); + boost::regex_token_iterator i(view.begin(), view.end(), e, 1); + boost::regex_token_iterator j; + while(i != j) + { + // + // extract the dependent name: + // + std::string s(*i); + if(s[0] == '\"') + { + // remove quotes: + assert(s.size() > 2); + s.erase(0, 1); + s.erase(s.size() - 1); + } + // + // Remove any target suffix: + // + std::string::size_type n = s.find('#'); + if(n != std::string::npos) + { + s.erase(n); + } + // + // if the name starts with ./ remove it + // or we'll get an error: + if(s.compare(0, 2, "./") == 0) + s.erase(0, 2); + if(s.find(':') == std::string::npos) + { + // only concatonate if it's a relative path + // rather than a URL: + fs::path dep(p.parent_path() / s); + if(!m_dependencies.count(dep)) + { + m_dependencies[dep] = p; // set up dependency tree + add_pending_path(dep); + } + } + ++i; + } + } + // + // now scan for "special" dependencies: + // anything that we can't automatically detect... + // +static const std::pair + specials[] = { + std::pair("libs/test/build/Jamfile.v2", "libs/timer/src"), + std::pair("libs/test/build/Jamfile.v2", "libs/timer/build"), + std::pair("boost/atomic/capabilities.hpp", "boost/atomic/detail"), + std::pair("boost/chrono/chrono.hpp", "libs/chrono/src"), + std::pair("boost/chrono/chrono.hpp", "libs/chrono/build"), + std::pair("boost/context/execution_context.hpp", "libs/context/src"), + std::pair("boost/context/execution_context.hpp", "libs/context/build"), + std::pair("boost/context/fcontext.hpp", "libs/context/src"), + std::pair("boost/context/fcontext.hpp", "libs/context/build"), + std::pair("boost/context/fixedsize_stack.hpp", "libs/context/src"), + std::pair("boost/context/fixedsize_stack.hpp", "libs/context/build"), + std::pair("boost/context/protected_fixedsize_stack.hpp", "libs/context/src"), + std::pair("boost/context/protected_fixedsize_stack.hpp", "libs/context/build"), + std::pair("boost/context/segmented_stack.hpp", "libs/context/src"), + std::pair("boost/context/segmented_stack.hpp", "libs/context/build"), + std::pair("boost/context/stack_context.hpp", "libs/context/src"), + std::pair("boost/context/stack_context.hpp", "libs/context/build"), + std::pair("boost/context/stack_traits.hpp", "libs/context/src"), + std::pair("boost/context/stack_traits.hpp", "libs/context/build"), + std::pair("boost/cerrno.hpp", "libs/system/build"), + std::pair("boost/cerrno.hpp", "libs/system/src"), + std::pair("libs/thread/build", "boost/system"), + std::pair("libs/thread/build", "boost/cerrno.hpp"), + std::pair("libs/thread/build", "boost/chrono"), + std::pair("boost/filesystem/cstdio.hpp", "boost/filesystem.hpp"), + std::pair("boost/filesystem/directory.hpp", "boost/filesystem.hpp"), + std::pair("boost/filesystem/exception.hpp", "boost/filesystem.hpp"), + std::pair("boost/filesystem/fstream.hpp", "boost/filesystem.hpp"), + std::pair("boost/filesystem/operations.hpp", "boost/filesystem.hpp"), + std::pair("boost/filesystem/file_status.hpp", "boost/filesystem.hpp"), + std::pair("boost/filesystem/path.hpp", "boost/filesystem.hpp"), + std::pair("boost/filesystem.hpp", "libs/filesystem/build"), + std::pair("boost/config.hpp", "boost/config"), + std::pair("tools/build/bootstrap.sh", "libs/config/checks"), + std::pair("tools/build/bootstrap.sh", "libs/config/test"), + std::pair("tools/build/bootstrap.sh", "libs/headers/build"), + std::pair("tools/build/bootstrap.sh", "tools/boost_install/BoostConfig.cmake"), + std::pair("tools/build/bootstrap.sh", "tools/boost_install/BoostDetectToolset.cmake"), + std::pair("tools/build/bootstrap.sh", "tools/boost_install/boost-install.jam"), + std::pair("tools/build/bootstrap.sh", "tools/boost_install/boost-install-dirs.jam"), + std::pair("tools/build/bootstrap.sh", "tools/boost_install/Jamfile"), + std::pair("tools/build/bootstrap.sh", "boostcpp.jam"), + std::pair("tools/build/bootstrap.sh", "project-config.jam"), + std::pair("tools/build/bootstrap.sh", "bootstrap.bat"), + std::pair("tools/build/bootstrap.sh", "bootstrap.sh"), + std::pair("tools/build/bootstrap.sh", "Jamroot"), + std::pair("tools/build/bootstrap.sh", "INSTALL"), + std::pair("tools/build/bootstrap.sh", "LICENSE_1_0.txt"), + std::pair("boost/preprocessor/iterate.hpp", "boost/preprocessor/iteration"), + std::pair("boost/preprocessor/slot/slot.hpp", "boost/preprocessor/slot/detail"), + std::pair("boost/function.hpp", "boost/function/detail"), + std::pair("boost/regex/config.hpp", "boost/regex/user.hpp"), + std::pair("boost/signals/signal_template.hpp", "boost/function"), + std::pair("boost/mpl/list.hpp", "boost/mpl/list"), + std::pair("boost/mpl/list_c.hpp", "boost/mpl/list"), + std::pair("boost/mpl/vector.hpp", "boost/mpl/vector"), + std::pair("boost/mpl/deque.hpp", "boost/mpl/vector"), + std::pair("boost/mpl/vector_c.hpp", "boost/mpl/vector"), + std::pair("boost/mpl/map.hpp", "boost/mpl/map"), + std::pair("boost/mpl/set.hpp", "boost/mpl/set"), + std::pair("boost/mpl/set_c.hpp", "boost/mpl/set"), + std::pair("boost/mpl/aux_/include_preprocessed.hpp", "boost/mpl/aux_/preprocessed"), + std::pair("boost/mpl/vector/aux_/include_preprocessed.hpp", "boost/mpl/vector/aux_/preprocessed"), + std::pair("boost/mpl/set/aux_/include_preprocessed.hpp", "boost/mpl/set/aux_/preprocessed"), + std::pair("boost/mpl/map/aux_/include_preprocessed.hpp", "boost/mpl/map/aux_/preprocessed"), + std::pair("boost/mpl/list/aux_/include_preprocessed.hpp", "boost/mpl/list/aux_/preprocessed"), + std::pair("libs/graph/src/python/visitor.hpp", "libs/graph/src/python"), + std::pair("boost/test/detail/config.hpp", "libs/test/src"), + std::pair("boost/test/detail/config.hpp", "libs/test/build"), + std::pair("boost/test/detail/config.hpp", "libs/predef/build.jam"), + std::pair("boost/test/detail/config.hpp", "libs/predef/tools/check"), + std::pair("boost/test/detail/config.hpp", "libs/predef/check"), // libs/predef/check if obsolete, but may still be used + std::pair("boost/typeof.hpp", "boost/typeof/incr_registration_group.hpp"), + std::pair("boost/function_types/detail/pp_loop.hpp", "boost/function_types/detail/pp_cc_loop"), + std::pair("boost/function_types/components.hpp", "boost/function_types/detail/components_impl"), + std::pair("boost/function_types/detail/pp_loop.hpp", "boost/function_types/detail"), + std::pair("boost/math/tools/rational.hpp", "boost/math/tools/detail"), + std::pair("boost/proto/repeat.hpp", "boost/proto/detail/local.hpp"), + std::pair("boost/signals/signal_template.hpp", "boost/function"), + std::pair("boost/preprocessor/slot/counter.hpp", "boost/preprocessor/slot/detail/counter.hpp"), + std::pair("boost/graph/distributed/detail/tag_allocator.hpp", "libs/graph_parallel"), + std::pair("boost/graph/distributed/mpi_process_group.hpp", "libs/graph_parallel"), + std::pair("libs/coroutine/build/Jamfile.v2", "libs/context/src"), + std::pair("libs/coroutine/build/Jamfile.v2", "libs/context/build"), + std::pair("libs/fiber/build/Jamfile.v2", "libs/context/src"), + std::pair("libs/fiber/build/Jamfile.v2", "libs/context/build"), + std::pair("boost/graph/breadth_first_search.hpp", "boost/graph/distributed/concepts.hpp"), + std::pair("boost/graph/breadth_first_search.hpp", "boost/graph/distributed/breadth_first_search.hpp"), + std::pair("boost/graph/connected_components.hpp", "boost/graph/distributed/connected_components.hpp"), + std::pair("boost/graph/depth_first_search.hpp", "boost/graph/distributed/depth_first_search.hpp"), + std::pair("boost/graph/detail/mpi_include.hpp", "boost/graph/detail/empty_header.hpp"), + std::pair("boost/graph/dijkstra_shortest_paths.hpp", "boost/graph/distributed/dijkstra_shortest_paths.hpp"), + std::pair("boost/graph/fruchterman_reingold.hpp", "boost/graph/distributed/fruchterman_reingold.hpp"), + std::pair("boost/graph/graphviz.hpp", "boost/graph/distributed/graphviz.hpp"), + std::pair("boost/graph/one_bit_color_map.hpp", "boost/graph/distributed/one_bit_color_map.hpp"), + std::pair("boost/graph/page_rank.hpp", "boost/graph/distributed/page_rank.hpp"), + std::pair("boost/graph/rmat_graph_generator.hpp", "boost/graph/distributed/rmat_graph_generator.hpp"), + std::pair("boost/graph/strong_components.hpp", "boost/graph/distributed/strong_components.hpp"), + std::pair("boost/graph/two_bit_color_map.hpp", "boost/graph/distributed/two_bit_color_map.hpp"), + std::pair("libs/context/build.jam", "libs/predef/tools/check/predef.jam"), + std::pair("libs/test/build/Jamfile.v2", "libs/predef/tools/check/predef.jam"), + }; + + for(unsigned int n = 0; n < (sizeof(specials)/sizeof(specials[0])); ++n) + { + if(0 == compare_paths(specials[n].first, p)) + { + if(!m_dependencies.count(specials[n].second)) + { + m_dependencies[specials[n].second] = p; // set up dependency tree + add_pending_path(specials[n].second); + } + } + } + +} + +void bcp_implementation::add_file_dependencies(const fs::path& p, bool scanfile) +{ + static const boost::regex e( + "^[[:blank:]]*(?://@bcp[[:blank:]]+([^\\n]*)\n)?#[[:blank:]]*include[[:blank:]]*[\"<]([^\">]+)[\">]" + ); + + if(!m_dependencies.count(p)) + m_dependencies[p] = p; // set terminal dependency + + fileview view; + if(scanfile) + view.open(p); + else + view.open(m_boost_path / p); + if(m_license_mode && !scanfile) + scan_license(p, view); + const int subs[] = { 1, 2 }; + boost::regex_token_iterator i(view.begin(), view.end(), e, subs); + boost::regex_token_iterator j; + while(i != j) + { + // + // *i contains the name of the include file, + // check first for a file of that name in the + // same directory as the file we are scanning, + // and if that fails, then check the boost-root: + // + fs::path include_file; + try{ + std::string discart_message = *i; + ++i; + if(discart_message.size()) + { + // The include is optional and should be discarded: + std::cout << "Optional functionality won't be copied: " << discart_message << std::endl; + std::cout << "Add the file " << *i << " to the list of dependencies to extract to copy this functionality." << std::endl; + ++i; + continue; + } + include_file = i->str(); + fs::path test_file(m_boost_path / p.parent_path() / include_file); + if(fs::exists(test_file) && !fs::is_directory(test_file) && (p.parent_path().string() != "boost")) + { + if(!m_dependencies.count(p.parent_path() / include_file)) + { + m_dependencies[p.parent_path() / include_file] = p; + add_pending_path(p.parent_path() / include_file); + } + } + else if(fs::exists(m_boost_path / include_file)) + { + if(!m_dependencies.count(include_file)) + { + m_dependencies[include_file] = p; + add_pending_path(include_file); + } + } + ++i; + } + catch(const fs::filesystem_error&) + { + std::cerr << "Can't parse filename " << *i << " included by file " << p.string() << std::endl; + ++i; + continue; + } + } + // + // Now we need to scan for Boost.Preprocessor includes that + // are included via preprocessor iteration: + // + static const boost::regex ppfiles("^[[:blank:]]*#[[:blank:]]*define[[:blank:]]+(?:BOOST_PP_FILENAME|BOOST_PP_ITERATION_PARAMS|BOOST_PP_INDIRECT_SELF)(?:[^\\n]|\\\\\\n)+?[\"<]([^\">]+)[\">]"); + i = boost::regex_token_iterator(view.begin(), view.end(), ppfiles, 1); + while(i != j) + { + // + // *i contains the name of the include file, + // check first for a file of that name in the + // same directory as the file we are scanning, + // and if that fails, then check the boost-root: + // + fs::path include_file; + try{ + include_file = i->str(); + } + catch(const fs::filesystem_error&) + { + std::cerr << "Can't parse filename " << *i << " included by file " << p.string() << std::endl; + ++i; + continue; + } + fs::path test_file(m_boost_path / p.parent_path() / include_file); + if(fs::exists(test_file) && !fs::is_directory(test_file) && (p.parent_path().string() != "boost")) + { + if(!m_dependencies.count(p.parent_path() / include_file)) + { + m_dependencies[p.parent_path() / include_file] = p; + add_pending_path(p.parent_path() / include_file); + } + } + else if(fs::exists(m_boost_path / include_file)) + { + if(!m_dependencies.count(include_file)) + { + m_dependencies[include_file] = p; + add_pending_path(include_file); + } + } + else + { + std::cerr << "CAUTION: Boost.Preprocessor iterated file " << include_file.string() << " does not exist." << std::endl; + } + ++i; + } + + // + // Scan for any #include MACRO includes that we don't recognise. + // + // Begin by declaring all of the macros that get #included that + // we know about and are correctly handled as special cases: + // + static const std::string known_macros[] = { + "AUX778076_INCLUDE_STRING", + "BOOST_PP_STRINGIZE(boost/mpl/aux_/preprocessed/AUX778076_PREPROCESSED_HEADER)", + "BOOST_USER_CONFIG", + "BOOST_COMPILER_CONFIG", + "BOOST_STDLIB_CONFIG", + "BOOST_PLATFORM_CONFIG", + "BOOST_PP_FILENAME_1", + "BOOST_PP_ITERATION_PARAMS_1", + "BOOST_PP_FILENAME_2", + "BOOST_PP_ITERATION_PARAMS_2", + "BOOST_PP_FILENAME_3", + "BOOST_PP_ITERATION_PARAMS_3", + "BOOST_PP_FILENAME_4", + "BOOST_PP_ITERATION_PARAMS_4", + "BOOST_PP_FILENAME_5", + "BOOST_PP_ITERATION_PARAMS_5", + "BOOST_PP_INDIRECT_SELF", + "BOOST_PP_INCLUDE_SELF()", + "BOOST_PP_ITERATE", + "BOOST_PP_LOCAL_ITERATE", + "BOOST_PP_ITERATE()", + "BOOST_PP_LOCAL_ITERATE()", + "BOOST_PP_ASSIGN_SLOT(1)", + "BOOST_PP_ASSIGN_SLOT(2)", + "BOOST_PP_ASSIGN_SLOT(3)", + "BOOST_PP_ASSIGN_SLOT(4)", + "BOOST_PP_ASSIGN_SLOT(5)", + "BOOST_ABI_PREFIX", + "BOOST_ABI_SUFFIX", + "BOOST_PP_STRINGIZE(boost/mpl/aux_/preprocessed/AUX_PREPROCESSED_HEADER)", + "BOOST_PP_STRINGIZE(boost/mpl/list/AUX778076_HEADER)", + "BOOST_PP_STRINGIZE(boost/mpl/list/AUX778076_LIST_C_HEADER)", + "BOOST_PP_STRINGIZE(boost/mpl/list/AUX778076_LIST_HEADER)", + "BOOST_PP_STRINGIZE(boost/mpl/map/aux_/preprocessed/AUX778076_HEADER)", + "BOOST_PP_STRINGIZE(boost/mpl/map/AUX778076_MAP_HEADER)", + "BOOST_PP_STRINGIZE(boost/mpl/set/aux_/preprocessed/AUX778076_HEADER)", + "BOOST_PP_STRINGIZE(boost/mpl/set/AUX778076_SET_HEADER)", + "BOOST_PP_STRINGIZE(boost/mpl/set/AUX778076_SET_C_HEADER)", + "BOOST_PP_STRINGIZE(boost/mpl/vector/AUX778076_VECTOR_HEADER)", + "BOOST_PP_STRINGIZE(boost/mpl/vector/aux_/preprocessed/AUX778076_HEADER)", + "BOOST_PP_STRINGIZE(boost/mpl/vector/AUX778076_DEQUE_HEADER)", + "BOOST_PP_STRINGIZE(boost/mpl/vector/AUX778076_VECTOR_C_HEADER)", + "BOOST_REGEX_USER_CONFIG", + "BGL_PYTHON_EVENTS_HEADER", + "B1", + "B2", + "BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()", + "BOOST_SLIST_HEADER", + "BOOST_HASH_SET_HEADER", + "BOOST_HASH_MAP_HEADER", + "BOOST_INTRUSIVE_INVARIANT_ASSERT_INCLUDE", + "BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT_INCLUDE", + "BOOST_INTRUSIVE_SAFE_HOOK_DESTRUCTOR_ASSERT_INCLUDE", + "BOOST_FT_loop", + "BOOST_FT_AL_PREPROCESSED", + "BOOST_FT_AL_INCLUDE_FILE", + "__FILE__", + "BOOST_FT_cc_file", + "BOOST_FT_variate_file", + "BOOST_USER_CONFIG", + "BOOST_HEADER()", + "BOOST_TR1_STD_HEADER(utility)", + "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(tuple))", + "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(random))", + "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(array))", + "BOOST_TR1_HEADER(cmath)", + "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(complex))", + "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(functional))", + "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(memory))", + "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(regex))", + "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(type_traits))", + "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(unordered_map))", + "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(unordered_set))", + "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(utility))", + "BOOST_PROTO_LOCAL_ITERATE()", + "BOOST_SIGNAL_FUNCTION_N_HEADER", + "BOOST_PP_UPDATE_COUNTER()", + }; + + static const boost::regex indirect_includes("^[[:blank:]]*#[[:blank:]]*include[[:blank:]]+([^\"<][^\n]*?)[[:blank:]]*$"); + i = boost::regex_token_iterator(view.begin(), view.end(), indirect_includes, 1); + while(i != j) + { + const std::string* known_macros_end = known_macros + sizeof(known_macros)/sizeof(known_macros[0]); + if(known_macros_end == std::find(known_macros, known_macros_end, i->str())) + { + std::cerr << "CAUTION: don't know how to trace dependencies through macro: \"" << *i << "\" in file: " << p.string() << std::endl; + } + ++i; + } + // + // if the file contains a cpp_main / unit_test_main / test_main + // it is dependent upon Boost.test even if it doesn't + // include any of the Boost.test headers directly. + // + static const boost::regex m("^\\s*int\\s+(?:cpp_main|test_main|unit_test_main)"); + boost::cmatch what; + if(boost::regex_search(view.begin(), view.end(), what, m)) + { + add_dependent_lib("test", p, view); + } + if(!scanfile) + { + // + // grab the name of the library to which the header belongs, + // and if that library has source then add the source to our + // list: + // + // this regex catches boost/libname.hpp or boost/libname/whatever: + // + static const boost::regex lib1("boost/([^\\./]+)(?!detail).*"); + boost::smatch swhat; + std::string gs(p.generic_string()); + if(boost::regex_match(gs, swhat, lib1)) + { + add_dependent_lib(swhat.str(1), p, view); + } + // + // and this one catches boost/x/y/whatever (for example numeric/ublas): + // + static const boost::regex lib2("boost/([^/]+/[^/]+)/(?!detail).*"); + gs = p.generic_string(); + if(boost::regex_match(gs, swhat, lib2)) + { + add_dependent_lib(swhat.str(1), p, view); + } + } + if(m_list_namespaces) + { + // + // scan for top level namespaces and add to our list: + // + static const boost::regex namespace_scanner( + "^(?(view.begin(), view.end(), namespace_scanner, 1); + while(i != j) + { + if(m_top_namespaces.count(*i) == 0) + { + //std::cout << *i << " (Found in " << p << ")" << std::endl; + m_top_namespaces[*i] = p; + } + ++i; + } + } +} \ No newline at end of file diff --git a/libraries/boost_aux/tools/bcp/bcp.hpp b/libraries/boost_aux/tools/bcp/bcp.hpp index ec9b2fbd51..9c63708a47 100644 --- a/libraries/boost_aux/tools/bcp/bcp.hpp +++ b/libraries/boost_aux/tools/bcp/bcp.hpp @@ -39,6 +39,7 @@ class bcp_application virtual void set_namespace(const char* name) = 0; virtual void set_namespace_alias(bool) = 0; virtual void set_namespace_list(bool) = 0; + virtual void add_excluded(const char* p) = 0; virtual int run() = 0; diff --git a/libraries/boost_aux/tools/bcp/bcp_imp.cpp b/libraries/boost_aux/tools/bcp/bcp_imp.cpp index f782a12890..81fb756f17 100644 --- a/libraries/boost_aux/tools/bcp/bcp_imp.cpp +++ b/libraries/boost_aux/tools/bcp/bcp_imp.cpp @@ -1,8 +1,8 @@ /* * * Copyright (c) 2003 Dr John Maddock - * Use, modification and distribution is subject to the - * Boost Software License, Version 1.0. (See accompanying file + * Use, modification and distribution is subject to the + * Boost Software License, Version 1.0. (See accompanying file * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * * This file implements the bcp_implementation virtuals. @@ -18,8 +18,8 @@ #include bcp_implementation::bcp_implementation() - : m_list_mode(false), m_list_summary_mode(false), m_license_mode(false), m_cvs_mode(false), - m_svn_mode(false), m_unix_lines(false), m_scan_mode(false), m_bsl_convert_mode(false), + : m_list_mode(false), m_list_summary_mode(false), m_license_mode(false), m_cvs_mode(false), + m_svn_mode(false), m_unix_lines(false), m_scan_mode(false), m_bsl_convert_mode(false), m_bsl_summary_mode(false), m_namespace_alias(false), m_list_namespaces(false) { } @@ -80,8 +80,8 @@ void bcp_implementation::enable_unix_lines() void bcp_implementation::set_boost_path(const char* p) { - // Hack to strip trailing slashes from the path - m_boost_path = (fs::path(p) / "boost").parent_path(); + // Hack to strip trailing slashes from the path + m_boost_path = (fs::path(p) / "boost").parent_path(); fs::path check = m_boost_path / "boost" / "version.hpp"; if(!fs::exists(check)) { @@ -145,6 +145,16 @@ void bcp_implementation::set_namespace_list(bool b) m_list_mode = b; } +void bcp_implementation::add_excluded(const char* p) +{ + if (!fs::exists(p)) + { + std::cerr << "CAUTION: excluded path " << p << " does not exist." << std::endl; + return; + } + m_excluded.insert(p); +} + fs::path get_short_path(const fs::path& p) { // truncate path no more than "x/y": @@ -219,7 +229,7 @@ int bcp_implementation::run() fs::path exmodule; module = fs::path(*i); exmodule = fs::path(*i + ".hpp"); - + if(m_scan_mode) { // in scan mode each module must be a real file: @@ -256,6 +266,11 @@ int bcp_implementation::run() } ++i; } + while (!m_pending_paths.empty()) + { + add_path(m_pending_paths.front()); + m_pending_paths.pop(); + } // // now perform output: // diff --git a/libraries/boost_aux/tools/bcp/bcp_imp.hpp b/libraries/boost_aux/tools/bcp/bcp_imp.hpp index 4e279cb47f..f7a2a9b058 100644 --- a/libraries/boost_aux/tools/bcp/bcp_imp.hpp +++ b/libraries/boost_aux/tools/bcp/bcp_imp.hpp @@ -13,6 +13,8 @@ #include #include #include +#include +#include #include namespace fs = boost::filesystem; @@ -67,6 +69,7 @@ class bcp_implementation void set_namespace(const char* name); void set_namespace_alias(bool); void set_namespace_list(bool); + void add_excluded(const char* p); virtual int run(); @@ -75,6 +78,7 @@ class bcp_implementation void scan_cvs_path(const fs::path& p); void scan_svn_path(const fs::path& p); void add_path(const fs::path& p); + void add_pending_path(const fs::path& p) { m_pending_paths.push(p); } void add_directory(const fs::path& p); void add_file(const fs::path& p); void copy_path(const fs::path& p); @@ -115,5 +119,7 @@ class bcp_implementation std::string m_namespace_name; // namespace rename. std::set m_lib_names; // List of library binary names std::map m_top_namespaces; // List of top level namespace names + std::queue > m_pending_paths; // Queue of paths we haven't scanned yet. + std::set m_excluded; // paths to ignore in scan }; diff --git a/libraries/boost_aux/tools/bcp/copy_path.cpp b/libraries/boost_aux/tools/bcp/copy_path.cpp index 02590fc06e..6b7a3708ad 100644 --- a/libraries/boost_aux/tools/bcp/copy_path.cpp +++ b/libraries/boost_aux/tools/bcp/copy_path.cpp @@ -1,245 +1,248 @@ -/* - * - * Copyright (c) 2003 Dr John Maddock - * Use, modification and distribution is subject to the - * Boost Software License, Version 1.0. (See accompanying file - * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - * - * This file implements the following: - * void bcp_implementation::copy_path(const fs::path& p) - * void bcp_implementation::create_path(const fs::path& p) - */ - -#include "bcp_imp.hpp" -#include "fileview.hpp" -#include -#include -#include -#include -#include -#include -#include - -struct get_new_library_name -{ - get_new_library_name(const std::string& n) : m_new_name(n) {} - template - std::string operator()(const boost::match_results& what) - { - std::string s = what[0]; - std::string::size_type n = s.find("boost"); - if(n == std::string::npos) - { - s.insert(0, m_new_name); - } - else - { - s.replace(n, 5, m_new_name); - } - return s; - } -private: - std::string m_new_name; -}; - -void bcp_implementation::copy_path(const fs::path& p) -{ - assert(!fs::is_directory(m_boost_path / p)); - if(fs::exists(m_dest_path / p)) - { - std::cout << "Copying (and overwriting) file: " << p.string() << "\n"; - fs::remove(m_dest_path / p); - } - else - std::cout << "Copying file: " << p.string() << "\n"; - // - // create the path to the new file if it doesn't already exist: - // - create_path(p.branch_path()); - // - // do text based copy if requested: - // - if(p.leaf() == "Jamroot") - { - static std::vector v1, v2; - v1.clear(); - v2.clear(); - boost::filesystem::ifstream is((m_boost_path / p)); - std::copy(std::istreambuf_iterator(is), std::istreambuf_iterator(), std::back_inserter(v1)); - - static boost::regex libname_matcher; - if(libname_matcher.empty()) - { - libname_matcher.assign("boost_"); - } - - regex_replace(std::back_inserter(v2), v1.begin(), v1.end(), libname_matcher, m_namespace_name + "_"); - std::swap(v1, v2); - v2.clear(); - - boost::filesystem::ofstream os; - if(m_unix_lines) - os.open((m_dest_path / p), std::ios_base::binary | std::ios_base::out); - else - os.open((m_dest_path / p), std::ios_base::out); - os.write(&*v1.begin(), v1.size()); - os.close(); - } - else if(m_namespace_name.size() && m_lib_names.size() && is_jam_file(p)) - { - static std::vector v1, v2; - v1.clear(); - v2.clear(); - boost::filesystem::ifstream is((m_boost_path / p)); - std::copy(std::istreambuf_iterator(is), std::istreambuf_iterator(), std::back_inserter(v1)); - - static boost::regex libname_matcher; - if(libname_matcher.empty()) - { - std::string re = "\\<"; - re += *m_lib_names.begin(); - for(std::set::const_iterator i = ++m_lib_names.begin(); i != m_lib_names.end(); ++i) - { - re += "|" + *i; - } - re += "\\>"; - libname_matcher.assign(re); - } - - regex_replace(std::back_inserter(v2), v1.begin(), v1.end(), libname_matcher, get_new_library_name(m_namespace_name)); - std::swap(v1, v2); - v2.clear(); - - boost::filesystem::ofstream os; - if(m_unix_lines) - os.open((m_dest_path / p), std::ios_base::binary | std::ios_base::out); - else - os.open((m_dest_path / p), std::ios_base::out); - os.write(&*v1.begin(), v1.size()); - os.close(); - } - else if(m_namespace_name.size() && is_source_file(p)) - { - // - // v1 hold the current content, v2 is temp buffer. - // Each time we do a search and replace the new content - // ends up in v2: we then swap v1 and v2, and clear v2. - // - static std::vector v1, v2; - v1.clear(); - v2.clear(); - boost::filesystem::ifstream is((m_boost_path / p)); - std::copy(std::istreambuf_iterator(is), std::istreambuf_iterator(), std::back_inserter(v1)); - - static const boost::regex namespace_matcher( - "(?|" - "(namespace\\s+)boost(_\\w+)?(?:(\\s*::\\s*)phoenix)?" - "|" - "(namespace\\s+(?:detail::)?)(adstl|phoenix|rapidxml)\\>" - "|" - "()\\" - "|" - "(^\\s*#\\s*define\\s+\\w+\\s+)boost((?:_\\w+)?\\s*)$" - "|" - "(^\\s*#\\s*define[^\\n]+)((?:adstl|phoenix|rapidxml)\\s*)$" - "|" - "()boost(_asio_detail_posix_thread_function|_regex_free_static_mutex)" - "|" - "()\\<(lw_thread_routine|at_thread_exit|on_process_enter|on_process_exit|on_thread_enter|on_thread_exit|tss_cleanup_implemented)\\>" - "|" - "(BOOST_CLASS_REQUIRE4?[^;]*)boost((?:_\\w+)?\\s*,)" - "|" - "(::tr1::|TR1_DECL\\s+)boost(_\\w+\\s*)" // math tr1 - "|" - "(\\(\\s*)boost(\\s*\\))\\s*(\\(\\s*)phoenix(\\s*\\))" - "|" - "(\\(\\s*)boost(\\s*\\))" - ")" - ); - - regex_replace(std::back_inserter(v2), v1.begin(), v1.end(), namespace_matcher, "$1" + m_namespace_name + "$2(?3$3" + m_namespace_name + "phoenix?4$4)", boost::regex_constants::format_all); - std::swap(v1, v2); - v2.clear(); - - if(m_namespace_alias) - { - static const boost::regex namespace_alias( - /* - "namespace\\s+" + m_namespace_name + - "\\s*" - "(" - "\\{" - "(?:" - "(?>[^\\{\\}/]+)" - "(?>" - "(?:" - "(?1)" - "|//[^\\n]+$" - "|/[^/]" - "|(?:^\\s*#[^\\n]*" - "(?:(?<=\\\\)\\n[^\\n]*)*)" - ")" - "[^\\{\\}]+" - ")*" - ")*" - "\\}" - ")" - */ - /* - "(namespace\\s+" + m_namespace_name + - "\\s*\\{.*" - "\\})([^\\{\\};]*)\\z" - */ - "(namespace)(\\s+)(" + m_namespace_name + ")" - "(adstl|phoenix|rapidxml)?(\\s*\\{)" - ); - regex_replace(std::back_inserter(v2), v1.begin(), v1.end(), namespace_alias, - "$1 $3$4 {} $1 (?4$4:boost) = $3$4; $1$2$3$4$5", boost::regex_constants::format_all); - std::swap(v1, v2); - v2.clear(); - } - - boost::filesystem::ofstream os; - if(m_unix_lines) - os.open((m_dest_path / p), std::ios_base::binary | std::ios_base::out); - else - os.open((m_dest_path / p), std::ios_base::out); - if(v1.size()) - os.write(&*v1.begin(), v1.size()); - os.close(); - } - else if(m_unix_lines && !is_binary_file(p)) - { - boost::filesystem::ifstream is((m_boost_path / p)); - std::istreambuf_iterator isi(is); - std::istreambuf_iterator end; - - boost::filesystem::ofstream os((m_dest_path / p), std::ios_base::binary | std::ios_base::out); - std::ostreambuf_iterator osi(os); - - std::copy(isi, end, osi); - } - else - { - // binary copy: - fs::copy_file(m_boost_path / p, m_dest_path / p); - } -} - -void bcp_implementation::create_path(const fs::path& p) -{ - if(!fs::exists(m_dest_path / p)) - { - // recurse then create the path: - create_path(p.branch_path()); - fs::create_directory(m_dest_path / p); - } -} - - +/* + * + * Copyright (c) 2003 Dr John Maddock + * Use, modification and distribution is subject to the + * Boost Software License, Version 1.0. (See accompanying file + * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * + * This file implements the following: + * void bcp_implementation::copy_path(const fs::path& p) + * void bcp_implementation::create_path(const fs::path& p) + */ + +#include "bcp_imp.hpp" +#include "fileview.hpp" +#include +#include +#include +#include +#include +#include +#include +#include + +struct get_new_library_name +{ + get_new_library_name(const std::string& n) : m_new_name(n) {} + template + std::string operator()(const boost::match_results& what) + { + std::string s = what[0]; + std::string::size_type n = s.find("boost"); + if(n == std::string::npos) + { + s.insert(0, m_new_name); + } + else + { + s.replace(n, 5, m_new_name); + } + return s; + } +private: + std::string m_new_name; +}; + +void bcp_implementation::copy_path(const fs::path& p) +{ + BOOST_ASSERT(!fs::is_directory(m_boost_path / p)); + if(fs::exists(m_dest_path / p)) + { + std::cout << "Copying (and overwriting) file: " << p.string() << "\n"; + fs::remove(m_dest_path / p); + } + else + std::cout << "Copying file: " << p.string() << "\n"; + // + // create the path to the new file if it doesn't already exist: + // + create_path(p.parent_path()); + // + // do text based copy if requested: + // + if((p.filename() == "Jamroot") && m_namespace_name.size()) + { + static std::vector v1, v2; + v1.clear(); + v2.clear(); + boost::filesystem::ifstream is((m_boost_path / p)); + std::copy(std::istreambuf_iterator(is), std::istreambuf_iterator(), std::back_inserter(v1)); + + static boost::regex libname_matcher; + if(libname_matcher.empty()) + { + libname_matcher.assign("boost_"); + } + + regex_replace(std::back_inserter(v2), v1.begin(), v1.end(), libname_matcher, m_namespace_name + "_"); + std::swap(v1, v2); + v2.clear(); + + boost::filesystem::ofstream os; + if(m_unix_lines) + os.open((m_dest_path / p), std::ios_base::binary | std::ios_base::out); + else + os.open((m_dest_path / p), std::ios_base::out); + os.write(&*v1.begin(), v1.size()); + os.close(); + } + else if(m_namespace_name.size() && m_lib_names.size() && is_jam_file(p)) + { + static std::vector v1, v2; + v1.clear(); + v2.clear(); + boost::filesystem::ifstream is((m_boost_path / p)); + std::copy(std::istreambuf_iterator(is), std::istreambuf_iterator(), std::back_inserter(v1)); + + static boost::regex libname_matcher; + if(libname_matcher.empty()) + { + std::string re = "\\<"; + re += *m_lib_names.begin(); + for(std::set::const_iterator i = ++m_lib_names.begin(); i != m_lib_names.end(); ++i) + { + re += "|" + *i; + } + re += "\\>"; + libname_matcher.assign(re); + } + + regex_replace(std::back_inserter(v2), v1.begin(), v1.end(), libname_matcher, get_new_library_name(m_namespace_name)); + std::swap(v1, v2); + v2.clear(); + + boost::filesystem::ofstream os; + if(m_unix_lines) + os.open((m_dest_path / p), std::ios_base::binary | std::ios_base::out); + else + os.open((m_dest_path / p), std::ios_base::out); + os.write(&*v1.begin(), v1.size()); + os.close(); + } + else if(m_namespace_name.size() && is_source_file(p)) + { + // + // v1 hold the current content, v2 is temp buffer. + // Each time we do a search and replace the new content + // ends up in v2: we then swap v1 and v2, and clear v2. + // + static std::vector v1, v2; + v1.clear(); + v2.clear(); + boost::filesystem::ifstream is((m_boost_path / p)); + std::copy(std::istreambuf_iterator(is), std::istreambuf_iterator(), std::back_inserter(v1)); + + static const boost::regex namespace_matcher( + "(?|" + "(namespace\\s+)boost(_\\w+)?(?:(\\s*::\\s*)phoenix)?" + "|" + "(namespace\\s+(?:detail::)?)(adstl|phoenix|rapidxml)\\>" + "|" + "()\\" + "|" + "(^\\s*#\\s*define\\s+\\w+\\s+)boost((?:_\\w+)?\\s*)$" + "|" + "(^\\s*#\\s*define[^\\n]+)((?:adstl|phoenix|rapidxml)\\s*)$" + "|" + "()boost(_asio_detail_posix_thread_function|_regex_free_static_mutex)" + "|" + "()\\<(lw_thread_routine|at_thread_exit|on_process_enter|on_process_exit|on_thread_enter|on_thread_exit|tss_cleanup_implemented)\\>" + "|" + "(BOOST_CLASS_REQUIRE4?[^;]*)boost((?:_\\w+)?\\s*,)" + "|" + "(::tr1::|TR1_DECL\\s+)boost(_\\w+\\s*)" // math tr1 + "|" + "(\\(\\s*)boost(\\s*\\))\\s*(\\(\\s*)phoenix(\\s*\\))" + "|" + "(\\(\\s*)boost(\\s*\\))" + "|" + "(BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE[^\\)]*)boost(\\))" + ")" + ); + + regex_replace(std::back_inserter(v2), v1.begin(), v1.end(), namespace_matcher, "$1" + m_namespace_name + "$2(?3$3" + m_namespace_name + "phoenix?4$4)", boost::regex_constants::format_all); + std::swap(v1, v2); + v2.clear(); + + if(m_namespace_alias) + { + static const boost::regex namespace_alias( + /* + "namespace\\s+" + m_namespace_name + + "\\s*" + "(" + "\\{" + "(?:" + "(?>[^\\{\\}/]+)" + "(?>" + "(?:" + "(?1)" + "|//[^\\n]+$" + "|/[^/]" + "|(?:^\\s*#[^\\n]*" + "(?:(?<=\\\\)\\n[^\\n]*)*)" + ")" + "[^\\{\\}]+" + ")*" + ")*" + "\\}" + ")" + */ + /* + "(namespace\\s+" + m_namespace_name + + "\\s*\\{.*" + "\\})([^\\{\\};]*)\\z" + */ + "(namespace)(\\s+)(" + m_namespace_name + ")" + "(adstl|phoenix|rapidxml)?(\\s*\\{)" + ); + regex_replace(std::back_inserter(v2), v1.begin(), v1.end(), namespace_alias, + "$1 $3$4 {} $1 (?4$4:boost) = $3$4; $1$2$3$4$5", boost::regex_constants::format_all); + std::swap(v1, v2); + v2.clear(); + } + + boost::filesystem::ofstream os; + if(m_unix_lines) + os.open((m_dest_path / p), std::ios_base::binary | std::ios_base::out); + else + os.open((m_dest_path / p), std::ios_base::out); + if(v1.size()) + os.write(&*v1.begin(), v1.size()); + os.close(); + } + else if(m_unix_lines && !is_binary_file(p)) + { + boost::filesystem::ifstream is((m_boost_path / p)); + std::istreambuf_iterator isi(is); + std::istreambuf_iterator end; + + boost::filesystem::ofstream os((m_dest_path / p), std::ios_base::binary | std::ios_base::out); + std::ostreambuf_iterator osi(os); + + std::copy(isi, end, osi); + } + else + { + // binary copy: + fs::copy_file(m_boost_path / p, m_dest_path / p); + } +} + +void bcp_implementation::create_path(const fs::path& p) +{ + if(!fs::exists(m_dest_path / p)) + { + // recurse then create the path: + create_path(p.parent_path()); + fs::create_directory(m_dest_path / p); + } +} + + diff --git a/libraries/boost_aux/tools/bcp/file_types.cpp b/libraries/boost_aux/tools/bcp/file_types.cpp index f2b5662341..179b953cc0 100644 --- a/libraries/boost_aux/tools/bcp/file_types.cpp +++ b/libraries/boost_aux/tools/bcp/file_types.cpp @@ -1,72 +1,72 @@ -/* - * - * Copyright (c) 2003 Dr John Maddock - * Use, modification and distribution is subject to the - * Boost Software License, Version 1.0. (See accompanying file - * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - * - * This file implements the following: - * void bcp_implementation::is_source_file(const fs::path& p) - * void bcp_implementation::is_html_file(const fs::path& p) - * void bcp_implementation::is_binary_file(const fs::path& p) - */ - -#include "bcp_imp.hpp" -#include - -bool bcp_implementation::is_source_file(const fs::path& p) -{ - static const boost::regex e( - ".*\\." - "(?:" - "c|cxx|h|hxx|inc|inl|.?pp|yy?" - ")", - boost::regex::perl | boost::regex::icase - ); - return boost::regex_match(p.filename().generic_string(), e); -} - -bool bcp_implementation::is_html_file(const fs::path& p) -{ - static const boost::regex e( - ".*\\." - "(?:" - "html?|css" - ")" - ); - return boost::regex_match(p.filename().generic_string(), e); -} - -bool bcp_implementation::is_binary_file(const fs::path& p) -{ - if(m_cvs_mode || m_svn_mode) - { - std::map::iterator pos = m_cvs_paths.find(p); - if(pos != m_cvs_paths.end()) return pos->second; - } - static const boost::regex e( - ".*\\." - "(?:" - "c|cxx|cpp|h|hxx|hpp|inc|html?|css|mak|in" - ")" - "|" - "(Jamfile|makefile|configure)", - boost::regex::perl | boost::regex::icase); - return !boost::regex_match(p.leaf().generic_string(), e); - -} - -bool bcp_implementation::is_jam_file(const fs::path& p) -{ - static const boost::regex e( - ".*\\." - "(?:" - "jam|v2" - ")" - "|" - "(Jamfile|Jamroot)\\.?", - boost::regex::perl | boost::regex::icase - ); - return boost::regex_match(p.filename().generic_string(), e); -} - +/* + * + * Copyright (c) 2003 Dr John Maddock + * Use, modification and distribution is subject to the + * Boost Software License, Version 1.0. (See accompanying file + * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * + * This file implements the following: + * void bcp_implementation::is_source_file(const fs::path& p) + * void bcp_implementation::is_html_file(const fs::path& p) + * void bcp_implementation::is_binary_file(const fs::path& p) + */ + +#include "bcp_imp.hpp" +#include + +bool bcp_implementation::is_source_file(const fs::path& p) +{ + static const boost::regex e( + ".*\\." + "(?:" + "c|cxx|h|hxx|inc|inl|.?pp|yy?" + ")", + boost::regex::perl | boost::regex::icase + ); + return boost::regex_match(p.filename().generic_string(), e); +} + +bool bcp_implementation::is_html_file(const fs::path& p) +{ + static const boost::regex e( + ".*\\." + "(?:" + "html?|css" + ")" + ); + return boost::regex_match(p.filename().generic_string(), e); +} + +bool bcp_implementation::is_binary_file(const fs::path& p) +{ + if(m_cvs_mode || m_svn_mode) + { + std::map::iterator pos = m_cvs_paths.find(p); + if(pos != m_cvs_paths.end()) return pos->second; + } + static const boost::regex e( + ".*\\." + "(?:" + "c|cxx|cpp|h|hxx|hpp|inc|html?|css|mak|in" + ")" + "|" + "(Jamfile|makefile|configure)", + boost::regex::perl | boost::regex::icase); + return !boost::regex_match(p.filename().generic_string(), e); + +} + +bool bcp_implementation::is_jam_file(const fs::path& p) +{ + static const boost::regex e( + ".*\\." + "(?:" + "jam|v2" + ")" + "|" + "(Jamfile|Jamroot)\\.?", + boost::regex::perl | boost::regex::icase + ); + return boost::regex_match(p.filename().generic_string(), e); +} + diff --git a/libraries/boost_aux/tools/bcp/fileview.cpp b/libraries/boost_aux/tools/bcp/fileview.cpp index 73f51b936b..36e785062c 100644 --- a/libraries/boost_aux/tools/bcp/fileview.cpp +++ b/libraries/boost_aux/tools/bcp/fileview.cpp @@ -1,143 +1,143 @@ -/* - * - * Copyright (c) 2003 Dr John Maddock - * Use, modification and distribution is subject to the - * Boost Software License, Version 1.0. (See accompanying file - * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - * - * This file implements the fileview class - */ - -#include "fileview.hpp" -#include -#include -#include -#include -#include -#include -#include - -struct fileview::implementation -{ - std::vector m_data; -}; - - -// construct: -fileview::fileview() -{ - pimpl.reset(new implementation()); -} - -fileview::fileview(const boost::filesystem::path& p) -{ - pimpl.reset(new implementation()); - open(p); -} - -fileview::~fileview() -{ -} - -fileview::fileview(const fileview& ) -{ -} - -fileview& fileview::operator=(const fileview& that) -{ - pimpl = that.pimpl; - return *this; -} - -void fileview::close() -{ - cow(); - pimpl->m_data.clear(); -} - -void fileview::open(const boost::filesystem::path& p) -{ - cow(); - boost::filesystem::ifstream is(p); - if(!is) - { - std::string msg("Bad file name: "); - msg += p.string(); - std::runtime_error e(msg); - boost::throw_exception(e); - } - std::istreambuf_iterator in(is); - std::istreambuf_iterator end; - std::copy(in, end, std::back_inserter(pimpl->m_data)); -} - -// iterators: -fileview::const_iterator fileview::begin() const -{ - return pimpl->m_data.size() ? &(pimpl->m_data[0]) : 0; -} - -fileview::const_iterator fileview::end() const -{ - return begin() + pimpl->m_data.size(); -} - -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -fileview::const_reverse_iterator fileview::rbegin() const -{ - return const_reverse_iterator(end()); -} - -fileview::const_reverse_iterator fileview::rend() const -{ - return const_reverse_iterator(begin()); -} -#endif - -// capacity: -fileview::size_type fileview::size() const -{ - return pimpl->m_data.size(); -} - -fileview::size_type fileview::max_size() const -{ - return pimpl->m_data.max_size(); -} - -bool fileview::empty() const -{ - return pimpl->m_data.empty(); -} - -// element access: -fileview::const_reference fileview::operator[](fileview::size_type n) const -{ - return pimpl->m_data[n]; -} - -fileview::const_reference fileview::at(size_type n) const -{ - return pimpl->m_data.at(n); -} - -fileview::const_reference fileview::front() const -{ - return pimpl->m_data.front(); -} - -fileview::const_reference fileview::back() const -{ - return pimpl->m_data.back(); -} - -void fileview::swap(fileview& that) -{ - pimpl.swap(that.pimpl); -} - -void fileview::cow() -{ - if(!pimpl.unique()) - pimpl.reset(new implementation(*pimpl)); -} +/* + * + * Copyright (c) 2003 Dr John Maddock + * Use, modification and distribution is subject to the + * Boost Software License, Version 1.0. (See accompanying file + * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * + * This file implements the fileview class + */ + +#include "fileview.hpp" +#include +#include +#include +#include +#include +#include +#include + +struct fileview::implementation +{ + std::vector m_data; +}; + + +// construct: +fileview::fileview() +{ + pimpl.reset(new implementation()); +} + +fileview::fileview(const boost::filesystem::path& p) +{ + pimpl.reset(new implementation()); + open(p); +} + +fileview::~fileview() +{ +} + +fileview::fileview(const fileview& ) +{ +} + +fileview& fileview::operator=(const fileview& that) +{ + pimpl = that.pimpl; + return *this; +} + +void fileview::close() +{ + cow(); + pimpl->m_data.clear(); +} + +void fileview::open(const boost::filesystem::path& p) +{ + cow(); + boost::filesystem::ifstream is(p); + if(!is) + { + std::string msg("Bad file name: "); + msg += p.string(); + std::runtime_error e(msg); + boost::throw_exception(e); + } + std::istreambuf_iterator in(is); + std::istreambuf_iterator end; + std::copy(in, end, std::back_inserter(pimpl->m_data)); +} + +// iterators: +fileview::const_iterator fileview::begin() const +{ + return pimpl->m_data.size() ? &(pimpl->m_data[0]) : 0; +} + +fileview::const_iterator fileview::end() const +{ + return begin() + pimpl->m_data.size(); +} + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +fileview::const_reverse_iterator fileview::rbegin() const +{ + return const_reverse_iterator(end()); +} + +fileview::const_reverse_iterator fileview::rend() const +{ + return const_reverse_iterator(begin()); +} +#endif + +// capacity: +fileview::size_type fileview::size() const +{ + return pimpl->m_data.size(); +} + +fileview::size_type fileview::max_size() const +{ + return pimpl->m_data.max_size(); +} + +bool fileview::empty() const +{ + return pimpl->m_data.empty(); +} + +// element access: +fileview::const_reference fileview::operator[](fileview::size_type n) const +{ + return pimpl->m_data[n]; +} + +fileview::const_reference fileview::at(size_type n) const +{ + return pimpl->m_data.at(n); +} + +fileview::const_reference fileview::front() const +{ + return pimpl->m_data.front(); +} + +fileview::const_reference fileview::back() const +{ + return pimpl->m_data.back(); +} + +void fileview::swap(fileview& that) +{ + pimpl.swap(that.pimpl); +} + +void fileview::cow() +{ + if(!pimpl.unique()) + pimpl.reset(new implementation(*pimpl)); +} diff --git a/libraries/ext-boost.jam b/libraries/ext-boost.jam index 258d409bb1..fea713fa5f 100644 --- a/libraries/ext-boost.jam +++ b/libraries/ext-boost.jam @@ -111,12 +111,18 @@ rule init ( version : location : options * ) local version-tokens = [ regex.split $(version) \\. ] ; local boost-basename = "boost_$(version-tokens:J=_)" ; - if [ path.exists $(location:D)/$(boost-basename).tar.bz2 ] + local ext ; + if [ path.exists $(location:D)/$(boost-basename).tar.bz2 ] { ext = tar.bz2 ; } + else if [ path.exists $(location:D)/$(boost-basename).tbz2 ] { ext = tbz2 ; } + else if [ path.exists $(location:D)/$(boost-basename).tar.gz ] { ext = tar.gz ; } + else if [ path.exists $(location:D)/$(boost-basename).tgz ] { ext = tgz ; } + + if [ path.exists $(location:D)/$(boost-basename).$(ext) ] { # extract boost tarball tar.extract # tar filepath - $(boost-basename).tar.bz2 + $(boost-basename).$(ext) : # include patterns $(boost-basename)/boost*.?pp $(boost-basename)/boost*.h @@ -193,7 +199,9 @@ rule init ( version : location : options * ) shared:BOOST_FILESYSTEM_DYN_LINK=1 static:BOOST_FILESYSTEM_STATIC_LINK=1 BOOST_FILESYSTEM_NO_LIB=1 - #BOOST_FILESYSTEM_NO_DEPRECATED + BOOST_FILESYSTEM_NO_CXX20_ATOMIC_REF + BOOST_FILESYSTEM_ALLOW_DEPRECATED + #BOOST_FILESYSTEM_NO_DEPRECATED @filesystem-requirements system : @@ -201,8 +209,10 @@ rule init ( version : location : options * ) shared:BOOST_FILESYSTEM_DYN_LINK=1 static:BOOST_FILESYSTEM_STATIC_LINK=1 shared:BOOST_ALL_DYN_LINK=1 - #BOOST_FILESYSTEM_NO_DEPRECATED - msvc:BOOST_USE_WINAPI_VERSION=0x0501 + BOOST_FILESYSTEM_NO_CXX20_ATOMIC_REF + BOOST_FILESYSTEM_ALLOW_DEPRECATED + #BOOST_FILESYSTEM_NO_DEPRECATED + msvc:BOOST_USE_WINAPI_VERSION=0x0501 system ; diff --git a/libraries/freetype-2.4.7.tar.bz2 b/libraries/freetype-2.4.7.tar.bz2 deleted file mode 100644 index a381177874..0000000000 Binary files a/libraries/freetype-2.4.7.tar.bz2 and /dev/null differ diff --git a/libraries/freetype-VER-2-13-3.tar.bz2 b/libraries/freetype-VER-2-13-3.tar.bz2 new file mode 100644 index 0000000000..aa1364b470 Binary files /dev/null and b/libraries/freetype-VER-2-13-3.tar.bz2 differ diff --git a/libraries/freetype.jam b/libraries/freetype.jam index 0ef61b90e6..45332d8906 100644 --- a/libraries/freetype.jam +++ b/libraries/freetype.jam @@ -64,7 +64,7 @@ rule init ( version ? : location : options * ) [ src base ftbase ] [ src base ftsystem ftinit ftglyph ftmm ftbdf ftbbox ftdebug - ftxf86 fttype1 ftpfr ftstroke ftwinfnt ftotval ftbitmap + fttype1 ftpfr ftstroke ftwinfnt ftotval ftbitmap ftsynth ftgxval ftlcdfil ftgasp ftpatent ] [ src bdf bdf ] [ src cache ftcache ] diff --git a/libraries/gd.jam b/libraries/gd.jam index 1929687bd0..5de0d962a3 100644 --- a/libraries/gd.jam +++ b/libraries/gd.jam @@ -80,9 +80,9 @@ rule init ( version ? : location : options * ) using ext-png : 1.5.6 : $(PNG_SOURCE) ; local freetype-src-location = [ feature.get-values : $(options) ] ; - freetype-src-location ?= $(location)/../freetype-2.4.7 ; + freetype-src-location ?= $(location)/../freetype-2.13.3 ; path-constant FREETYPE_SOURCE : $(freetype-src-location[1]) ; - using freetype : 2.4.7 : $(FREETYPE_SOURCE) : $(options) ; + using freetype : 2.13.3 : $(FREETYPE_SOURCE) : $(options) ; if [ path.exists $(location).tar.bz2 ] { diff --git a/libraries/tar.jam b/libraries/tar.jam index 69202bb703..2b088bfa7a 100644 --- a/libraries/tar.jam +++ b/libraries/tar.jam @@ -93,13 +93,14 @@ class create-tar-target-class : basic-target self.pwd = [ path.make [ path.pwd ] ] ; self.anchor = $(self.pwd) ; self.tar-args += -C [ path.native $(self.anchor) ] ; + self.tar-excludes = "" ; for local s in $(sources) { add-source $(s) ; } - self.tar-args = [ sequence.join $(self.tar-args) : " " ] ; + #self.tar-args = [ sequence.join $(self.tar-excludes) $(self.tar-args) : " " ] ; #echo tar: $(self.tar-args) ; basic-target.__init__ $(name) : $(project) : $(non-file-sources) : $(requirements) : $(default-build) : $(usage-requirements) ; @@ -133,7 +134,7 @@ class create-tar-target-class : basic-target local actual-result = [ $(t).actualize ] ; ALWAYS $(actual-result) ; - TAR_ARGS on $(actual-result) = $(self.tar-args) ; + TAR_ARGS on $(actual-result) = $(self.tar-excludes) $(self.tar-args) ; return [ property-set.empty ] $(t) ; } @@ -152,7 +153,7 @@ class create-tar-target-class : basic-target } else if $(possible-exclude) { - self.tar-args += --exclude \"$(possible-exclude)\" ; + self.tar-excludes += --exclude \"$(possible-exclude)\" ; } else { diff --git a/pwiz.vcxproj b/pwiz.vcxproj index c20ac80837..e064d3ab57 100644 --- a/pwiz.vcxproj +++ b/pwiz.vcxproj @@ -65,8 +65,8 @@ PWIZ_READER_THERMO;PWIZ_READER_AGILENT;PWIZ_READER_BRUKER;PWIZ_READER_WATERS;PWIZ_READER_ABI;PWIZ_READER_ABI_T2D;WIN32;USE_RAW_PTR;$(NMakePreprocessorDefinitions) PWIZ_READER_THERMO;PWIZ_READER_AGILENT;PWIZ_READER_BRUKER;PWIZ_READER_WATERS;PWIZ_READER_ABI;PWIZ_READER_ABI_T2D;WIN32;USE_RAW_PTR;$(NMakePreprocessorDefinitions) - $(SolutionDir);$(SolutionDir)libraries\boost_aux;$(SolutionDir)libraries\boost_1_76_0;$(SolutionDir)libraries\SQLite;$(SolutionDir)libraries\CSpline;$(SolutionDir)libraries\Eigen;$(IncludePath) - $(SolutionDir);$(SolutionDir)libraries\boost_aux;$(SolutionDir)libraries\boost_1_76_0;$(SolutionDir)libraries\SQLite;$(SolutionDir)libraries\CSpline;$(SolutionDir)libraries\Eigen;$(IncludePath) + $(SolutionDir);$(SolutionDir)libraries\boost_aux;$(SolutionDir)libraries\boost_1_86_0;$(SolutionDir)libraries\SQLite;$(SolutionDir)libraries\CSpline;$(SolutionDir)libraries\Eigen;$(IncludePath) + $(SolutionDir);$(SolutionDir)libraries\boost_aux;$(SolutionDir)libraries\boost_1_86_0;$(SolutionDir)libraries\SQLite;$(SolutionDir)libraries\CSpline;$(SolutionDir)libraries\Eigen;$(IncludePath) true @@ -81,6 +81,7 @@ + true PWIZ_READER_THERMO;PWIZ_READER_AGILENT;PWIZ_READER_BRUKER;PWIZ_READER_WATERS;PWIZ_READER_ABI;PWIZ_READER_ABI_T2D;PWIZ_READER_SHIMADZU;PWIZ_READER_UNIFI;WIN32;PWIZ_READER_BRUKER_WITH_COMPASSXTRACT;PWIZ_READER_UNIFI;PWIZ_READER_UIMF;PWIZ_READER_MOBILION;%(PreprocessorDefinitions) true diff --git a/pwiz/analysis/frequency/FrequencyEstimatorPhysicalModel.cpp b/pwiz/analysis/frequency/FrequencyEstimatorPhysicalModel.cpp index 5a5c8fe31d..3c8cfdebc8 100644 --- a/pwiz/analysis/frequency/FrequencyEstimatorPhysicalModel.cpp +++ b/pwiz/analysis/frequency/FrequencyEstimatorPhysicalModel.cpp @@ -29,7 +29,6 @@ #include "pwiz/utility/misc/Std.hpp" #include "boost/filesystem/operations.hpp" -#include "boost/filesystem/convenience.hpp" #include "boost/filesystem/fstream.hpp" #include "boost/filesystem/exception.hpp" diff --git a/pwiz/analysis/peakdetect/FeatureDetectorPeakelTest.cpp b/pwiz/analysis/peakdetect/FeatureDetectorPeakelTest.cpp index bce5302560..67af341c56 100644 --- a/pwiz/analysis/peakdetect/FeatureDetectorPeakelTest.cpp +++ b/pwiz/analysis/peakdetect/FeatureDetectorPeakelTest.cpp @@ -144,7 +144,7 @@ int main(int argc, char* argv[]) // hack to allow running unit test from a different directory: // Jamfile passes full path to specified input file. // we want the path, so we can ignore filename - datadir = bfs::path(argv[i]).branch_path(); + datadir = bfs::path(argv[i]).parent_path(); } test(datadir); diff --git a/pwiz/analysis/peakdetect/FeatureDetectorSimpleTest.cpp b/pwiz/analysis/peakdetect/FeatureDetectorSimpleTest.cpp index 8830327d33..17084d8a60 100644 --- a/pwiz/analysis/peakdetect/FeatureDetectorSimpleTest.cpp +++ b/pwiz/analysis/peakdetect/FeatureDetectorSimpleTest.cpp @@ -130,7 +130,7 @@ int main(int argc, char* argv[]) // hack to allow running unit test from a different directory: // Jamfile passes full path to specified input file. // we want the path, so we can ignore filename - datadir = bfs::path(argv[i]).branch_path(); + datadir = bfs::path(argv[i]).parent_path(); } testFeatureDetectorSimple(datadir); diff --git a/pwiz/analysis/peakdetect/FeatureDetectorTuningTest.cpp b/pwiz/analysis/peakdetect/FeatureDetectorTuningTest.cpp index 69117d483e..e898c18b76 100644 --- a/pwiz/analysis/peakdetect/FeatureDetectorTuningTest.cpp +++ b/pwiz/analysis/peakdetect/FeatureDetectorTuningTest.cpp @@ -251,7 +251,7 @@ int main(int argc, char* argv[]) // hack to allow running unit test from a different directory: // Jamfile passes full path to specified input file. // we want the path, so we can ignore filename - datadir = bfs::path(argv[i]).branch_path(); + datadir = bfs::path(argv[i]).parent_path(); } test(datadir); diff --git a/pwiz/analysis/peakdetect/FeatureModelerTest.cpp b/pwiz/analysis/peakdetect/FeatureModelerTest.cpp index 330aff55b3..906707ce96 100644 --- a/pwiz/analysis/peakdetect/FeatureModelerTest.cpp +++ b/pwiz/analysis/peakdetect/FeatureModelerTest.cpp @@ -125,7 +125,7 @@ int main(int argc, char* argv[]) // hack to allow running unit test from a different directory: // Jamfile passes full path to specified input file. // we want the path, so we can ignore filename - datadir = bfs::path(argv[i]).branch_path(); + datadir = bfs::path(argv[i]).parent_path(); } test(datadir); diff --git a/pwiz/analysis/peakdetect/msextract.cpp b/pwiz/analysis/peakdetect/msextract.cpp index ed87abeaea..2db21972d3 100755 --- a/pwiz/analysis/peakdetect/msextract.cpp +++ b/pwiz/analysis/peakdetect/msextract.cpp @@ -35,7 +35,6 @@ #include "pwiz/utility/minimxml/XMLWriter.hpp" #include "boost/program_options.hpp" #include "boost/filesystem/path.hpp" -#include "boost/filesystem/convenience.hpp" #include "boost/iostreams/positioning.hpp" #include "boost/tuple/tuple_comparison.hpp" #include "pwiz/utility/misc/Std.hpp" diff --git a/pwiz/analysis/spectrum_processing/PrecursorRecalculatorDefaultTest.cpp b/pwiz/analysis/spectrum_processing/PrecursorRecalculatorDefaultTest.cpp index 29d7835660..f3bbf81f07 100644 --- a/pwiz/analysis/spectrum_processing/PrecursorRecalculatorDefaultTest.cpp +++ b/pwiz/analysis/spectrum_processing/PrecursorRecalculatorDefaultTest.cpp @@ -633,7 +633,7 @@ int main(int argc, char* argv[]) // hack to allow running unit test from a different directory: // Jamfile passes full path to specified input file. // we want the path, so we can ignore filename - datadir = bfs::path(argv[i]).branch_path(); + datadir = bfs::path(argv[i]).parent_path(); } runTests(datadir); diff --git a/pwiz/analysis/spectrum_processing/SpectrumList_MZRefinerTest.cpp b/pwiz/analysis/spectrum_processing/SpectrumList_MZRefinerTest.cpp index b6f6cee78e..9c1c115678 100644 --- a/pwiz/analysis/spectrum_processing/SpectrumList_MZRefinerTest.cpp +++ b/pwiz/analysis/spectrum_processing/SpectrumList_MZRefinerTest.cpp @@ -151,7 +151,7 @@ int main(int argc, char* argv[]) // hack to allow running unit test from a different directory: // Jamfile passes full path to specified input file. // we want the path, so we can ignore filename - datadir = bfs::path(argv[i]).branch_path(); + datadir = bfs::path(argv[i]).parent_path(); } if (argc>1 && !strcmp(argv[1],"-v")) os_ = &cout; diff --git a/pwiz/analysis/spectrum_processing/SpectrumList_PrecursorRecalculatorTest.cpp b/pwiz/analysis/spectrum_processing/SpectrumList_PrecursorRecalculatorTest.cpp index f7fc6292f5..34ca48d873 100644 --- a/pwiz/analysis/spectrum_processing/SpectrumList_PrecursorRecalculatorTest.cpp +++ b/pwiz/analysis/spectrum_processing/SpectrumList_PrecursorRecalculatorTest.cpp @@ -108,7 +108,7 @@ int main(int argc, char* argv[]) // hack to allow running unit test from a different directory: // Jamfile passes full path to specified input file. // we want the path, so we can ignore filename - datadir = bfs::path(argv[i]).branch_path(); + datadir = bfs::path(argv[i]).parent_path(); } if (argc>1 && !strcmp(argv[1],"-v")) os_ = &cout; diff --git a/pwiz/analysis/spectrum_processing/SpectrumList_PrecursorRefineTest.cpp b/pwiz/analysis/spectrum_processing/SpectrumList_PrecursorRefineTest.cpp index e11c6bb723..01f461a3d6 100644 --- a/pwiz/analysis/spectrum_processing/SpectrumList_PrecursorRefineTest.cpp +++ b/pwiz/analysis/spectrum_processing/SpectrumList_PrecursorRefineTest.cpp @@ -109,7 +109,7 @@ int main(int argc, char* argv[]) // hack to allow running unit test from a different directory: // Jamfile passes full path to specified input file. // we want the path, so we can ignore filename - datadir = bfs::path(argv[i]).branch_path(); + datadir = bfs::path(argv[i]).parent_path(); } if (argc>1 && !strcmp(argv[1],"-v")) os_ = &cout; diff --git a/pwiz/data/common/cvgen.cpp b/pwiz/data/common/cvgen.cpp index 2798a8cb10..92c9898ded 100644 --- a/pwiz/data/common/cvgen.cpp +++ b/pwiz/data/common/cvgen.cpp @@ -613,7 +613,7 @@ int main(int argc, char* argv[]) try { - bfs::path exeDir(bfs::path(argv[0]).branch_path()); + bfs::path exeDir(bfs::path(argv[0]).parent_path()); vector obos; map enumMultiplierByPrefix; diff --git a/pwiz/data/msdata/DefaultReaderList.cpp b/pwiz/data/msdata/DefaultReaderList.cpp index fc868aeca9..6781183549 100755 --- a/pwiz/data/msdata/DefaultReaderList.cpp +++ b/pwiz/data/msdata/DefaultReaderList.cpp @@ -62,8 +62,8 @@ void appendSourceFile(const string& filename, MSData& msd) { SourceFilePtr sourceFile(new SourceFile); bfs::path p(filename); - sourceFile->id = sourceFile->name = BFS_STRING(p.leaf()); - sourceFile->location = "file:///" + BFS_COMPLETE(p.branch_path()).string(); + sourceFile->id = sourceFile->name = BFS_STRING(p.filename()); + sourceFile->location = "file:///" + BFS_COMPLETE(p.parent_path()).string(); msd.fileDescription.sourceFilePtrs.push_back(sourceFile); } @@ -394,8 +394,8 @@ PWIZ_API_DECL void Reader_BTDX::read(const string& filename, SourceFilePtr sourceFile(new SourceFile); sourceFile->id = "BTDX1"; bfs::path p(filename); - sourceFile->name = BFS_STRING(p.leaf()); - sourceFile->location = "file:///" + BFS_COMPLETE(p.branch_path()).string(); + sourceFile->name = BFS_STRING(p.filename()); + sourceFile->location = "file:///" + BFS_COMPLETE(p.parent_path()).string(); result.fileDescription.sourceFilePtrs.push_back(sourceFile); result.id = result.run.id = bfs::basename(filename); diff --git a/pwiz/data/msdata/Serializer_mzXML.cpp b/pwiz/data/msdata/Serializer_mzXML.cpp index 5c4b525eb5..8af6263ba4 100644 --- a/pwiz/data/msdata/Serializer_mzXML.cpp +++ b/pwiz/data/msdata/Serializer_mzXML.cpp @@ -161,7 +161,7 @@ string translate_SourceFileTypeToRunID(const SourceFile& sf, CVID sourceFileType // insane: location="file://path/to" name="source.raw" case MS_Waters_raw_format: if (nameExtension == ".dat" && locationExtension == ".raw") - return bfs::basename(bfs::path(sf.location).leaf()); + return bfs::basename(bfs::path(sf.location).filename()); else if (nameExtension == ".raw") return bfs::basename(sf.name); return ""; @@ -169,34 +169,34 @@ string translate_SourceFileTypeToRunID(const SourceFile& sf, CVID sourceFileType // location="file://path/to/source.d" name="Analysis.yep" case MS_Bruker_Agilent_YEP_format: if (nameExtension == ".yep" && locationExtension == ".d") - return bfs::basename(bfs::path(sf.location).leaf()); + return bfs::basename(bfs::path(sf.location).filename()); return ""; // location="file://path/to/source.d" name="Analysis.baf" case MS_Bruker_BAF_format: if (nameExtension == ".baf" && locationExtension == ".d") - return bfs::basename(bfs::path(sf.location).leaf()); + return bfs::basename(bfs::path(sf.location).filename()); return ""; // location="file://path/to/source.d" name="Analysis.tdf" case MS_Bruker_TDF_format: if (nameExtension == ".tdf" && locationExtension == ".d") - return bfs::basename(bfs::path(sf.location).leaf()); + return bfs::basename(bfs::path(sf.location).filename()); return ""; // location="file://path/to/source.d" name="Analysis.tsf" case MS_Bruker_TSF_format: if (nameExtension == ".tsf" && locationExtension == ".d") - return bfs::basename(bfs::path(sf.location).leaf()); + return bfs::basename(bfs::path(sf.location).filename()); return ""; // location="file://path/to/source.d/AcqData" name="msprofile.bin" case MS_Agilent_MassHunter_format: - if (bfs::path(sf.location).leaf() == "AcqData" && + if (bfs::path(sf.location).filename() == "AcqData" && (bal::iends_with(sf.name, "msprofile.bin") || bal::iends_with(sf.name, "mspeak.bin") || bal::iends_with(sf.name, "msscan.bin"))) - return bfs::basename(bfs::path(sf.location).parent_path().leaf()); + return bfs::basename(bfs::path(sf.location).parent_path().filename()); return ""; // location="file://path/to" name="source.mzXML" @@ -1142,9 +1142,9 @@ void fillInMetadata(MSData& msd) // path/to/source/1A/1/1SRef/fid, path/to/source/1B/1/1SRef/fid, lcp: path/to/source/1, run id: source (not "1") // path/to/source/1A/1/1SRef/fid, path/to/source/2A/1/1SRef/fid, lcp: path/to/source/, run id: source if (*lcp.rbegin() == '/') - msd.id = msd.run.id = BFS_STRING(bfs::path(lcp).leaf()); + msd.id = msd.run.id = BFS_STRING(bfs::path(lcp).filename()); else - msd.id = msd.run.id = BFS_STRING(bfs::path(lcp).parent_path().leaf()); + msd.id = msd.run.id = BFS_STRING(bfs::path(lcp).parent_path().filename()); } } diff --git a/pwiz/data/vendor_readers/ABI/Reader_ABI.cpp b/pwiz/data/vendor_readers/ABI/Reader_ABI.cpp index e271f8ea3d..93fcc9f1e0 100644 --- a/pwiz/data/vendor_readers/ABI/Reader_ABI.cpp +++ b/pwiz/data/vendor_readers/ABI/Reader_ABI.cpp @@ -82,8 +82,8 @@ void fillInMetadata(const string& wiffpath, MSData& msd, WiffFilePtr wifffile, SourceFilePtr sourceFile(new SourceFile); bfs::path p(wiffpath); sourceFile->id = "WIFF"; - sourceFile->name = BFS_STRING(p.leaf()); - string location = BFS_COMPLETE(p.branch_path()).string(); + sourceFile->name = BFS_STRING(p.filename()); + string location = BFS_COMPLETE(p.parent_path()).string(); if (location.empty()) location = "."; sourceFile->location = "file://" + location; sourceFile->set(MS_WIFF_nativeID_format); @@ -98,8 +98,8 @@ void fillInMetadata(const string& wiffpath, MSData& msd, WiffFilePtr wifffile, { SourceFilePtr sourceFile(new SourceFile); sourceFile->id = "WIFFSCAN"; - sourceFile->name = BFS_STRING(wiffscan.leaf()); - string location = BFS_COMPLETE(wiffscan.branch_path()).string(); + sourceFile->name = BFS_STRING(wiffscan.filename()); + string location = BFS_COMPLETE(wiffscan.parent_path()).string(); if (location.empty()) location = "."; sourceFile->location = "file://" + location; sourceFile->set(MS_WIFF_nativeID_format); @@ -261,7 +261,7 @@ void Reader_ABI::read(const string& filename, catch (exception& e) { // TODO: make this a critical logged warning - cerr << "[Reader_ABI::read] Error opening run " << i << " in " << bfs::path(filename).leaf() << ":\n" << e.what() << endl; + cerr << "[Reader_ABI::read] Error opening run " << i << " in " << bfs::path(filename).filename() << ":\n" << e.what() << endl; } } } diff --git a/pwiz/data/vendor_readers/ABI/T2D/Reader_ABI_T2D.cpp b/pwiz/data/vendor_readers/ABI/T2D/Reader_ABI_T2D.cpp index 2e2fce4c76..e351f8d8f4 100644 --- a/pwiz/data/vendor_readers/ABI/T2D/Reader_ABI_T2D.cpp +++ b/pwiz/data/vendor_readers/ABI/T2D/Reader_ABI_T2D.cpp @@ -80,19 +80,19 @@ void fillInSources(const string& datapath, MSData& msd, DataPtr t2d_data) { // in "/foo/bar/SomeT2Ds/MS/A1.t2d", replace "/foo/bar/SomeT2Ds/" with "" so relativePath is "MS/A1.t2d" bfs::path relativePath = t2d_filepath; - if (rootpath.has_branch_path()) - relativePath = bal::replace_first_copy(relativePath.string(), rootpath.branch_path().string() + "/", ""); + if (rootpath.has_parent_path()) + relativePath = bal::replace_first_copy(relativePath.string(), rootpath.parent_path().string() + "/", ""); SourceFilePtr sourceFile(new SourceFile); sourceFile->id = relativePath.string(); - sourceFile->name = BFS_STRING(relativePath.leaf()); + sourceFile->name = BFS_STRING(relativePath.filename()); // relativePath: \MS\A1.t2d // rootpath: c:\path\to\\A1.t2d - bfs::path location = rootpath.has_branch_path() ? - BFS_COMPLETE(rootpath.branch_path() / relativePath) : + bfs::path location = rootpath.has_parent_path() ? + BFS_COMPLETE(rootpath.parent_path() / relativePath) : BFS_COMPLETE(relativePath); // uses initial path - sourceFile->location = "file://" + location.branch_path().string(); + sourceFile->location = "file://" + location.parent_path().string(); sourceFile->set(MS_SCIEX_TOF_TOF_T2D_nativeID_format); sourceFile->set(MS_SCIEX_TOF_TOF_T2D_format); diff --git a/pwiz/data/vendor_readers/Agilent/Reader_Agilent.cpp b/pwiz/data/vendor_readers/Agilent/Reader_Agilent.cpp index 4dfbd9bbed..5587b82dd6 100644 --- a/pwiz/data/vendor_readers/Agilent/Reader_Agilent.cpp +++ b/pwiz/data/vendor_readers/Agilent/Reader_Agilent.cpp @@ -161,9 +161,9 @@ void fillInMetadata(const string& rawpath, MassHunterDataPtr rawfile, MSData& ms continue; SourceFilePtr sourceFile(new SourceFile); - sourceFile->id = BFS_STRING(sourcePath.leaf()); - sourceFile->name = BFS_STRING(sourcePath.leaf()); - sourceFile->location = "file:///" + BFS_GENERIC_STRING(BFS_COMPLETE(sourcePath.branch_path())); + sourceFile->id = BFS_STRING(sourcePath.filename()); + sourceFile->name = BFS_STRING(sourcePath.filename()); + sourceFile->location = "file:///" + BFS_GENERIC_STRING(BFS_COMPLETE(sourcePath.parent_path())); sourceFile->set(MS_Agilent_MassHunter_nativeID_format); sourceFile->set(MS_Agilent_MassHunter_format); msd.fileDescription.sourceFilePtrs.push_back(sourceFile); diff --git a/pwiz/data/vendor_readers/Bruker/Reader_Bruker.cpp b/pwiz/data/vendor_readers/Bruker/Reader_Bruker.cpp index dcdf4bdd91..915f6114dc 100644 --- a/pwiz/data/vendor_readers/Bruker/Reader_Bruker.cpp +++ b/pwiz/data/vendor_readers/Bruker/Reader_Bruker.cpp @@ -230,7 +230,7 @@ void Reader_Bruker::read(const string& filename, // trim filename from end of source path if necessary (it's not valid to pass to CompassXtract) bfs::path rootpath = filename; if (bfs::is_regular_file(rootpath)) - rootpath = rootpath.branch_path(); + rootpath = rootpath.parent_path(); CompassDataPtr compassDataPtr(CompassData::create(rootpath.string(), config.combineIonMobilitySpectra, format, config.preferOnlyMsLevel, config.allowMsMsWithoutPrecursor, config.isolationMzAndMobilityFilter)); diff --git a/pwiz/data/vendor_readers/Bruker/Reader_Bruker_Detail.cpp b/pwiz/data/vendor_readers/Bruker/Reader_Bruker_Detail.cpp index 3a110e7928..90c4bc9ed2 100644 --- a/pwiz/data/vendor_readers/Bruker/Reader_Bruker_Detail.cpp +++ b/pwiz/data/vendor_readers/Bruker/Reader_Bruker_Detail.cpp @@ -24,7 +24,6 @@ #include "pwiz/utility/misc/String.hpp" #include "pwiz/utility/misc/Filesystem.hpp" #include "pwiz/utility/misc/Std.hpp" -#include "boost/filesystem/convenience.hpp" #include "pwiz/data/msdata/Reader.hpp" using namespace pwiz::vendor_api::Bruker; @@ -47,9 +46,9 @@ Reader_Bruker_Format format(const string& path) { // Special cases for identifying direct paths to fid/Analysis.yep/Analysis.baf/.U2 // Note that direct paths to baf or u2 will fail to find a baf/u2 hybrid source - std::string leaf = BFS_STRING(sourcePath.leaf()); + std::string leaf = BFS_STRING(sourcePath.filename()); bal::to_lower(leaf); - if (leaf == "fid" && !bfs::exists(sourcePath.branch_path() / "analysis.baf")) + if (leaf == "fid" && !bfs::exists(sourcePath.parent_path() / "analysis.baf")) return Reader_Bruker_Format_FID; else if(extension(sourcePath) == ".u2") return Reader_Bruker_Format_U2; @@ -87,7 +86,7 @@ Reader_Bruker_Format format(const string& path) for (; itr != endItr; ++itr) if (bfs::is_directory(itr->status())) { - if (BFS_STRING(itr->path().leaf())[0] == '.') // HACK: skip ".svn" + if (BFS_STRING(itr->path().filename())[0] == '.') // HACK: skip ".svn" continue; else if (bfs::exists(itr->path() / "1/1SRef/fid") || bfs::exists(itr->path() / "1SRef/fid") || diff --git a/pwiz/data/vendor_readers/Bruker/SpectrumList_Bruker.cpp b/pwiz/data/vendor_readers/Bruker/SpectrumList_Bruker.cpp index 7081391491..96ba0d9bdc 100644 --- a/pwiz/data/vendor_readers/Bruker/SpectrumList_Bruker.cpp +++ b/pwiz/data/vendor_readers/Bruker/SpectrumList_Bruker.cpp @@ -505,8 +505,8 @@ void recursivelyEnumerateFIDs(vector& fidPaths, const bfs::path& root { const static bfs::directory_iterator endItr = bfs::directory_iterator(); - if (rootpath.leaf() == "fid") - fidPaths.push_back(rootpath.branch_path()); + if (rootpath.filename() == "fid") + fidPaths.push_back(rootpath.parent_path()); else if (bfs::is_directory(rootpath)) { for (bfs::directory_iterator itr(rootpath); itr != endItr; ++itr) @@ -518,14 +518,14 @@ void addSource(MSData& msd, const bfs::path& sourcePath, const bfs::path& rootPa { SourceFilePtr sourceFile(new SourceFile); sourceFile->id = sourcePath.string(); - sourceFile->name = BFS_STRING(sourcePath.leaf()); + sourceFile->name = BFS_STRING(sourcePath.filename()); // sourcePath: \Analysis.yep|\Analysis.baf|\fid // rootPath: c:\path\to\[\Analysis.yep|Analysis.baf|fid] - bfs::path location = rootPath.has_branch_path() ? - BFS_COMPLETE(rootPath.branch_path() / sourcePath) : + bfs::path location = rootPath.has_parent_path() ? + BFS_COMPLETE(rootPath.parent_path() / sourcePath) : BFS_COMPLETE(sourcePath); // uses initial path - sourceFile->location = "file://" + location.branch_path().string(); + sourceFile->location = "file://" + location.parent_path().string(); msd.fileDescription.sourceFilePtrs.push_back(sourceFile); } @@ -552,8 +552,8 @@ PWIZ_API_DECL void SpectrumList_Bruker::fillSourceList() { // in "/foo/bar/1/1SRef/fid", replace "/foo/bar/" with "" so relativePath is "1/1SRef/fid" bfs::path relativePath = sourcePaths_[i] / "fid"; - if (rootpath_.has_branch_path()) - relativePath = bal::replace_first_copy(relativePath.string(), rootpath_.branch_path().string() + NATIVE_PATH_SLASH, ""); + if (rootpath_.has_parent_path()) + relativePath = bal::replace_first_copy(relativePath.string(), rootpath_.parent_path().string() + NATIVE_PATH_SLASH, ""); relativePath = bal::replace_all_copy(relativePath.string(), NATIVE_PATH_SLASH, "/"); addSource(msd_, relativePath, rootpath_); msd_.fileDescription.sourceFilePtrs.back()->set(MS_Bruker_FID_nativeID_format); @@ -647,8 +647,8 @@ PWIZ_API_DECL void SpectrumList_Bruker::fillSourceList() sourcePaths_.push_back(bfs::change_extension(rootpath_, ".u2")); // in "/foo/bar.d/bar.u2", replace "/foo/" with "" so relativePath is "bar.d/bar.u2" bfs::path relativePath = sourcePaths_.back(); - if (rootpath_.has_branch_path()) - relativePath = bal::replace_first_copy(relativePath.string(), rootpath_.branch_path().string() + NATIVE_PATH_SLASH, ""); + if (rootpath_.has_parent_path()) + relativePath = bal::replace_first_copy(relativePath.string(), rootpath_.parent_path().string() + NATIVE_PATH_SLASH, ""); relativePath = bal::replace_all_copy(relativePath.string(), NATIVE_PATH_SLASH, "/"); addSource(msd_, relativePath, rootpath_); msd_.fileDescription.sourceFilePtrs.back()->set(MS_Bruker_U2_nativeID_format); @@ -661,8 +661,8 @@ PWIZ_API_DECL void SpectrumList_Bruker::fillSourceList() sourcePaths_.push_back(bfs::change_extension(rootpath_, ".u2")); // in "/foo/bar.d/bar.u2", replace "/foo/" with "" so relativePath is "bar.d/bar.u2" bfs::path relativePath = sourcePaths_.back(); - if (rootpath_.has_branch_path()) - relativePath = bal::replace_first_copy(relativePath.string(), rootpath_.branch_path().string() + NATIVE_PATH_SLASH, ""); + if (rootpath_.has_parent_path()) + relativePath = bal::replace_first_copy(relativePath.string(), rootpath_.parent_path().string() + NATIVE_PATH_SLASH, ""); relativePath = bal::replace_all_copy(relativePath.string(), NATIVE_PATH_SLASH, "/"); addSource(msd_, relativePath, rootpath_); msd_.fileDescription.sourceFilePtrs.back()->set(MS_Bruker_U2_nativeID_format); diff --git a/pwiz/data/vendor_readers/Mobilion/Reader_Mobilion.cpp b/pwiz/data/vendor_readers/Mobilion/Reader_Mobilion.cpp index 24e81d0b91..f0eb0f6e93 100644 --- a/pwiz/data/vendor_readers/Mobilion/Reader_Mobilion.cpp +++ b/pwiz/data/vendor_readers/Mobilion/Reader_Mobilion.cpp @@ -97,9 +97,9 @@ void fillInMetadata(const string& rawpath, MBIFile* rawdata, MSData& msd) bfs::path sourcePath(rawpath); SourceFilePtr sourceFile(new SourceFile); - sourceFile->id = BFS_STRING(sourcePath.leaf()); - sourceFile->name = BFS_STRING(sourcePath.leaf()); - sourceFile->location = "file:///" + BFS_GENERIC_STRING(BFS_COMPLETE(sourcePath.branch_path())); + sourceFile->id = BFS_STRING(sourcePath.filename()); + sourceFile->name = BFS_STRING(sourcePath.filename()); + sourceFile->location = "file:///" + BFS_GENERIC_STRING(BFS_COMPLETE(sourcePath.parent_path())); sourceFile->set(MS_Mobilion_MBI_nativeID_format); sourceFile->set(MS_Mobilion_MBI_format); msd.fileDescription.sourceFilePtrs.push_back(sourceFile); diff --git a/pwiz/data/vendor_readers/Shimadzu/Reader_Shimadzu.cpp b/pwiz/data/vendor_readers/Shimadzu/Reader_Shimadzu.cpp index 5630393f59..298c85b9f7 100644 --- a/pwiz/data/vendor_readers/Shimadzu/Reader_Shimadzu.cpp +++ b/pwiz/data/vendor_readers/Shimadzu/Reader_Shimadzu.cpp @@ -124,7 +124,7 @@ void fillInMetadata(const string& rawpath, Shimadzu::ShimadzuReaderPtr rawfile, SourceFilePtr sourceFile(new SourceFile); sourceFile->id = p.filename().string(utf8); sourceFile->name = p.filename().string(utf8); - sourceFile->location = "file:///" + bfs::system_complete(p.branch_path()).string(utf8); + sourceFile->location = "file:///" + bfs::system_complete(p.parent_path()).string(utf8); sourceFile->set(MS_scan_number_only_nativeID_format); sourceFile->set(MS_mass_spectrometer_file_format); msd.fileDescription.sourceFilePtrs.push_back(sourceFile); diff --git a/pwiz/data/vendor_readers/Thermo/Reader_Thermo.cpp b/pwiz/data/vendor_readers/Thermo/Reader_Thermo.cpp index dbb250489c..bf53368708 100644 --- a/pwiz/data/vendor_readers/Thermo/Reader_Thermo.cpp +++ b/pwiz/data/vendor_readers/Thermo/Reader_Thermo.cpp @@ -127,8 +127,8 @@ void fillInMetadata(const string& filename, RawFile& rawfile, MSData& msd, const SourceFilePtr sourceFile(new SourceFile); bfs::path p(filename); sourceFile->id = "RAW1"; - sourceFile->name = BFS_STRING(p.leaf()); - sourceFile->location = "file:///" + BFS_COMPLETE(p.branch_path()).string(); + sourceFile->name = BFS_STRING(p.filename()); + sourceFile->location = "file:///" + BFS_COMPLETE(p.parent_path()).string(); sourceFile->set(MS_Thermo_nativeID_format); sourceFile->set(MS_Thermo_RAW_format); msd.fileDescription.sourceFilePtrs.push_back(sourceFile); diff --git a/pwiz/data/vendor_readers/UIMF/Reader_UIMF.cpp b/pwiz/data/vendor_readers/UIMF/Reader_UIMF.cpp index db6a202d6e..e03764bfdc 100644 --- a/pwiz/data/vendor_readers/UIMF/Reader_UIMF.cpp +++ b/pwiz/data/vendor_readers/UIMF/Reader_UIMF.cpp @@ -81,9 +81,9 @@ void fillInMetadata(const string& rawpath, UIMFReaderPtr rawfile, MSData& msd) bfs::path sourcePath(rawpath); SourceFilePtr sourceFile(new SourceFile); - sourceFile->id = BFS_STRING(sourcePath.leaf()); - sourceFile->name = BFS_STRING(sourcePath.leaf()); - sourceFile->location = "file:///" + BFS_GENERIC_STRING(BFS_COMPLETE(sourcePath.branch_path())); + sourceFile->id = BFS_STRING(sourcePath.filename()); + sourceFile->name = BFS_STRING(sourcePath.filename()); + sourceFile->location = "file:///" + BFS_GENERIC_STRING(BFS_COMPLETE(sourcePath.parent_path())); sourceFile->set(MS_UIMF_nativeID_format); sourceFile->set(MS_UIMF_format); msd.fileDescription.sourceFilePtrs.push_back(sourceFile); diff --git a/pwiz/data/vendor_readers/Waters/Reader_Waters.cpp b/pwiz/data/vendor_readers/Waters/Reader_Waters.cpp index 077c931b82..77f4247ab4 100644 --- a/pwiz/data/vendor_readers/Waters/Reader_Waters.cpp +++ b/pwiz/data/vendor_readers/Waters/Reader_Waters.cpp @@ -87,9 +87,9 @@ void fillInMetadata(const string& rawpath, RawDataPtr rawdata, MSData& msd) { bfs::path sourcePath = functionFilepaths[i]; SourceFilePtr sourceFile(new SourceFile); - sourceFile->id = BFS_STRING(sourcePath.leaf()); - sourceFile->name = BFS_STRING(sourcePath.leaf()); - sourceFile->location = "file://" + BFS_COMPLETE(sourcePath.branch_path()).string(); + sourceFile->id = BFS_STRING(sourcePath.filename()); + sourceFile->name = BFS_STRING(sourcePath.filename()); + sourceFile->location = "file://" + BFS_COMPLETE(sourcePath.parent_path()).string(); sourceFile->set(MS_Waters_nativeID_format); sourceFile->set(MS_Waters_raw_format); msd.fileDescription.sourceFilePtrs.push_back(sourceFile); @@ -115,9 +115,9 @@ void fillInMetadata(const string& rawpath, RawDataPtr rawdata, MSData& msd) continue; SourceFilePtr sourceFile(new SourceFile); - sourceFile->id = BFS_STRING(sourcePath.leaf()); - sourceFile->name = BFS_STRING(sourcePath.leaf()); - sourceFile->location = string("file://") + BFS_COMPLETE(sourcePath.branch_path()).string(); + sourceFile->id = BFS_STRING(sourcePath.filename()); + sourceFile->name = BFS_STRING(sourcePath.filename()); + sourceFile->location = string("file://") + BFS_COMPLETE(sourcePath.parent_path()).string(); sourceFile->set(MS_no_nativeID_format); msd.fileDescription.sourceFilePtrs.push_back(sourceFile); } diff --git a/pwiz/utility/bindings/CLI/common/cvgen_cli.cpp b/pwiz/utility/bindings/CLI/common/cvgen_cli.cpp index 737de4b4ab..3c6ce561a1 100644 --- a/pwiz/utility/bindings/CLI/common/cvgen_cli.cpp +++ b/pwiz/utility/bindings/CLI/common/cvgen_cli.cpp @@ -505,7 +505,7 @@ int main(int argc, char* argv[]) try { - bfs::path exeDir(bfs::path(argv[0]).branch_path()); + bfs::path exeDir(bfs::path(argv[0]).parent_path()); vector obos; map enumMultiplierByPrefix; diff --git a/pwiz/utility/bindings/CLI/timstof_prm_scheduler/PrmSchedulerTest.cpp b/pwiz/utility/bindings/CLI/timstof_prm_scheduler/PrmSchedulerTest.cpp index ce8e060ad9..0a34d9cb4d 100644 --- a/pwiz/utility/bindings/CLI/timstof_prm_scheduler/PrmSchedulerTest.cpp +++ b/pwiz/utility/bindings/CLI/timstof_prm_scheduler/PrmSchedulerTest.cpp @@ -576,7 +576,7 @@ void test() //bfs::create_directory("test_scheduling_dir"); string templateFilepath = pwiz::util::env::get("PWIZ_ROOT") + "/pwiz/utility/bindings/CLI/timstof_prm_scheduler/timstof_prm_scheduler.prmsqlite"; - bfs::copy_file(templateFilepath, "timstof_prm_scheduler.prmsqlite", bfs::copy_option::overwrite_if_exists); + bfs::copy_file(templateFilepath, "timstof_prm_scheduler.prmsqlite", bfs::copy_options::overwrite_existing); auto s = gcnew Scheduler(ToSystemString("timstof_prm_scheduler.prmsqlite")); s->SetAdditionalMeasurementParameters(parameters); diff --git a/pwiz/utility/findmf/base/resample/bucket1dtest.cpp b/pwiz/utility/findmf/base/resample/bucket1dtest.cpp index 13c42047aa..bfaa7ec71c 100644 --- a/pwiz/utility/findmf/base/resample/bucket1dtest.cpp +++ b/pwiz/utility/findmf/base/resample/bucket1dtest.cpp @@ -23,7 +23,6 @@ #include "pwiz/utility/findmf/base/resample/bin1d.hpp" #include -#include #include #include "pwiz/utility/misc/unit.hpp" diff --git a/pwiz/utility/misc/Container.hpp b/pwiz/utility/misc/Container.hpp index 9cdb41d738..edbdb3b670 100644 --- a/pwiz/utility/misc/Container.hpp +++ b/pwiz/utility/misc/Container.hpp @@ -35,7 +35,7 @@ #include #include #include -#include +#include using std::vector; using std::list; diff --git a/pwiz/utility/misc/Filesystem.cpp b/pwiz/utility/misc/Filesystem.cpp index 1389a250c3..cec1d429cd 100644 --- a/pwiz/utility/misc/Filesystem.cpp +++ b/pwiz/utility/misc/Filesystem.cpp @@ -446,7 +446,7 @@ PWIZ_API_DECL int expand_pathmask(const bfs::path& pathmask, int matchingPathCount = 0; #ifdef WIN32 - path maskParentPath = pathmask.branch_path(); + path maskParentPath = pathmask.parent_path(); WIN32_FIND_DATAW fdata; HANDLE srcFile = FindFirstFileExW(boost::nowide::widen(pathmask.string()).c_str(), FindExInfoStandard, &fdata, FindExSearchNameMatch, NULL, 0); if (srcFile == INVALID_HANDLE_VALUE) @@ -496,43 +496,6 @@ PWIZ_API_DECL int expand_pathmask(const bfs::path& pathmask, } -namespace -{ - void copy_recursive(const bfs::path& from, const bfs::path& to) - { - bfs::copy_directory(from, to); - - for(bfs::directory_entry& entry : bfs::directory_iterator(from)) - { - bfs::file_status status = entry.status(); - if (status.type() == bfs::directory_file) - copy_recursive(entry.path(), to / entry.path().filename()); - else if (status.type() == bfs::regular_file) - bfs::copy_file(entry.path(), to / entry.path().filename()); - else - throw bfs::filesystem_error("[copy_directory] invalid path type", entry.path(), boost::system::error_code(boost::system::errc::no_such_file_or_directory, boost::system::system_category())); - } - } - - void copy_recursive(const bfs::path& from, const bfs::path& to, boost::system::error_code& ec) - { - bfs::copy_directory(from, to, ec); - if (ec.value() != 0) - return; - - for(bfs::directory_entry& entry : bfs::directory_iterator(from)) - { - bfs::file_status status = entry.status(ec); - if (status.type() == bfs::directory_file) - copy_recursive(entry.path(), to / entry.path().filename(), ec); - else if (status.type() == bfs::regular_file) - bfs::copy_file(entry.path(), to / entry.path().filename(), ec); - else if (ec.value() != 0) - ec.assign(boost::system::errc::no_such_file_or_directory, boost::system::system_category()); - } - } -} - PWIZ_API_DECL void copy_directory(const bfs::path& from, const bfs::path& to, bool recursive, boost::system::error_code* ec) { if (!bfs::is_directory(from)) @@ -549,16 +512,16 @@ PWIZ_API_DECL void copy_directory(const bfs::path& from, const bfs::path& to, bo if (recursive) { if (ec != NULL) - copy_recursive(from, to, *ec); + bfs::copy(from, to, bfs::copy_options::recursive, *ec); else - copy_recursive(from, to); + bfs::copy(from, to, bfs::copy_options::recursive); } else { if (ec != NULL) - bfs::copy_directory(from, to, *ec); + bfs::copy(from, to, *ec); else - bfs::copy_directory(from, to); + bfs::copy(from, to); } } diff --git a/pwiz/utility/misc/Filesystem.hpp b/pwiz/utility/misc/Filesystem.hpp index 4112084026..1b22f6fcdb 100644 --- a/pwiz/utility/misc/Filesystem.hpp +++ b/pwiz/utility/misc/Filesystem.hpp @@ -34,8 +34,9 @@ #include "String.hpp" #include "Container.hpp" #include -#include #include +#include +#include #include #include "pwiz/utility/misc/random_access_compressed_ifstream.hpp" @@ -54,19 +55,43 @@ namespace bfs = boost::filesystem; // and v3 breaks the API in surprising ways // see http://www.boost.org/doc/libs/1_47_0/libs/filesystem/v3/doc/deprecated.html #if BOOST_FILESYSTEM_VERSION == 2 -// in BFS2 p.filename() or p.leaf() or p.extension() returns a string +// in BFS2 p.filename() or p.filename() or p.extension() returns a string #define BFS_STRING(p) p #define BFS_GENERIC_STRING(p) p // in BFS2 complete() is in namespace #define BFS_COMPLETE bfs::complete #else -// in BFS3 p.filename() or p.leaf() or p.extension() returns a bfs::path +// in BFS3 p.filename() or p.filename() or p.extension() returns a bfs::path #define BFS_STRING(p) (p).string() #define BFS_GENERIC_STRING(p) (p).generic_string() // in BFS3 complete() is not in namespace #define BFS_COMPLETE bfs::system_complete #endif + +namespace boost { +namespace filesystem { + + inline std::string extension(const path& p) + { + return p.extension().string(); + } + + inline std::string basename(const path& p) + { + return p.stem().string(); + } + + inline path change_extension(const path& p, const path& new_extension) + { + path new_p(p); + new_p.replace_extension(new_extension); + return new_p; + } +} // filesystem +} // boost + + namespace pwiz { namespace util { diff --git a/pwiz/utility/misc/TabReaderTest.cpp b/pwiz/utility/misc/TabReaderTest.cpp index 59f2189838..c46c73d200 100644 --- a/pwiz/utility/misc/TabReaderTest.cpp +++ b/pwiz/utility/misc/TabReaderTest.cpp @@ -92,7 +92,7 @@ int main(int argc, char** argv) // hack to allow running unit test from a different directory: // Jamfile passes full path to specified input file. // we want the path, so we can ignore filename - datapath = bfs::path(argv[i]).branch_path(); + datapath = bfs::path(argv[i]).parent_path(); } if (os_) *os_ << "TabReaderTest\n"; runTests(datapath); diff --git a/pwiz_tools/BiblioSpec/Jamfile.jam b/pwiz_tools/BiblioSpec/Jamfile.jam index cffa8fc429..8db54443b6 100644 --- a/pwiz_tools/BiblioSpec/Jamfile.jam +++ b/pwiz_tools/BiblioSpec/Jamfile.jam @@ -95,7 +95,7 @@ tar.create bibliospec-bin.tar.bz2 "exclude:pwiz/utility/bindings/CLI/example" "exclude:pwiz_tools/commandline" "exclude:pwiz_tools/MSConvertGUI" - "exclude:pwiz_tools/Bumbershoot/idpicker/Tutorials" + "exclude:pwiz_tools/SeeMS" "exclude:pwiz_tools/examples" "exclude:pwiz_tools/sld" "exclude:pwiz_tools/Bumbershoot" diff --git a/pwiz_tools/BiblioSpec/Navigation_only_will_not_build.vcxproj b/pwiz_tools/BiblioSpec/Navigation_only_will_not_build.vcxproj index 6bdd8772dd..7511288b35 100644 --- a/pwiz_tools/BiblioSpec/Navigation_only_will_not_build.vcxproj +++ b/pwiz_tools/BiblioSpec/Navigation_only_will_not_build.vcxproj @@ -52,21 +52,21 @@ cd $(ProjectDir)..\.. && quickbuild.bat -j24 --abbreviate-paths --verbose-test address-model=64 --i-agree-to-the-vendor-licenses --without-compassxtract variant=debug debug-symbols=on iterator-debugging=off --incremental pwiz_tools/BiblioSpec//src CleanBiblioSpec.bat WIN32;NDEBUG;$(NMakePreprocessorDefinitions) - $(ProjectDir)..\..;$(ProjectDir)..\..\libraries\zlib-1.2.3;$(ProjectDir)..\..\libraries\boost_1_76_0;$(ProjectDir)..\..\libraries\boost_aux;$(ProjectDir)..\..\libraries\SQLite;$(ProjectDir)..\..\libraries\expat-2.0.1;$(IncludePath) + $(ProjectDir)..\..;$(ProjectDir)..\..\libraries\zlib-1.2.3;$(ProjectDir)..\..\libraries\boost_1_86_0;$(ProjectDir)..\..\libraries\boost_aux;$(ProjectDir)..\..\libraries\SQLite;$(ProjectDir)..\..\libraries\expat-2.0.1;$(IncludePath) cd $(ProjectDir)..\.. && quickbuild.bat -j24 --abbreviate-paths --verbose-test address-model=64 --i-agree-to-the-vendor-licenses --without-compassxtract variant=debug debug-symbols=on iterator-debugging=off --incremental pwiz_tools/BiblioSpec//src cd $(ProjectDir)..\.. && quickbuild.bat -j24 --abbreviate-paths --verbose-test address-model=64 --i-agree-to-the-vendor-licenses --without-compassxtract variant=debug debug-symbols=on iterator-debugging=off --incremental pwiz_tools/BiblioSpec//src CleanBiblioSpec.bat WIN32;NDEBUG;$(NMakePreprocessorDefinitions) - $(ProjectDir)..\..;$(ProjectDir)..\..\libraries\zlib-1.2.3;$(ProjectDir)..\..\libraries\boost_1_76_0;$(ProjectDir)..\..\libraries\boost_aux;$(ProjectDir)..\..\libraries\SQLite;$(ProjectDir)..\..\libraries\expat-2.0.1;$(IncludePath) + $(ProjectDir)..\..;$(ProjectDir)..\..\libraries\zlib-1.2.3;$(ProjectDir)..\..\libraries\boost_1_86_0;$(ProjectDir)..\..\libraries\boost_aux;$(ProjectDir)..\..\libraries\SQLite;$(ProjectDir)..\..\libraries\expat-2.0.1;$(IncludePath) cd $(ProjectDir)..\.. && quickbuild.bat -j24 --abbreviate-paths --verbose-test address-model=64 --i-agree-to-the-vendor-licenses --without-compassxtract variant=debug debug-symbols=on iterator-debugging=off --incremental pwiz_tools/BiblioSpec//src cd $(ProjectDir)..\.. && quickbuild.bat -j24 --abbreviate-paths --verbose-test address-model=64 --i-agree-to-the-vendor-licenses --without-compassxtract variant=debug debug-symbols=on iterator-debugging=off --incremental pwiz_tools/BiblioSpec//src CleanBiblioSpec.bat WIN32;NDEBUG;$(NMakePreprocessorDefinitions) - $(ProjectDir)..\..;$(ProjectDir)..\..\libraries\zlib-1.2.3;$(ProjectDir)..\..\libraries\boost_1_76_0;$(ProjectDir)..\..\libraries\boost_aux;$(ProjectDir)..\..\libraries\SQLite;$(ProjectDir)..\..\libraries\expat-2.0.1;$(IncludePath) + $(ProjectDir)..\..;$(ProjectDir)..\..\libraries\zlib-1.2.3;$(ProjectDir)..\..\libraries\boost_1_86_0;$(ProjectDir)..\..\libraries\boost_aux;$(ProjectDir)..\..\libraries\SQLite;$(ProjectDir)..\..\libraries\expat-2.0.1;$(IncludePath) cd $(ProjectDir)..\.. && quickbuild.bat -j24 --abbreviate-paths --verbose-test address-model=64 --i-agree-to-the-vendor-licenses --without-compassxtract variant=debug debug-symbols=on iterator-debugging=off --incremental pwiz_tools/BiblioSpec//src diff --git a/pwiz_tools/BiblioSpec/src/BlibFilter.cpp b/pwiz_tools/BiblioSpec/src/BlibFilter.cpp index 39655c99c7..35ce36bd68 100644 --- a/pwiz_tools/BiblioSpec/src/BlibFilter.cpp +++ b/pwiz_tools/BiblioSpec/src/BlibFilter.cpp @@ -43,7 +43,6 @@ #include "CommandLine.h" #include "SqliteRoutine.h" #include "boost/program_options.hpp" -#include "boost/log/detail/snprintf.hpp" namespace ops = boost::program_options; @@ -216,7 +215,7 @@ void BlibFilter::attachAll() { Verbosity::status("Filtering redundant library '%s'.", redundantFileName_.c_str()); - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, "ATTACH DATABASE '%s' as %s", SqliteRoutine::ESCAPE_APOSTROPHES(redundantFileName_).c_str(), + snprintf(zSql, ZSQLBUFLEN, "ATTACH DATABASE '%s' as %s", SqliteRoutine::ESCAPE_APOSTROPHES(redundantFileName_).c_str(), redundantDbName_); sql_stmt(zSql); @@ -236,7 +235,7 @@ string BlibFilter::getLSID() { // Use the same LSID as the redundant version, but replace // 'redundant' with 'nr'. - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, "SELECT libLSID FROM %s.LibInfo", redundantDbName_); + snprintf(zSql, ZSQLBUFLEN, "SELECT libLSID FROM %s.LibInfo", redundantDbName_); int iRow, iCol; char** result; @@ -263,7 +262,7 @@ string BlibFilter::getLSID() void BlibFilter::getNextRevision(int* major, int* minor) { // Use same revision as the redundant version - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, "SELECT majorVersion, minorVersion FROM %s.LibInfo", + snprintf(zSql, ZSQLBUFLEN, "SELECT majorVersion, minorVersion FROM %s.LibInfo", redundantDbName_); int iRow, iCol; @@ -442,7 +441,7 @@ void BlibFilter::buildNonRedundantLib() { //first Order by peptideModSeq and charge, filter by num peaks order_by = "peptideModSeq, precursorCharge " + optional_cols; } - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, + snprintf(zSql, ZSQLBUFLEN, "SELECT id,peptideSeq,precursorMZ,precursorCharge,peptideModSeq," "prevAA, nextAA, numPeaks, score, scoreType, " "ionMobility, collisionalCrossSectionSqA, ionMobilityHighEnergyOffset, ionMobilityType, " @@ -575,7 +574,7 @@ void BlibFilter::buildNonRedundantLib() { if (!useBestScoring_) // peaks not necessary in best scoring mode { int refSpectraId = sqlite3_column_int(pStmt, 0); - boost::log::aux::snprintf(idPos, ZSQLBUFLEN - qlen, "%i", refSpectraId); + snprintf(idPos, ZSQLBUFLEN - qlen, "%i", refSpectraId); peakRc = sqlite3_prepare(peakConnection, zSqlPeakQuery, -1, &peakStmt, NULL); check_rc(peakRc, zSqlPeakQuery, "Failed selecting peaks."); peakRc = sqlite3_step(peakStmt); diff --git a/pwiz_tools/BiblioSpec/src/BlibMaker.cpp b/pwiz_tools/BiblioSpec/src/BlibMaker.cpp index e6d0879024..e76024da68 100644 --- a/pwiz_tools/BiblioSpec/src/BlibMaker.cpp +++ b/pwiz_tools/BiblioSpec/src/BlibMaker.cpp @@ -26,7 +26,6 @@ #include "zlib.h" #include "BlibMaker.h" #include "SqliteRoutine.h" -#include #include "SmallMolMetadata.h" #include #include @@ -207,7 +206,7 @@ void BlibMaker::init() message += lib_name; sql_stmt("PRAGMA synchronous=OFF"); - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, "PRAGMA cache_size=%d", cache_size); + snprintf(zSql, ZSQLBUFLEN, "PRAGMA cache_size=%d", cache_size); sql_stmt(zSql); sql_stmt("PRAGMA temp_store=MEMORY"); @@ -351,7 +350,7 @@ void BlibMaker::createTables(vector &commands, bool execute) string blibLSID = getLSID(); char zSql[ZSQLBUFLEN + 1]; - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, "INSERT INTO LibInfo values('%s','%.24s',%i,%i,%i)", // %.24s drops the \n from ctime output + snprintf(zSql, ZSQLBUFLEN, "INSERT INTO LibInfo values('%s','%.24s',%i,%i,%i)", // %.24s drops the \n from ctime output blibLSID.c_str(), date, -1, // init count as -1 to mean 'not counted', 0 could be 'no spec' MAJOR_VERSION_CURRENT, MINOR_VERSION_CURRENT); @@ -439,7 +438,7 @@ void BlibMaker::createTable(const char* tableName, vector &commands, boo ")"); // insert all score types for(int i=0; i < NUM_PSM_SCORE_TYPES; i++){ - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, + snprintf(zSql, ZSQLBUFLEN, "INSERT INTO ScoreTypes(id, scoreType, probabilityType) VALUES(%d, '%s', '%s')", i, scoreTypeToString((PSM_SCORE_TYPE)i), scoreTypeToProbabilityTypeString((PSM_SCORE_TYPE)i)); commands.push_back(zSql); @@ -454,7 +453,7 @@ void BlibMaker::createTable(const char* tableName, vector &commands, boo ")"); // insert all ionMobility types for (int i = 0; i < NUM_IONMOBILITY_TYPES; i++){ - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, + snprintf(zSql, ZSQLBUFLEN, "INSERT INTO IonMobilityTypes(id, ionMobilityType) VALUES(%d, '%s')", i, ionMobilityTypeToString((IONMOBILITY_TYPE)i)); commands.push_back(zSql); @@ -567,7 +566,7 @@ void BlibMaker::updateTables(){ for (vector< pair >::const_iterator i = newColumns.begin(); i != newColumns.end(); ++i) { if (!tableColumnExists("main", "RefSpectra", i->first.c_str())) { - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, "ALTER TABLE RefSpectra ADD %s %s", i->first.c_str(), i->second.c_str()); + snprintf(zSql, ZSQLBUFLEN, "ALTER TABLE RefSpectra ADD %s %s", i->first.c_str(), i->second.c_str()); sql_stmt(zSql); } } @@ -577,10 +576,10 @@ void BlibMaker::updateTables(){ } // update fileID and scoreType to be unknown in all existing spec - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, "UPDATE RefSpectra SET fileID = '%d' " + snprintf(zSql, ZSQLBUFLEN, "UPDATE RefSpectra SET fileID = '%d' " "WHERE fileID IS NULL", unknown_file_id ); sql_stmt(zSql); - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, "UPDATE RefSpectra SET scoreType = '%d' " + snprintf(zSql, ZSQLBUFLEN, "UPDATE RefSpectra SET scoreType = '%d' " "WHERE scoreType IS NULL", UNKNOWN_SCORE_TYPE ); sql_stmt(zSql); } @@ -594,7 +593,7 @@ int BlibMaker::getUnknownFileId(){ return -1; } - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, "SELECT id FROM SpectrumSourceFiles " + snprintf(zSql, ZSQLBUFLEN, "SELECT id FROM SpectrumSourceFiles " "WHERE fileName = 'UNKNOWN'"); smart_stmt pStmt; int return_code = sqlite3_prepare(db, zSql, -1, &pStmt, 0); @@ -666,7 +665,7 @@ void BlibMaker::createUpdatedRefSpectraView(const char* sourceDbName) { * \returns True if table exists or false if it does not. */ bool BlibMaker::tableExists(const char* schemaTmp, const char* tableName){ - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, + snprintf(zSql, ZSQLBUFLEN, "SELECT name FROM %s.sqlite_master WHERE name = \"%s\"", schemaTmp, tableName); smart_stmt pStmt; @@ -685,7 +684,7 @@ bool BlibMaker::tableExists(const char* schemaTmp, const char* tableName){ bool BlibMaker::tableColumnExists(const char* schemaTmp, const char* tableName, const char* columnName){ - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, + snprintf(zSql, ZSQLBUFLEN, "PRAGMA %s.table_info(%s)", schemaTmp, tableName); smart_stmt pStmt; @@ -731,7 +730,7 @@ void BlibMaker::transferSpectrumFiles(const char* schemaTmp){ //i.e. db name string cutoffSelect = tableColumnExists(schemaTmp, "SpectrumSourceFiles", "cutoffScore") ? "cutoffScore" : "-1"; string idFileSelect = tableColumnExists(schemaTmp, "SpectrumSourceFiles", "idFileName") ? "idFileName" : "fileName"; - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, "SELECT id, fileName, %s, %s FROM %s.SpectrumSourceFiles", idFileSelect.c_str(), cutoffSelect.c_str(), schemaTmp); + snprintf(zSql, ZSQLBUFLEN, "SELECT id, fileName, %s, %s FROM %s.SpectrumSourceFiles", idFileSelect.c_str(), cutoffSelect.c_str(), schemaTmp); smart_stmt pStmt; int rc = sqlite3_prepare(db, zSql, -1, &pStmt, 0); check_rc(rc, zSql, "Failed selecting file names from tmp db."); @@ -765,7 +764,7 @@ void BlibMaker::transferProteins(const char* schemaTmp) { return; } - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, + snprintf(zSql, ZSQLBUFLEN, "INSERT INTO main.Proteins (id, accession) SELECT id, accession FROM %s.Proteins", schemaTmp); sql_stmt(zSql); } @@ -781,7 +780,7 @@ void BlibMaker::transferProteins(const char* schemaTmp) { */ int BlibMaker::getNewFileId(const char* libName, int specID){ // get the fileID in the temp library - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, "SELECT fileID FROM %s.RefSpectra WHERE id = %d", + snprintf(zSql, ZSQLBUFLEN, "SELECT fileID FROM %s.RefSpectra WHERE id = %d", libName, specID); smart_stmt pStmt; @@ -802,7 +801,7 @@ int BlibMaker::getNewFileId(const char* libName, int specID){ } else { // insert it into the new db string cutoffSelect = tableColumnExists(libName, "SpectrumSourceFiles", "cutoffScore") ? "cutoffScore" : "-1"; - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, "INSERT INTO main.SpectrumSourceFiles(fileName, cutoffScore) " + snprintf(zSql, ZSQLBUFLEN, "INSERT INTO main.SpectrumSourceFiles(fileName, cutoffScore) " "SELECT fileName, %s FROM %s.SpectrumSourceFiles " "WHERE %s.SpectrumSourceFiles.id = %d", cutoffSelect.c_str(), libName, libName, oldFileID); @@ -829,7 +828,7 @@ int BlibMaker::transferSpectrum(const char* schemaTmp, { int newFileID = getNewFileId(schemaTmp, spectraTmpID); - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, + snprintf(zSql, ZSQLBUFLEN, "INSERT INTO RefSpectra(peptideSeq, precursorMZ, precursorCharge, peptideModSeq, prevAA, nextAA, copies, numPeaks, fileID, " "ionMobility, collisionalCrossSectionSqA, ionMobilityHighEnergyOffset, ionMobilityType, " "moleculeName, chemicalFormula, inchiKey, otherKeys, precursorAdduct, " @@ -878,7 +877,7 @@ int BlibMaker::transferSpectra(const char* schemaTmp, // transfer spectra from source db to filtered db - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, + snprintf(zSql, ZSQLBUFLEN, "INSERT INTO RefSpectra(id, peptideSeq, precursorMZ, precursorCharge, " "peptideModSeq, prevAA, nextAA, copies, numPeaks, fileID, " "ionMobility, collisionalCrossSectionSqA, ionMobilityHighEnergyOffset, ionMobilityType, " @@ -896,7 +895,7 @@ int BlibMaker::transferSpectra(const char* schemaTmp, sql_stmt(zSql); // transfer peaks - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, + snprintf(zSql, ZSQLBUFLEN, "INSERT INTO RefSpectraPeaks(RefSpectraID,peakMZ,peakIntensity) " "SELECT RefSpectraID, peakMZ, peakIntensity " "FROM %s.RefSpectraPeaks peaks " @@ -904,7 +903,7 @@ int BlibMaker::transferSpectra(const char* schemaTmp, sql_stmt(zSql); // transfer modifications - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, + snprintf(zSql, ZSQLBUFLEN, "INSERT INTO Modifications (RefSpectraID, position, mass) " "SELECT RefSpectraID, position, mass " "FROM %s.Modifications mods " @@ -913,7 +912,7 @@ int BlibMaker::transferSpectra(const char* schemaTmp, if (tableVersion >= MIN_VERSION_PEAK_ANNOT) { // transfer peak annotations - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, + snprintf(zSql, ZSQLBUFLEN, "INSERT INTO RefSpectraPeakAnnotations (RefSpectraID, peakIndex, name, formula, inchiKey, otherKeys, charge, adduct, comment, mzTheoretical, mzObserved) " "SELECT RefSpectraID, peakIndex, name, formula, ann.inchiKey, ann.otherKeys, charge, adduct, comment, mzTheoretical, mzObserved " "FROM %s.RefSpectraPeakAnnotations ann " @@ -923,7 +922,7 @@ int BlibMaker::transferSpectra(const char* schemaTmp, if (tableVersion >= MIN_VERSION_PROTEINS) { // transfer proteins - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, + snprintf(zSql, ZSQLBUFLEN, "INSERT INTO RefSpectraProteins (RefSpectraId, ProteinId) " "SELECT RefSpectraID, ProteinId " "FROM %s.RefSpectraProteins pro " @@ -938,7 +937,7 @@ void BlibMaker::transferModifications(const char* schemaTmp, int spectraID, int spectraTmpID) { - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, + snprintf(zSql, ZSQLBUFLEN, "SELECT RefSpectraID, position, mass " "FROM %s.Modifications " "WHERE RefSpectraID=%d " @@ -951,7 +950,7 @@ void BlibMaker::transferModifications(const char* schemaTmp, rc = sqlite3_step(pStmt); while(rc==SQLITE_ROW) { - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, + snprintf(zSql, ZSQLBUFLEN, "INSERT INTO Modifications(RefSpectraID, position,mass) " "VALUES(%d, %d, %f)", spectraID, @@ -967,7 +966,7 @@ void BlibMaker::transferPeaks(const char* schemaTmp, int spectraID, int spectraTmpID) { - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, + snprintf(zSql, ZSQLBUFLEN, "INSERT INTO RefSpectraPeaks(RefSpectraID,peakMZ,peakIntensity) " "SELECT %d, peakMZ, peakIntensity " "FROM %s.RefSpectraPeaks " @@ -980,7 +979,7 @@ void BlibMaker::transferPeakAnnotations(const char* schemaTmp, int spectraTmpID) { const char *cols = "RefSpectraID, peakIndex, name, formula, inchiKey, otherKeys, charge, adduct, comment, mzTheoretical, mzObserved"; - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, + snprintf(zSql, ZSQLBUFLEN, "SELECT %s " "FROM %s.RefSpectraPeakAnnotations " "WHERE RefSpectraID=%d " @@ -992,7 +991,7 @@ void BlibMaker::transferPeakAnnotations(const char* schemaTmp, rc = sqlite3_step(pStmt); while (rc == SQLITE_ROW) { - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, + snprintf(zSql, ZSQLBUFLEN, "INSERT INTO RefSpectraPeakAnnotations(%s) " "VALUES(%d, %s, %s, %s, %s, %s, %d, %s, %s, %f, %f)", cols, @@ -1014,7 +1013,7 @@ void BlibMaker::transferPeakAnnotations(const char* schemaTmp, } void BlibMaker::transferRefSpectraProteins(const char* schemaTmp, int spectraID, int spectraTmpID) { - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, + snprintf(zSql, ZSQLBUFLEN, "INSERT INTO RefSpectraProteins (RefSpectraId, ProteinId) " "SELECT %d, ProteinId FROM %s.RefSpectraProteins WHERE RefSpectraId = %d", spectraID, schemaTmp, spectraTmpID); @@ -1113,7 +1112,7 @@ void BlibMaker::insertPeaks(int spectraID, int levelCompress, int peaksCount, } } - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, "INSERT INTO RefSpectraPeaks VALUES(%d, ?,?)", spectraID); + snprintf(zSql, ZSQLBUFLEN, "INSERT INTO RefSpectraPeaks VALUES(%d, ?,?)", spectraID); smart_stmt pStmt; int rc = sqlite3_prepare(getDb(), zSql, -1, &pStmt, 0); @@ -1140,7 +1139,7 @@ void BlibMaker::updateLibInfo() getNextRevision(&dataRev); int spectrum_count = countSpectra(); - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, + snprintf(zSql, ZSQLBUFLEN, "UPDATE LibInfo SET numSpecs=%d, majorVersion=%d", spectrum_count, dataRev); sql_stmt(zSql); @@ -1157,7 +1156,7 @@ int BlibMaker::getSpectrumCount(const char* databaseName /* = null */) { // first try getting the count if (databaseName != NULL && *databaseName != '\0') - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, "SELECT numSpecs FROM %s.LibInfo", databaseName); + snprintf(zSql, ZSQLBUFLEN, "SELECT numSpecs FROM %s.LibInfo", databaseName); else strncpy(zSql, "SELECT numSpecs FROM LibInfo", ZSQLBUFLEN); smart_stmt pStmt1; @@ -1186,7 +1185,7 @@ int BlibMaker::getSpectrumCount(const char* databaseName /* = null */) int BlibMaker::countSpectra(const char* databaseName /* = NULL */) { if (databaseName != NULL && *databaseName != '\0') - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, "SELECT count(*) FROM %s.RefSpectra", databaseName); + snprintf(zSql, ZSQLBUFLEN, "SELECT count(*) FROM %s.RefSpectra", databaseName); else strncpy(zSql, "SELECT count(*) FROM RefSpectra", ZSQLBUFLEN); @@ -1216,7 +1215,7 @@ void BlibMaker::getRevisionInfo(const char* schemaName, int* dataRev, int* schem if (schemaName == NULL) strncpy(zSql, "SELECT majorVersion, minorVersion FROM LibInfo", ZSQLBUFLEN); else - boost::log::aux::snprintf(zSql, ZSQLBUFLEN, "SELECT majorVersion, minorVersion FROM %s.LibInfo", + snprintf(zSql, ZSQLBUFLEN, "SELECT majorVersion, minorVersion FROM %s.LibInfo", schemaName); int iRow, iCol; diff --git a/pwiz_tools/BiblioSpec/src/BuildParser.cpp b/pwiz_tools/BiblioSpec/src/BuildParser.cpp index b89c3f2af9..804d9c45fb 100644 --- a/pwiz_tools/BiblioSpec/src/BuildParser.cpp +++ b/pwiz_tools/BiblioSpec/src/BuildParser.cpp @@ -102,7 +102,7 @@ void BuildParser::setSpecFileName( { try { - if (bfs::exists(bfs::complete(specfilepath.parent_path(), filepath_))) + if (bfs::exists(bfs::absolute(specfilepath.parent_path(), filepath_))) { localDirectories.insert(localDirectories.begin(), specfilepath.parent_path().string()); } diff --git a/pwiz_tools/Bumbershoot/directag/adjustScanRankerScoreByGroup.cpp b/pwiz_tools/Bumbershoot/directag/adjustScanRankerScoreByGroup.cpp index 7c76263a1b..828a323beb 100644 --- a/pwiz_tools/Bumbershoot/directag/adjustScanRankerScoreByGroup.cpp +++ b/pwiz_tools/Bumbershoot/directag/adjustScanRankerScoreByGroup.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include "pwiz/utility/misc/Filesystem.hpp" using boost::lexical_cast; using namespace std; diff --git a/pwiz_tools/Bumbershoot/freicore/shared_funcs.cpp b/pwiz_tools/Bumbershoot/freicore/shared_funcs.cpp index 8bded8115a..f21976fa0e 100644 --- a/pwiz_tools/Bumbershoot/freicore/shared_funcs.cpp +++ b/pwiz_tools/Bumbershoot/freicore/shared_funcs.cpp @@ -1634,7 +1634,7 @@ namespace freicore { BOOST_FOREACH( string searchPath, searchPathList ) { - path filepath = path(searchPath) / path(filename).leaf(); + path filepath = path(searchPath) / path(filename).filename(); if( exists(filepath) ) return filepath.string(); } diff --git a/pwiz_tools/Bumbershoot/freicore/stdafx.h b/pwiz_tools/Bumbershoot/freicore/stdafx.h index 282166d89b..5a6f5a2cc4 100644 --- a/pwiz_tools/Bumbershoot/freicore/stdafx.h +++ b/pwiz_tools/Bumbershoot/freicore/stdafx.h @@ -144,8 +144,6 @@ #include #include #include -#include -#include #include #include #include @@ -153,6 +151,7 @@ #include "pwiz/utility/misc/Std.hpp" +#include "pwiz/utility/misc/Filesystem.hpp" #include "pwiz/utility/misc/DateTime.hpp" #include "pwiz/data/common/cv.hpp" #include "pwiz/data/proteome/Peptide.hpp" diff --git a/pwiz_tools/Bumbershoot/idpicker/Qonverter/idpQonvert.cpp b/pwiz_tools/Bumbershoot/idpicker/Qonverter/idpQonvert.cpp index 9dcc4469e5..640b59fcd6 100644 --- a/pwiz_tools/Bumbershoot/idpicker/Qonverter/idpQonvert.cpp +++ b/pwiz_tools/Bumbershoot/idpicker/Qonverter/idpQonvert.cpp @@ -328,7 +328,7 @@ struct ImportSettingsHandler : public Parser::ImportSettingsCallback else { analysis.importSettings.proteinDatabaseFilepath = (bfs::path(analysis.filepaths[0]).parent_path() / bfs::path(proteinDatabaseFilepath).filename()).string(); - if (!bfs::exists(analysis.importSettings.proteinDatabaseFilepath) && !proteinDatabaseFilepath.is_complete()) + if (!bfs::exists(analysis.importSettings.proteinDatabaseFilepath) && !proteinDatabaseFilepath.is_absolute()) analysis.importSettings.proteinDatabaseFilepath = (bfs::path(analysis.filepaths[0]).parent_path() / proteinDatabaseFilepath).string(); } @@ -454,12 +454,12 @@ struct UserFeedbackIterationListener : public IterationListener vector updateStrings; - BOOST_FOREACH_FIELD((const string& filepath)(PersistentUpdateMessage& updateMessage), lastUpdateByFilepath) + BOOST_FOREACH_FIELD((const string& filepath)(PersistentUpdateMessage& lastUpdateMessage), lastUpdateByFilepath) { // create a message for each file like "source (message: index/count)" string source = Parser::sourceNameFromFilename(bfs::path(filepath).filename().string()); - int index = updateMessage.iterationIndex; - int count = updateMessage.iterationCount; + int index = lastUpdateMessage.iterationIndex; + int count = lastUpdateMessage.iterationCount; const string& message = originalMessage; if (message.empty()) diff --git a/pwiz_tools/Bumbershoot/quameter/quameter.cpp b/pwiz_tools/Bumbershoot/quameter/quameter.cpp index bfaeec1c9c..eef1efc3fd 100644 --- a/pwiz_tools/Bumbershoot/quameter/quameter.cpp +++ b/pwiz_tools/Bumbershoot/quameter/quameter.cpp @@ -591,7 +591,7 @@ namespace quameter { try { - boost::timer processingTimer; + pwiz::util::Timer processingTimer; string sourceFilename = currentFile.sourceFile; const string& srFile = currentFile.scanRankerFile; @@ -671,7 +671,7 @@ namespace quameter { try { - boost::timer processingTimer; + pwiz::util::Timer processingTimer; string sourceFilename = currentFile.sourceFile; @@ -1286,7 +1286,7 @@ namespace quameter { try { - boost::timer processingTimer; + pwiz::util::Timer processingTimer; string sourceFilename = currentFile.sourceFile; const string& dbFilename = currentFile.idpDBFile; diff --git a/pwiz_tools/Bumbershoot/quameter/quameter.h b/pwiz_tools/Bumbershoot/quameter/quameter.h index 688618e4b6..aec657a266 100644 --- a/pwiz_tools/Bumbershoot/quameter/quameter.h +++ b/pwiz_tools/Bumbershoot/quameter/quameter.h @@ -31,13 +31,13 @@ #include "pwiz/data/proteome/Version.hpp" #include "pwiz_tools/common/FullReaderList.hpp" #include "pwiz/analysis/spectrum_processing/SpectrumListFactory.hpp" +#include "pwiz/utility/misc/Timer.hpp" #include "quameterConfig.h" #include "quameterSharedTypes.h" #include "quameterSharedFuncs.h" #include "quameterFileReaders.h" -#include #include #include #include diff --git a/pwiz_tools/Shared/Common/Controls/CustomTextProgressBar.cs b/pwiz_tools/Shared/Common/Controls/CustomTextProgressBar.cs index 38359345d2..8aaec86ec9 100644 --- a/pwiz_tools/Shared/Common/Controls/CustomTextProgressBar.cs +++ b/pwiz_tools/Shared/Common/Controls/CustomTextProgressBar.cs @@ -18,7 +18,6 @@ using System.Drawing; using System.Windows.Forms; -using System; namespace pwiz.Common.Controls { @@ -60,34 +59,32 @@ protected override void WndProc(ref Message m) switch (m.Msg) { case WM_PAINT: - int m_Percent = Convert.ToInt32((Convert.ToDouble(Value) / Convert.ToDouble(Maximum)) * 100); - dynamic flags = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter | - TextFormatFlags.SingleLine | TextFormatFlags.WordEllipsis; - - using (Graphics g = Graphics.FromHwnd(Handle)) + using (var g = Graphics.FromHwnd(Handle)) { - using (Brush textBrush = new SolidBrush(ForeColor)) - { + DrawText(g, new Rectangle(0, 0, Width, Height)); + } + break; + } + } - switch (DisplayStyle) - { - case ProgressBarDisplayText.CustomText: - TextRenderer.DrawText(g, CustomText, Font, - new Rectangle(0, 0, Width, Height), Color.Black, flags); - break; - case ProgressBarDisplayText.Percentage: - TextRenderer.DrawText(g, string.Format(@"{0}%", m_Percent), Font, - new Rectangle(0, 0, Width, Height), Color.Black, flags); - break; - } + public void DrawText(Graphics g, Rectangle rectangle) + { + int percent = (int) (Value * 100.0 / Maximum); + dynamic flags = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter | + TextFormatFlags.SingleLine | TextFormatFlags.WordEllipsis; - } - } + using var textBrush = new SolidBrush(ForeColor); + switch (DisplayStyle) + { + case ProgressBarDisplayText.CustomText: + TextRenderer.DrawText(g, CustomText, Font, rectangle, Color.Black, flags); + break; + case ProgressBarDisplayText.Percentage: + TextRenderer.DrawText(g, string.Format(@"{0}%", percent), Font, + rectangle, Color.Black, flags); break; } - } - } } \ No newline at end of file diff --git a/pwiz_tools/Shared/CommonUtil/SystemUtil/PInvoke/Gdi32.cs b/pwiz_tools/Shared/CommonUtil/SystemUtil/PInvoke/Gdi32.cs index 6fdf5bd9ab..10d67ff4e4 100644 --- a/pwiz_tools/Shared/CommonUtil/SystemUtil/PInvoke/Gdi32.cs +++ b/pwiz_tools/Shared/CommonUtil/SystemUtil/PInvoke/Gdi32.cs @@ -29,5 +29,8 @@ public static class Gdi32 [DllImport("gdi32.dll", CharSet = CharSet.Auto)] public static extern IntPtr SelectObject(IntPtr hDC, IntPtr hObject); + + [DllImport("gdi32.dll", SetLastError = true)] + public static extern bool DeleteObject(IntPtr hObject); } } \ No newline at end of file diff --git a/pwiz_tools/Skyline/Controls/CustomTip.cs b/pwiz_tools/Skyline/Controls/CustomTip.cs index 0eba1001d8..e8cd00e37e 100644 --- a/pwiz_tools/Skyline/Controls/CustomTip.cs +++ b/pwiz_tools/Skyline/Controls/CustomTip.cs @@ -212,22 +212,29 @@ private void UpdateLayeredWindow(Point point, Size size, byte alpha) IntPtr ptr1 = User32.GetDC(IntPtr.Zero); IntPtr ptr2 = Gdi32.CreateCompatibleDC(ptr1); IntPtr ptr3 = bmp.GetHbitmap(Color.FromArgb(0)); - IntPtr ptr4 = Gdi32.SelectObject(ptr2, ptr3); - size1.cx = size.Width; - size1.cy = size.Height; - point1.x = point.X; - point1.y = point.Y; - point2.x = 0; - point2.y = 0; - User32.BLENDFUNCTION blendfunction1 = new User32.BLENDFUNCTION + try { - BlendOp = 0, - BlendFlags = 0, - SourceConstantAlpha = alpha, - AlphaFormat = 1 - }; - User32.UpdateLayeredWindow(Handle, ptr1, ref point1, ref size1, ptr2, ref point2, 0, ref blendfunction1, 2); - Gdi32.SelectObject(ptr2, ptr4); + IntPtr ptr4 = Gdi32.SelectObject(ptr2, ptr3); + size1.cx = size.Width; + size1.cy = size.Height; + point1.x = point.X; + point1.y = point.Y; + point2.x = 0; + point2.y = 0; + User32.BLENDFUNCTION blendfunction1 = new User32.BLENDFUNCTION + { + BlendOp = 0, + BlendFlags = 0, + SourceConstantAlpha = alpha, + AlphaFormat = 1 + }; + User32.UpdateLayeredWindow(Handle, ptr1, ref point1, ref size1, ptr2, ref point2, 0, ref blendfunction1, 2); + Gdi32.SelectObject(ptr2, ptr4); + } + finally + { + Gdi32.DeleteObject(ptr3); + } User32.ReleaseDC(IntPtr.Zero, ptr1); Gdi32.DeleteDC(ptr2); } diff --git a/pwiz_tools/Skyline/Controls/GroupComparison/FoldChangeVolcanoPlot.cs b/pwiz_tools/Skyline/Controls/GroupComparison/FoldChangeVolcanoPlot.cs index 8e440f7afc..87fc40581b 100644 --- a/pwiz_tools/Skyline/Controls/GroupComparison/FoldChangeVolcanoPlot.cs +++ b/pwiz_tools/Skyline/Controls/GroupComparison/FoldChangeVolcanoPlot.cs @@ -1057,6 +1057,8 @@ public LabelLayout LabelLayout get { return zedGraphControl.GraphPane.Layout; } } + public ZedGraphControl GraphControl { get { return zedGraphControl; } } + #endregion } } diff --git a/pwiz_tools/Skyline/Controls/Startup/StartPage.cs b/pwiz_tools/Skyline/Controls/Startup/StartPage.cs index 2ed3f4acd4..13e02c18db 100644 --- a/pwiz_tools/Skyline/Controls/Startup/StartPage.cs +++ b/pwiz_tools/Skyline/Controls/Startup/StartPage.cs @@ -352,7 +352,7 @@ private void PopulateTutorialPanel() new TutorialActionBoxControl { Caption = TutorialTextResources.TargetedMSMS_Caption, - Icon = TutorialImageResources.TargetedMSMS_start, + Icon = TutorialImageResources.PRM_start, EventAction = () => Tutorial( TutorialLinkResources.TargetedMSMS_zip, TutorialLinkResources.TargetedMSMS_pdf, diff --git a/pwiz_tools/Skyline/Controls/Startup/TutorialImageResources.Designer.cs b/pwiz_tools/Skyline/Controls/Startup/TutorialImageResources.Designer.cs index 10db57341c..b3dc33830b 100644 --- a/pwiz_tools/Skyline/Controls/Startup/TutorialImageResources.Designer.cs +++ b/pwiz_tools/Skyline/Controls/Startup/TutorialImageResources.Designer.cs @@ -19,7 +19,7 @@ namespace pwiz.Skyline.Controls.Startup { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class TutorialImageResources { @@ -243,9 +243,9 @@ internal static System.Drawing.Bitmap PeakPicking_start { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap SmallMolecule_start { + internal static System.Drawing.Bitmap PRM_start { get { - object obj = ResourceManager.GetObject("SmallMolecule_start", resourceCulture); + object obj = ResourceManager.GetObject("PRM_start", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } @@ -253,9 +253,9 @@ internal static System.Drawing.Bitmap SmallMolecule_start { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap SmallMoleculeMethodDevCEOpt_start { + internal static System.Drawing.Bitmap SmallMolecule_start { get { - object obj = ResourceManager.GetObject("SmallMoleculeMethodDevCEOpt_start", resourceCulture); + object obj = ResourceManager.GetObject("SmallMolecule_start", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } @@ -263,9 +263,9 @@ internal static System.Drawing.Bitmap SmallMoleculeMethodDevCEOpt_start { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap SmallMoleculeQuantification_start { + internal static System.Drawing.Bitmap SmallMoleculeMethodDevCEOpt_start { get { - object obj = ResourceManager.GetObject("SmallMoleculeQuantification_start", resourceCulture); + object obj = ResourceManager.GetObject("SmallMoleculeMethodDevCEOpt_start", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } @@ -273,9 +273,9 @@ internal static System.Drawing.Bitmap SmallMoleculeQuantification_start { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap SmallMolLibraries_start { + internal static System.Drawing.Bitmap SmallMoleculeQuantification_start { get { - object obj = ResourceManager.GetObject("SmallMolLibraries_start", resourceCulture); + object obj = ResourceManager.GetObject("SmallMoleculeQuantification_start", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } @@ -283,9 +283,9 @@ internal static System.Drawing.Bitmap SmallMolLibraries_start { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap TargetedMSMS_start { + internal static System.Drawing.Bitmap SmallMolLibraries_start { get { - object obj = ResourceManager.GetObject("TargetedMSMS_start", resourceCulture); + object obj = ResourceManager.GetObject("SmallMolLibraries_start", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } diff --git a/pwiz_tools/Skyline/Controls/Startup/TutorialImageResources.ja.resx b/pwiz_tools/Skyline/Controls/Startup/TutorialImageResources.ja.resx index 8a03c40002..45591d0070 100644 --- a/pwiz_tools/Skyline/Controls/Startup/TutorialImageResources.ja.resx +++ b/pwiz_tools/Skyline/Controls/Startup/TutorialImageResources.ja.resx @@ -157,7 +157,7 @@ ..\..\resources\startpage\smallmolecule_start-ja.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\..\resources\startpage\targetedmsms_start-ja.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\..\resources\startpage\prm_start-ja.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/pwiz_tools/Skyline/Controls/Startup/TutorialImageResources.resx b/pwiz_tools/Skyline/Controls/Startup/TutorialImageResources.resx index 62af6c4c7a..f4d2433ac7 100644 --- a/pwiz_tools/Skyline/Controls/Startup/TutorialImageResources.resx +++ b/pwiz_tools/Skyline/Controls/Startup/TutorialImageResources.resx @@ -179,12 +179,12 @@ ..\..\resources\startpage\smallmoleculequantification_start.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\..\resources\startpage\smallmollibraries_start.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\..\resources\startpage\smallmoleculeimslibraries_start.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\..\resources\startpage\smallmolecule_start.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\..\resources\startpage\targetedmsms_start.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\..\resources\startpage\prm_start.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/pwiz_tools/Skyline/Controls/Startup/TutorialImageResources.zh-CHS.resx b/pwiz_tools/Skyline/Controls/Startup/TutorialImageResources.zh-CHS.resx index 74d5e7e3f3..39e4d6287b 100644 --- a/pwiz_tools/Skyline/Controls/Startup/TutorialImageResources.zh-CHS.resx +++ b/pwiz_tools/Skyline/Controls/Startup/TutorialImageResources.zh-CHS.resx @@ -157,7 +157,7 @@ ..\..\resources\startpage\smallmolecule_start-zh-chs.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\..\resources\startpage\targetedmsms_start-zh-chs.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\..\resources\startpage\prm_start-zh-chs.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/pwiz_tools/Skyline/Controls/WizardPages.cs b/pwiz_tools/Skyline/Controls/WizardPages.cs index eb944a9048..07fe21faf6 100644 --- a/pwiz_tools/Skyline/Controls/WizardPages.cs +++ b/pwiz_tools/Skyline/Controls/WizardPages.cs @@ -23,12 +23,32 @@ namespace pwiz.Skyline.Controls { public class WizardPages : TabControl { + public WizardPages() + { + TabStop = false; // Make sure the TabControl is not a tab stop + } + protected override void WndProc(ref Message m) { // Hide tabs by trapping the TCM_ADJUSTRECT message if (m.Msg == 0x1328 && !DesignMode) m.Result = (IntPtr)1; else base.WndProc(ref m); } + + protected override bool ProcessCmdKey(ref Message msg, Keys keyData) + { + // If the user presses Ctrl+Tab or Ctrl+Shift+Tab, + // just return true to swallow the keystroke, or + // these key combinations will rotate through the tabs. + if (keyData == (Keys.Control | Keys.Tab) || + keyData == (Keys.Control | Keys.Shift | Keys.Tab)) + { + return true; // Keystroke is handled; don't pass to base. + } + + // Otherwise, let the base class handle it + return base.ProcessCmdKey(ref msg, keyData); + } } } diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/AbsoluteQuant/en/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/AbsoluteQuant/en/cover.png new file mode 100644 index 0000000000..ce18e75a8a Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/AbsoluteQuant/en/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/AbsoluteQuant/ja/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/AbsoluteQuant/ja/cover.png new file mode 100644 index 0000000000..b1614ac749 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/AbsoluteQuant/ja/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/AbsoluteQuant/zh-CHS/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/AbsoluteQuant/zh-CHS/cover.png new file mode 100644 index 0000000000..f42a94bf96 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/AbsoluteQuant/zh-CHS/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/AuditLog/en/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/AuditLog/en/cover.png new file mode 100644 index 0000000000..eef8d5a7a0 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/AuditLog/en/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/CustomReports/en/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/CustomReports/en/cover.png new file mode 100644 index 0000000000..0268cc117c Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/CustomReports/en/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/CustomReports/ja/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/CustomReports/ja/cover.png new file mode 100644 index 0000000000..33290aad7b Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/CustomReports/ja/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/CustomReports/zh-CHS/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/CustomReports/zh-CHS/cover.png new file mode 100644 index 0000000000..0117be8598 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/CustomReports/zh-CHS/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/DDASearch/en/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/DDASearch/en/cover.png new file mode 100644 index 0000000000..bdec37d019 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/DDASearch/en/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/DDASearch/en/s-12.png b/pwiz_tools/Skyline/Documentation/Tutorials/DDASearch/en/s-12.png index f60c3945e7..ba7f4f313d 100644 Binary files a/pwiz_tools/Skyline/Documentation/Tutorials/DDASearch/en/s-12.png and b/pwiz_tools/Skyline/Documentation/Tutorials/DDASearch/en/s-12.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/DDASearch/ja/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/DDASearch/ja/cover.png new file mode 100644 index 0000000000..d69c772a70 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/DDASearch/ja/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/DDASearch/ja/s-12.png b/pwiz_tools/Skyline/Documentation/Tutorials/DDASearch/ja/s-12.png index 1448d800fb..afb8e2cb88 100644 Binary files a/pwiz_tools/Skyline/Documentation/Tutorials/DDASearch/ja/s-12.png and b/pwiz_tools/Skyline/Documentation/Tutorials/DDASearch/ja/s-12.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/DDASearch/zh-CHS/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/DDASearch/zh-CHS/cover.png new file mode 100644 index 0000000000..41b462528b Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/DDASearch/zh-CHS/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/DDASearch/zh-CHS/s-12.png b/pwiz_tools/Skyline/Documentation/Tutorials/DDASearch/zh-CHS/s-12.png index cc1e27b9c6..bee2558251 100644 Binary files a/pwiz_tools/Skyline/Documentation/Tutorials/DDASearch/zh-CHS/s-12.png and b/pwiz_tools/Skyline/Documentation/Tutorials/DDASearch/zh-CHS/s-12.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/DIA-PASEF/en/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/DIA-PASEF/en/cover.png new file mode 100644 index 0000000000..7a664b0ddb Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/DIA-PASEF/en/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/DIA-QE/en/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/DIA-QE/en/cover.png new file mode 100644 index 0000000000..92135d296e Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/DIA-QE/en/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/DIA-QE/ja/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/DIA-QE/ja/cover.png new file mode 100644 index 0000000000..c91244cd11 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/DIA-QE/ja/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/DIA-QE/zh-CHS/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/DIA-QE/zh-CHS/cover.png new file mode 100644 index 0000000000..d529cb8945 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/DIA-QE/zh-CHS/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/DIA-TTOF/en/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/DIA-TTOF/en/cover.png new file mode 100644 index 0000000000..b403bb1b71 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/DIA-TTOF/en/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/DIA-TTOF/ja/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/DIA-TTOF/ja/cover.png new file mode 100644 index 0000000000..8dce3b6b37 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/DIA-TTOF/ja/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/DIA-TTOF/zh-CHS/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/DIA-TTOF/zh-CHS/cover.png new file mode 100644 index 0000000000..b6ac2f53c1 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/DIA-TTOF/zh-CHS/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/DIA-Umpire-TTOF/en/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/DIA-Umpire-TTOF/en/cover.png new file mode 100644 index 0000000000..1946749ff1 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/DIA-Umpire-TTOF/en/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/DIA/en/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/DIA/en/cover.png new file mode 100644 index 0000000000..bdec85e636 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/DIA/en/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/DIA/en/index.html b/pwiz_tools/Skyline/Documentation/Tutorials/DIA/en/index.html index 575010f7fd..95c74ce568 100644 --- a/pwiz_tools/Skyline/Documentation/Tutorials/DIA/en/index.html +++ b/pwiz_tools/Skyline/Documentation/Tutorials/DIA/en/index.html @@ -549,6 +549,7 @@

Exploring DIA Results

  • Right-click one of the chromatogram graphs, and click Legend to uncheck it.
  • Dock the Peak Areas – Replicate Comparison graph to the right edge of the main window on top of the Library Match view.
  • +
  • Right-click the Peak Areas – Replicate Comparison graph, choose Show Dot Product, and click Labels.
  • Select the first peptide K.YALSQDVCTYR.D [64, 74] in the Targets view.
  • diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/DIA/ja/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/DIA/ja/cover.png new file mode 100644 index 0000000000..4faa4f6ebe Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/DIA/ja/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/DIA/zh-CHS/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/DIA/zh-CHS/cover.png new file mode 100644 index 0000000000..0e202a0dbf Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/DIA/zh-CHS/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/en/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/en/cover.png new file mode 100644 index 0000000000..230384093a Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/en/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/en/s-24.png b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/en/s-24.png index ffb3cac209..2d7bf5baea 100644 Binary files a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/en/s-24.png and b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/en/s-24.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/en/s-25.png b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/en/s-25.png index 9b692f013f..05951fe4ef 100644 Binary files a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/en/s-25.png and b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/en/s-25.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/en/s-30.png b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/en/s-30.png index 6330b4c876..2b1a7a8787 100644 Binary files a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/en/s-30.png and b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/en/s-30.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/en/s-31.png b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/en/s-31.png index 770f71872d..abee28aadc 100644 Binary files a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/en/s-31.png and b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/en/s-31.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/en/s-34.png b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/en/s-34.png index f61c66256b..3282520d39 100644 Binary files a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/en/s-34.png and b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/en/s-34.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/en/s-36.png b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/en/s-36.png index 8cba7f128b..de59878ae7 100644 Binary files a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/en/s-36.png and b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/en/s-36.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/ja/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/ja/cover.png new file mode 100644 index 0000000000..cab3845715 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/ja/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/ja/s-24.png b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/ja/s-24.png index 346630dc18..9ee324cbfc 100644 Binary files a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/ja/s-24.png and b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/ja/s-24.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/ja/s-25.png b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/ja/s-25.png index 0b5db194ee..ca207e1e46 100644 Binary files a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/ja/s-25.png and b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/ja/s-25.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/ja/s-30.png b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/ja/s-30.png index 150c2a1ad4..adbd721e80 100644 Binary files a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/ja/s-30.png and b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/ja/s-30.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/ja/s-31.png b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/ja/s-31.png index f797527e11..5a85147acf 100644 Binary files a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/ja/s-31.png and b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/ja/s-31.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/ja/s-34.png b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/ja/s-34.png index 530b407576..7f5076c7b7 100644 Binary files a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/ja/s-34.png and b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/ja/s-34.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/ja/s-36.png b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/ja/s-36.png index ac0fece3a1..21fb7e5d3c 100644 Binary files a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/ja/s-36.png and b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/ja/s-36.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/zh-CHS/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/zh-CHS/cover.png new file mode 100644 index 0000000000..80cea7384f Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/zh-CHS/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/zh-CHS/s-24.png b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/zh-CHS/s-24.png index bff9a1fc7e..55b4214e5c 100644 Binary files a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/zh-CHS/s-24.png and b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/zh-CHS/s-24.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/zh-CHS/s-25.png b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/zh-CHS/s-25.png index 2358939a32..e2ea37f829 100644 Binary files a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/zh-CHS/s-25.png and b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/zh-CHS/s-25.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/zh-CHS/s-30.png b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/zh-CHS/s-30.png index 1100854925..9e106f9e06 100644 Binary files a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/zh-CHS/s-30.png and b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/zh-CHS/s-30.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/zh-CHS/s-31.png b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/zh-CHS/s-31.png index 5f84c910b9..24e95e70d2 100644 Binary files a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/zh-CHS/s-31.png and b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/zh-CHS/s-31.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/zh-CHS/s-34.png b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/zh-CHS/s-34.png index e8cb250d62..3ffd982ef6 100644 Binary files a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/zh-CHS/s-34.png and b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/zh-CHS/s-34.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/zh-CHS/s-36.png b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/zh-CHS/s-36.png index d86f26495b..02781fbba9 100644 Binary files a/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/zh-CHS/s-36.png and b/pwiz_tools/Skyline/Documentation/Tutorials/ExistingQuant/zh-CHS/s-36.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/GroupedStudies/en/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/GroupedStudies/en/cover.png new file mode 100644 index 0000000000..c9ba5b59f5 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/GroupedStudies/en/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/GroupedStudies/ja/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/GroupedStudies/ja/cover.png new file mode 100644 index 0000000000..e7cd170308 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/GroupedStudies/ja/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/GroupedStudies/zh-CHS/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/GroupedStudies/zh-CHS/cover.png new file mode 100644 index 0000000000..5d3521799a Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/GroupedStudies/zh-CHS/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/HiResMetabolomics/en/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/HiResMetabolomics/en/cover.png new file mode 100644 index 0000000000..35616a97f4 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/HiResMetabolomics/en/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/IMSFiltering/en/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/IMSFiltering/en/cover.png new file mode 100644 index 0000000000..49e30db0c4 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/IMSFiltering/en/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/LibraryExplorer/en/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/LibraryExplorer/en/cover.png new file mode 100644 index 0000000000..06c5528d64 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/LibraryExplorer/en/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/MS1Filtering/en/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/MS1Filtering/en/cover.png new file mode 100644 index 0000000000..76dcf402b5 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/MS1Filtering/en/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/MS1Filtering/ja/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/MS1Filtering/ja/cover.png new file mode 100644 index 0000000000..6d334f211a Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/MS1Filtering/ja/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/MS1Filtering/zh-CHS/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/MS1Filtering/zh-CHS/cover.png new file mode 100644 index 0000000000..341792cc1b Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/MS1Filtering/zh-CHS/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/MethodEdit/en/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/MethodEdit/en/cover.png new file mode 100644 index 0000000000..583f9e2b79 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/MethodEdit/en/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/MethodEdit/ja/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/MethodEdit/ja/cover.png new file mode 100644 index 0000000000..9e0ed0f47d Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/MethodEdit/ja/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/MethodEdit/zh-CHS/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/MethodEdit/zh-CHS/cover.png new file mode 100644 index 0000000000..aff5aedbce Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/MethodEdit/zh-CHS/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/MethodRefine/en/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/MethodRefine/en/cover.png new file mode 100644 index 0000000000..48c9144b02 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/MethodRefine/en/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/MethodRefine/ja/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/MethodRefine/ja/cover.png new file mode 100644 index 0000000000..3939de4ff2 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/MethodRefine/ja/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/MethodRefine/zh-CHS/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/MethodRefine/zh-CHS/cover.png new file mode 100644 index 0000000000..1ff4959e21 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/MethodRefine/zh-CHS/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/OptimizeCE/en/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/OptimizeCE/en/cover.png new file mode 100644 index 0000000000..7cac794a86 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/OptimizeCE/en/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/PRM/en/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/PRM/en/cover.png new file mode 100644 index 0000000000..4634b50aa0 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/PRM/en/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/PRM/en/index.html b/pwiz_tools/Skyline/Documentation/Tutorials/PRM/en/index.html index f07d4d3972..928d3a0185 100644 --- a/pwiz_tools/Skyline/Documentation/Tutorials/PRM/en/index.html +++ b/pwiz_tools/Skyline/Documentation/Tutorials/PRM/en/index.html @@ -483,6 +483,7 @@

    Reviewing the Data

    • On the View menu, choose Peak Areas and click Replicate Comparison (F7).
    • On the View menu, choose Transitions and click Products (Ctrl-Alt-F10).
    • +
    • Right-click the Peak Areas – Replicate Comparison graph, choose Show Dot Product, and click Labels.

    The Peak Areas graph should now look like this: @@ -496,7 +497,6 @@

    Reviewing the Data

    • Right-click the Peak Areas graph, choose Normalize To and click None.
    • Right-click the Peak Areas graph, and click Show Library.
    • -
    • Right-click the Peak Areas graph, and click Show Dot Product.

    You can review all of the target peptides with these settings to see that they all match the search spectra very well, and that the diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/PRM/ja/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/PRM/ja/cover.png new file mode 100644 index 0000000000..909cc853b3 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/PRM/ja/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/PRM/zh-CHS/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/PRM/zh-CHS/cover.png new file mode 100644 index 0000000000..9f0b5e7d5b Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/PRM/zh-CHS/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/PeakPicking/en/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/PeakPicking/en/cover.png new file mode 100644 index 0000000000..cb935a088f Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/PeakPicking/en/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/SmallMolecule/en/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/SmallMolecule/en/cover.png new file mode 100644 index 0000000000..2b28899cd9 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/SmallMolecule/en/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/SmallMolecule/ja/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/SmallMolecule/ja/cover.png new file mode 100644 index 0000000000..9fd29d1612 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/SmallMolecule/ja/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/SmallMolecule/zh-CHS/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/SmallMolecule/zh-CHS/cover.png new file mode 100644 index 0000000000..38e04b716b Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/SmallMolecule/zh-CHS/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/SmallMoleculeIMSLibraries/en/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/SmallMoleculeIMSLibraries/en/cover.png new file mode 100644 index 0000000000..448e4d7e18 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/SmallMoleculeIMSLibraries/en/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/SmallMoleculeMethodDevCEOpt/en/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/SmallMoleculeMethodDevCEOpt/en/cover.png new file mode 100644 index 0000000000..0482fc2222 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/SmallMoleculeMethodDevCEOpt/en/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/SmallMoleculeMethodDevCEOpt/ja/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/SmallMoleculeMethodDevCEOpt/ja/cover.png new file mode 100644 index 0000000000..f717c0fb3a Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/SmallMoleculeMethodDevCEOpt/ja/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/SmallMoleculeMethodDevCEOpt/zh-CHS/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/SmallMoleculeMethodDevCEOpt/zh-CHS/cover.png new file mode 100644 index 0000000000..6da8e8a801 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/SmallMoleculeMethodDevCEOpt/zh-CHS/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/SmallMoleculeQuantification/en/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/SmallMoleculeQuantification/en/cover.png new file mode 100644 index 0000000000..1f63ee5e85 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/SmallMoleculeQuantification/en/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/SmallMoleculeQuantification/ja/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/SmallMoleculeQuantification/ja/cover.png new file mode 100644 index 0000000000..f539a9a828 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/SmallMoleculeQuantification/ja/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/SmallMoleculeQuantification/zh-CHS/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/SmallMoleculeQuantification/zh-CHS/cover.png new file mode 100644 index 0000000000..f4e1a626b2 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/SmallMoleculeQuantification/zh-CHS/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/iRT/en/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/iRT/en/cover.png new file mode 100644 index 0000000000..bec246ca26 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/iRT/en/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/iRT/ja/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/iRT/ja/cover.png new file mode 100644 index 0000000000..eb6be1a6e0 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/iRT/ja/cover.png differ diff --git a/pwiz_tools/Skyline/Documentation/Tutorials/iRT/zh-CHS/cover.png b/pwiz_tools/Skyline/Documentation/Tutorials/iRT/zh-CHS/cover.png new file mode 100644 index 0000000000..8e89e9b1d0 Binary files /dev/null and b/pwiz_tools/Skyline/Documentation/Tutorials/iRT/zh-CHS/cover.png differ diff --git a/pwiz_tools/Skyline/FileUI/PeptideSearch/SearchControl.cs b/pwiz_tools/Skyline/FileUI/PeptideSearch/SearchControl.cs index 502c1f69d4..04e78d3845 100644 --- a/pwiz_tools/Skyline/FileUI/PeptideSearch/SearchControl.cs +++ b/pwiz_tools/Skyline/FileUI/PeptideSearch/SearchControl.cs @@ -98,6 +98,37 @@ protected virtual void UpdateTaskbarProgress(TaskbarProgress.TaskbarStates state Program.MainWindow.UpdateTaskbarProgress(state, percentComplete); } + public interface IProgressLock + { + int? LockLineCount { get; } + string FilterMessage(string message); + } + + private IProgressLock _progressLock; + + public IProgressLock ProgressLock + { + get + { + return _progressLock; + } + set + { + bool unlocking = IsProgressLocked && value == null; + _progressLock = value; + if (unlocking) + RefreshProgressTextbox(); + } + } + + public bool IsProgressLocked + { + get + { + return (_progressLock?.LockLineCount ?? int.MaxValue) <= _progressTextItems.Count; + } + } + protected int lastSegment = -1; protected string lastMessage; protected string lastSegmentName; @@ -133,13 +164,16 @@ protected void UpdateSearchEngineProgress(IProgressStatus status) if (status.SegmentCount > 0) percentComplete = status.Segment * 100 / status.SegmentCount + status.ZoomedPercentComplete / status.SegmentCount; - UpdateTaskbarProgress(TaskbarProgress.TaskbarStates.Normal, percentComplete); - if (status.PercentComplete == -1) - progressBar.Style = ProgressBarStyle.Marquee; - else + if (!IsProgressLocked) { - progressBar.Value = percentComplete; - progressBar.Style = ProgressBarStyle.Continuous; + UpdateTaskbarProgress(TaskbarProgress.TaskbarStates.Normal, percentComplete); + if (status.PercentComplete == -1) + progressBar.Style = ProgressBarStyle.Marquee; + else + { + progressBar.Value = percentComplete; + progressBar.Style = ProgressBarStyle.Continuous; + } } // look at the last 10 lines for the same message and if found do not relog the same message @@ -155,9 +189,17 @@ protected void UpdateSearchEngineProgress(IProgressStatus status) return; } + if (ProgressLock != null) + { + message = ProgressLock.FilterMessage(message); + if (string.IsNullOrEmpty(message)) + return; + } + var newEntry = new ProgressEntry(DateTime.Now, message); _progressTextItems.Add(newEntry); - txtSearchProgress.AppendLineWithAutoScroll($@"{newEntry.ToString(showTimestampsCheckbox.Checked)}{Environment.NewLine}"); + if (!IsProgressLocked) + txtSearchProgress.AppendLineWithAutoScroll($@"{newEntry.ToString(showTimestampsCheckbox.Checked)}{Environment.NewLine}"); } public void SetProgressBarDisplayStyle(ProgressBarDisplayText style) @@ -174,6 +216,8 @@ public void SetProgressBarText(string message) } } + public ProgressBar ProgressBar => progressBar; + public int PercentComplete => progressBar.Value; protected CancellationTokenSource _cancelToken; diff --git a/pwiz_tools/Skyline/Model/AbstractModificationMatcher.cs b/pwiz_tools/Skyline/Model/AbstractModificationMatcher.cs index a8a3f8ed69..aff42e72d7 100644 --- a/pwiz_tools/Skyline/Model/AbstractModificationMatcher.cs +++ b/pwiz_tools/Skyline/Model/AbstractModificationMatcher.cs @@ -529,7 +529,7 @@ private void GetSmallMoleculeFragments(LibKey key, TransitionGroupDocNode nodeGr // Filter again, retain only those with rank info, or at least an interesting name SpectrumHeaderInfo groupLibInfo = null; var transitionRanks = new Dictionary(); - nodeGroupUnranked.GetLibraryInfo(Settings, ExplicitMods.EMPTY, true, ref groupLibInfo, transitionRanks); + nodeGroupUnranked.GetLibraryInfo(Settings, ExplicitMods.EMPTY, false, true, ref groupLibInfo, transitionRanks); foreach (var ranked in transitionRanks) { transitionDocNodes.Add(TransitionFromPeakAndAnnotations(key, nodeGroupMatched, fragmentCharge, ranked.Value.MI, ranked.Value.Rank)); diff --git a/pwiz_tools/Skyline/Model/DocSettings/Prediction.cs b/pwiz_tools/Skyline/Model/DocSettings/Prediction.cs index 29f276d824..f10e2a9482 100644 --- a/pwiz_tools/Skyline/Model/DocSettings/Prediction.cs +++ b/pwiz_tools/Skyline/Model/DocSettings/Prediction.cs @@ -2802,8 +2802,8 @@ public string GetRegressionDescription(double r, double window) public void GetCurve(RetentionTimeStatistics statistics, out double[] lineScores, out double[] lineTimes) { // Find maximum hydrophobicity score points for drawing the regression line - lineScores = new[] { Double.MaxValue, 0 }; - lineTimes = new[] { Double.MaxValue, 0 }; + lineScores = new[] { Double.MaxValue, Double.MinValue }; + lineTimes = new[] { Double.MaxValue, Double.MinValue }; for (int i = 0; i < statistics.ListHydroScores.Count; i++) { diff --git a/pwiz_tools/Skyline/Model/Irt/IrtDb.cs b/pwiz_tools/Skyline/Model/Irt/IrtDb.cs index 1ea3d8c39e..a9c31f6e63 100644 --- a/pwiz_tools/Skyline/Model/Irt/IrtDb.cs +++ b/pwiz_tools/Skyline/Model/Irt/IrtDb.cs @@ -601,7 +601,7 @@ public static string GenerateDocumentXml(IEnumerable standards, SrmDocum // Minimize document to only the peptides we need var minimalPeptides = standards.ToHashSet(); - var oldPeptides = new Dictionary(); + var addPeptides = new Dictionary(); if (!string.IsNullOrEmpty(oldXml)) { try @@ -609,7 +609,8 @@ public static string GenerateDocumentXml(IEnumerable standards, SrmDocum using (var reader = new StringReader(oldXml)) { var oldDoc = (SrmDocument)new XmlSerializer(typeof(SrmDocument)).Deserialize(reader); - oldPeptides = oldDoc.Molecules.Where(pep => minimalPeptides.Contains(pep.Target)).ToDictionary(pep => pep.Target, pep => pep); + addPeptides = oldDoc.Molecules.Where(pep => minimalPeptides.Contains(pep.ModifiedTarget)) + .ToDictionary(pep => pep.ModifiedTarget, pep => pep.RemoveFastaSequence()); } } catch @@ -618,59 +619,91 @@ public static string GenerateDocumentXml(IEnumerable standards, SrmDocum } } - var addPeptides = new List(); - foreach (var nodePep in doc.Molecules.Where(pep => minimalPeptides.Contains(pep.Target))) + foreach (var nodePep in doc.Molecules.Where(pep => minimalPeptides.Contains(pep.ModifiedTarget))) { - if (oldPeptides.TryGetValue(nodePep.Target, out var nodePepOld)) - { - addPeptides.Add(nodePep.Merge(nodePepOld)); - oldPeptides.Remove(nodePep.Target); - } - else - { - addPeptides.Add(nodePep); - } + var addPep = nodePep.RemoveFastaSequence(); + if (addPeptides.TryGetValue(nodePep.ModifiedTarget, out var existing)) + addPep = addPep.Merge(existing); + addPeptides[nodePep.ModifiedTarget] = addPep; } - addPeptides.AddRange(oldPeptides.Values); var peptides = new List(); - foreach (var nodePep in addPeptides) - { - var precursors = new List(); - foreach (TransitionGroupDocNode nodeTranGroup in nodePep.Children) + Dictionary standardPeps = null; // Only create this once, if necessary + bool addedDocPeptides = false; + foreach (var nodePep in addPeptides.Values) + { + // Remove MS1 transitions which can be recalculated and are not useful + var nodePepMinimal = RemoveMs1Transitions(nodePep); + var nodeTranGroup = nodePepMinimal.TransitionGroups.FirstOrDefault(); + if (nodeTranGroup != null) { var transitions = nodeTranGroup.Transitions.Where(tran => tran.ResultsRank.HasValue) .OrderBy(tran => tran.ResultsRank.Value) .Select(tran => tran.ChangeResults(null)) .Cast().ToList(); + if (transitions.Count < 3) + { + // CONSIDER: We could also rank by the library ranking which might + // allow us to get valid relative transition abundance based on a library + // spectrum, e.g. if the source was DDA data and only chromatograms for + // the precursors were extracted. + // Here that case is handled for the CiRT peptides where we have stored + // the relative transition abundance reported in the paper. + standardPeps ??= IrtStandard.CIRT.GetDocument().Peptides.ToDictionary(p => p.Target, p => p); + if (standardPeps.TryGetValue(nodePep.Target, out var nodePepStandard)) + { + peptides.Add(nodePepStandard); + continue; + } + } + if (transitions.Count > 0) - precursors.Add(nodeTranGroup.ChangeResults(null).ChangeChildren(transitions)); - } - if (precursors.Count > 0) - { - peptides.Add((PeptideDocNode)nodePep.ChangeResults(null).ChangeChildren(precursors)); + { + var nodePepNew = (PeptideDocNode)nodePepMinimal.ChangeChildren(new[] + { nodeTranGroup.ChangeResults(null).ChangeChildren(transitions) }); + peptides.Add(nodePepNew.ChangeResults(null)); + addedDocPeptides = true; + } } } if (peptides.Count == 0) return null; + if (peptides.Count < minimalPeptides.Count) + { + // If this document does not contain the full set of standard peptides, but there is a built-in IrtStandard that does have them all + // then return null so that the built-in standard will be used instead of the incomplete document xml. + var matchingStandard = IrtStandard.WhichStandard(minimalPeptides); + if (matchingStandard != null) + { + return null; + } + } + - // Clear some settings to make the document smaller and so that they won't get imported into a document - doc = doc.ChangeMeasuredResults(null); - doc = (SrmDocument)doc.ChangeChildren(new[] + // Empty peptide list with iRT standards name + var nodePepGroup = new PeptideGroupDocNode(new PeptideGroup(), Annotations.EMPTY, + Resources.IrtDb_MakeDocumentXml_iRT_standards, string.Empty, + Array.Empty(), false); + + if (!addedDocPeptides) + doc = IrtStandard.CIRT.GetDocument(); // All CiRT peptides so start with the CiRT document + else { - new PeptideGroupDocNode(new PeptideGroup(), Resources.IrtDb_MakeDocumentXml_iRT_standards, string.Empty, - Array.Empty()) - }); - doc = doc.ChangeSettings(doc.Settings.ChangePeptideLibraries(libs => libs.ChangeLibraries(new List(), new List()))); + // Clear some settings to make the document smaller and so that they won't get imported into a document + doc = (SrmDocument)doc.ChangeMeasuredResults(null).ChangeChildren(new[] { nodePepGroup }); + doc = doc.ChangeSettings(doc.Settings.ChangePeptideLibraries(libs => + libs.ChangeLibraries(new List(), new List()))); + } + // Add the peptides after clearing the libraries so they preserve their library ranking peptides.Sort((nodePep1, nodePep2) => nodePep1.ModifiedTarget.CompareTo(nodePep2.ModifiedTarget)); - doc = (SrmDocument)doc.ChangeChildren(new[] + doc = (SrmDocument) doc.ChangeChildren(new [] { new PeptideGroupDocNode(new PeptideGroup(), Annotations.EMPTY, Resources.IrtDb_MakeDocumentXml_iRT_standards, string.Empty, peptides.ToArray(), false) }); - using (var writer = new StringWriter()) + using (var writer = new XmlStringWriter()) using (var writer2 = new XmlTextWriter(writer)) { doc.Serialize(writer2, null, SkylineVersion.CURRENT, null); @@ -678,6 +711,27 @@ public static string GenerateDocumentXml(IEnumerable standards, SrmDocum } } + private static PeptideDocNode RemoveMs1Transitions(PeptideDocNode nodePep) + { + var nodeGroup = nodePep.TransitionGroups.FirstOrDefault(); + if (nodePep.TransitionGroupCount > 1) + { + // Take the precursor with the most peak area. + // This assumes that they start out comparable and that removing the MS1 + // transitions may leave them with nothing to compare by. + nodeGroup = nodePep.TransitionGroups.OrderByDescending(g => + g.Transitions.Sum(t => t.GetPeakArea(-1))).First(); + } + + if (nodeGroup == null) + return nodePep; + + var listTrans = new List(nodeGroup.Transitions.Where(t => !t.IsMs1)); + nodeGroup = (TransitionGroupDocNode)nodeGroup.ChangeChildrenChecked(listTrans); + + return (PeptideDocNode)nodePep.ChangeChildrenChecked(new[] { nodeGroup }); + } + private static void EnsureDocumentXmlTable(ISession session) { if (!SqliteOperations.TableExists(session.Connection, @"DocumentXml")) diff --git a/pwiz_tools/Skyline/Model/Irt/IrtPeptidePicker.cs b/pwiz_tools/Skyline/Model/Irt/IrtPeptidePicker.cs index eeadb7e4e6..083ac089c8 100644 --- a/pwiz_tools/Skyline/Model/Irt/IrtPeptidePicker.cs +++ b/pwiz_tools/Skyline/Model/Irt/IrtPeptidePicker.cs @@ -47,7 +47,7 @@ public MeasuredPeptide(MeasuredPeptide other) : this(other.Target, other.Retenti public Target Target { get; set; } public double RetentionTime { get; set; } - public string Sequence { get { return Target == null ? string.Empty : Target.ToSerializableString(); } } + public string Sequence => Target?.ToSerializableString() ?? string.Empty; public static string ValidateSequence(Target sequence) { @@ -63,8 +63,7 @@ public static string ValidateSequence(Target sequence) public static string ValidateRetentionTime(string rtText, bool allowNegative) { - double rtValue; - if (rtText == null || !double.TryParse(rtText, out rtValue)) + if (rtText == null || !double.TryParse(rtText, out var rtValue)) return IrtResources.MeasuredPeptide_ValidateRetentionTime_Measured_retention_times_must_be_valid_decimal_numbers; if (!allowNegative && rtValue <= 0) return IrtResources.MeasuredPeptide_ValidateRetentionTime_Measured_retention_times_must_be_greater_than_zero; @@ -87,19 +86,25 @@ public IrtPeptidePicker() } public bool HasScoredPeptides => _scoredPeptides != null && _scoredPeptides.Length > 0; - public int CirtPeptideCount => _cirtPeptides != null ? _cirtPeptides.Length : 0; + public int CirtPeptideCount => _cirtPeptides?.Length ?? 0; private double MinRt => _scoredPeptides.First().Peptide.RetentionTime; private double MaxRt => _scoredPeptides.Last().Peptide.RetentionTime; private double RtRange => MaxRt - MinRt; - private IEnumerable BucketBoundaries => new[] + private IEnumerable BucketBoundaries => GetBucketBoundaries(MinRt, MaxRt); + + private static IEnumerable GetBucketBoundaries(double minRt, double maxRt) { - MinRt + RtRange * 1 / 8, - MinRt + RtRange * 2 / 8, - MinRt + RtRange * 4 / 8, - MinRt + RtRange * 6 / 8, - MinRt + RtRange * 7 / 8, - double.MaxValue - }; + double rtRange = maxRt - minRt; + return new[] + { + minRt + rtRange * 1 / 8, + minRt + rtRange * 2 / 8, + minRt + rtRange * 4 / 8, + minRt + rtRange * 6 / 8, + minRt + rtRange * 7 / 8, + double.MaxValue + }; + } public double? CirtIrt(Target target) { @@ -138,36 +143,38 @@ public void ScorePeptides(SrmDocument doc, IProgressMonitor progressMonitor) _cirtPeptides = _scoredPeptides.Where(pep => _cirtAll.ContainsKey(pep.Peptide.Target)).ToArray(); } - public bool TryGetCirtRegression(int count, out RegressionLine regression, out IEnumerable> matchedPeptides) + public CirtRegressionResult GetCirtRegressionResult(int count) { - matchedPeptides = null; - var success = TryGetCirtRegression(count, out regression, out List peptides); - if (success) - { - matchedPeptides = peptides.Select(pep => Tuple.Create( - new DbIrtPeptide(pep.Peptide.Target, _cirtAll[pep.Peptide.Target], true, TimeSource.peak), - pep.NodePep)); - } - return success; - } - - private bool TryGetCirtRegression(int count, out RegressionLine regression, out List peptides) - { - peptides = new List(_cirtPeptides); var rts = _cirtPeptides.Select(pep => pep.Peptide.RetentionTime).ToList(); var irts = _cirtPeptides.Select(pep => _cirtAll[pep.Peptide.Target]).ToList(); var removedValues = new List>(); - var success = IrtRegression.TryGet(rts, irts, count, out var line, removedValues); - regression = (RegressionLine) line; - if (!success) - return false; + if (!IrtRegression.TryGet(rts, irts, count, out var line, removedValues)) + return CirtRegressionResult.EMPTY; + + var peptides = new List(_cirtPeptides); for (var i = peptides.Count - 1; i >= 0; i--) { if (removedValues.Contains(Tuple.Create(rts[i], irts[i]))) peptides.RemoveAt(i); } - return peptides.Count >= count; + + var buckets = PeptideBucket.BucketPeptides(peptides, BucketBoundaries); + int bucketCountWithPeptides = buckets.Count(bucket => !bucket.Empty); + bool coversRtRange = buckets.Length - bucketCountWithPeptides < 3; // Allow two buckets to be empty + if (!coversRtRange) + { + // Or if the total range in iRT-C18 space is greater than or equal to + // the original Biognosys 10 standards (narrower range to omit the first + // high-variance early-eluting peptide of Biognosys 11) + double minOrig = IrtStandard.BIOGNOSYS_10.Peptides.Min(pep => pep.Irt); + double maxOrig = IrtStandard.BIOGNOSYS_10.Peptides.Max(pep => pep.Irt); + var pepIrts = peptides.Select(pep => _cirtAll[pep.Peptide.Target]).ToList(); + double minIrt = pepIrts.Min(); + double maxIrt = pepIrts.Max(); + coversRtRange = (maxIrt - minIrt) / (maxOrig - minOrig) >= 0.85; + } + return new CirtRegressionResult((RegressionLine)line, peptides, _cirtAll, coversRtRange, MinRt, MaxRt); } ///

    @@ -180,31 +187,32 @@ private bool TryGetCirtRegression(int count, out RegressionLine regression, out /// The number of peptides to be picked /// Peptides that cannot be picked /// Use CiRT peptides, if possible - public List Pick(int count, ICollection exclude, bool cirt) + public List Pick(int count, ICollection exclude, CirtRegressionResult cirt) { - PeptideBucket[] buckets = null; - if (cirt && TryGetCirtRegression(count, out _, out List scoredCirtPeptides)) + var bucketPeps = _scoredPeptides.AsEnumerable(); + var bucketBoundaries = BucketBoundaries; + if (cirt != null && cirt.Valid && cirt.Peptides != null) { - // If each bucket contains at least one, prompt to use CiRT peptides - var cirtBuckets = PeptideBucket.BucketPeptides(scoredCirtPeptides, BucketBoundaries); - if (cirtBuckets.All(bucket => !bucket.Empty)) - buckets = cirtBuckets; + bucketPeps = cirt.Peptides.AsEnumerable(); + var cirtTimes = cirt.Peptides.Select(p => p.Time).ToArray(); + bucketBoundaries = GetBucketBoundaries(cirtTimes.Min(), cirtTimes.Max()); } + if (exclude != null && exclude.Count > 0) + bucketPeps = bucketPeps.Where(pep => !exclude.Contains(pep.Peptide.Target)); - if (buckets == null) - buckets = exclude == null || exclude.Count == 0 - ? PeptideBucket.BucketPeptides(_scoredPeptides, BucketBoundaries) - : PeptideBucket.BucketPeptides(_scoredPeptides.Where(pep => !exclude.Contains(pep.Peptide.Target)), BucketBoundaries); + var buckets = PeptideBucket.BucketPeptides(bucketPeps, bucketBoundaries); var endBuckets = new[] { buckets.First(), buckets.Last() }; var midBuckets = buckets.Skip(1).Take(buckets.Length - 2).ToArray(); var bestPeptides = new List(); while (bestPeptides.Count < count && buckets.Any(bucket => !bucket.Empty)) { - bestPeptides.AddRange(PeptideBucket.Pop(endBuckets, endBuckets.Length, true) - .Take(Math.Min(endBuckets.Length, count - bestPeptides.Count)).Select(pep => pep.Peptide)); - bestPeptides.AddRange(PeptideBucket.Pop(midBuckets, midBuckets.Length, false) - .Take(Math.Min(midBuckets.Length, count - bestPeptides.Count)).Select(pep => pep.Peptide)); + var bestEndPeptides = PeptideBucket.Pop(endBuckets, endBuckets.Length, true) + .Take(Math.Min(endBuckets.Length, count - bestPeptides.Count)); + bestPeptides.AddRange(bestEndPeptides.Select(pep => pep.Peptide)); + var bestMidPeptides = PeptideBucket.Pop(midBuckets, midBuckets.Length, false) + .Take(Math.Min(midBuckets.Length, count - bestPeptides.Count)); + bestPeptides.AddRange(bestMidPeptides.Select(pep => pep.Peptide)); } bestPeptides.Sort((x, y) => x.RetentionTime.CompareTo(y.RetentionTime)); return bestPeptides.Select(pep => new MeasuredPeptide(pep)).ToList(); @@ -276,13 +284,42 @@ public static void SetStandards(IEnumerable peptides, IrtStandard SetStandards(peptides, standard.Peptides.Select(pep => pep.ModifiedTarget)); } + public class CirtRegressionResult + { + public RegressionLine Regression { get; } + public ImmutableList Peptides { get; } + private TargetMap Irts { get; } + public bool CoversRTRange { get; } + + public double MinRt { get; } + public double MaxRt { get; } + + public bool Valid => Regression != null && CoversRTRange; + public int Count => Peptides?.Count ?? 0; + public IEnumerable DbIrtPeptides => Peptides.Select(pep => + new DbIrtPeptide(pep.Peptide.Target, Irts[pep.Peptide.Target], true, TimeSource.peak)); + public IEnumerable NodePeps => Peptides.Select(pep => pep.NodePep); + + public static readonly CirtRegressionResult EMPTY = new CirtRegressionResult(null, null, null, false, 0, 0); + + public CirtRegressionResult(RegressionLine regression, IEnumerable peptides, TargetMap irts, bool coversRtRange, double minRt, double maxRt) + { + Regression = regression; + Peptides = ImmutableList.ValueOf(peptides); + Irts = irts; + CoversRTRange = coversRtRange; + MinRt = minRt; + MaxRt = maxRt; + } + } + private interface IBucketable { double Time { get; } float Score { get; } // lower scores get picked first } - private class ScoredPeptide : IBucketable + public class ScoredPeptide : IBucketable { public MeasuredPeptide Peptide { get; } public PeptideDocNode NodePep { get; } @@ -319,7 +356,7 @@ private PeptideBucket(double maxTime) private T Pop() { if (Empty) - return default(T); + return default; var pep = _peptides.First(); _peptides.RemoveAt(0); return pep; @@ -327,15 +364,13 @@ private T Pop() public static PeptideBucket[] BucketPeptides(IEnumerable peptides, IEnumerable rtBoundaries) { - // peptides must be sorted by retention time (low to high) var buckets = rtBoundaries.OrderBy(x => x).Select(boundary => new PeptideBucket(boundary)).ToArray(); - var curBucketIdx = 0; - var curBucket = buckets[0]; - foreach (var pep in peptides) + var curBucket = 0; + foreach (var pep in peptides.OrderBy(pep => pep.Time)) { - if (pep.Time > curBucket._maxTime) - curBucket = buckets[++curBucketIdx]; - curBucket._peptides.Add(pep); + if (pep.Time > buckets[curBucket]._maxTime) + curBucket++; + buckets[curBucket]._peptides.Add(pep); } buckets.ForEach(bucket => bucket._peptides.Sort((x, y) => x.Score.CompareTo(y.Score))); return buckets; diff --git a/pwiz_tools/Skyline/Model/Irt/IrtResources.designer.cs b/pwiz_tools/Skyline/Model/Irt/IrtResources.designer.cs index d0fb3b585a..ffd8d78d87 100644 --- a/pwiz_tools/Skyline/Model/Irt/IrtResources.designer.cs +++ b/pwiz_tools/Skyline/Model/Irt/IrtResources.designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 @@ -19,7 +19,7 @@ namespace pwiz.Skyline.Model.Irt { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] public class IrtResources { @@ -80,15 +80,12 @@ public static string EditIrtCalcDlg_RecalibrateStandards_Could_not_get_a_minimum } /// - /// Looks up a localized string similar to The calculator {0} requires all {1} of its standard peptides to be in the targets list in order to determine a regression. The following {2} peptides are missing: - /// - ///{3}. + /// Looks up a localized string similar to The calculator {0} requires at least {1} of its {2} standard peptides. The following {3} peptides are missing:. /// - public static string IncompleteStandardException_The_calculator__0__requires_all__1__of_its_standard_peptides_to_be_in_the_targets_list_in_order_to_determine_a_regression_The_following__2__peptides_are_missing___3__ { + public static string IncompleteStandardException_MissingTargetsMessage_The_calculator__0__requires_at_least__1__of_its__2__standard_peptides__The_following__3__peptides_are_missing_ { get { - return ResourceManager.GetString("IncompleteStandardException_The_calculator__0__requires_all__1__of_its_standard_p" + - "eptides_to_be_in_the_targets_list_in_order_to_determine_a_regression_The_followi" + - "ng__2__peptides_are_missing___3__", resourceCulture); + return ResourceManager.GetString("IncompleteStandardException_MissingTargetsMessage_The_calculator__0__requires_at_" + + "least__1__of_its__2__standard_peptides__The_following__3__peptides_are_missing_", resourceCulture); } } @@ -210,6 +207,15 @@ public static string IrtStandard_AUTO_Automatic { } } + /// + /// Looks up a localized string similar to Standard peptides must specify a sequence and score.. + /// + public static string IrtStandard_ReadXml_Standard_peptides_must_specify_a_sequence_and_score_ { + get { + return ResourceManager.GetString("IrtStandard_ReadXml_Standard_peptides_must_specify_a_sequence_and_score_", resourceCulture); + } + } + /// /// Looks up a localized string similar to Adding retention times. /// diff --git a/pwiz_tools/Skyline/Model/Irt/IrtResources.resx b/pwiz_tools/Skyline/Model/Irt/IrtResources.resx index f4cda91d44..f04dcc191b 100644 --- a/pwiz_tools/Skyline/Model/Irt/IrtResources.resx +++ b/pwiz_tools/Skyline/Model/Irt/IrtResources.resx @@ -124,11 +124,6 @@ Could not get a minimum or maximum standard peptide. - - The calculator {0} requires all {1} of its standard peptides to be in the targets list in order to determine a regression. The following {2} peptides are missing: - -{3} - iRT Database Files @@ -189,4 +184,10 @@ Unexpected use of iRT calculator before successful initialization. + + The calculator {0} requires at least {1} of its {2} standard peptides. The following {3} peptides are missing: + + + Standard peptides must specify a sequence and score. + \ No newline at end of file diff --git a/pwiz_tools/Skyline/Model/Irt/IrtStandard.cs b/pwiz_tools/Skyline/Model/Irt/IrtStandard.cs index 1d32ad2a9c..0103d8d4cf 100644 --- a/pwiz_tools/Skyline/Model/Irt/IrtStandard.cs +++ b/pwiz_tools/Skyline/Model/Irt/IrtStandard.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using System.Xml; using System.Xml.Serialization; using pwiz.Common.Chemistry; using pwiz.Common.Collections; @@ -10,9 +11,11 @@ using pwiz.Skyline.Model.Lib; using pwiz.Skyline.Model.Results; using pwiz.Skyline.Properties; +using pwiz.Skyline.Util; namespace pwiz.Skyline.Model.Irt { + [XmlRoot("irt_standard")] public class IrtStandard : XmlNamedElement { public static IrtStandard AUTO => new IrtStandard(IrtResources.IrtStandard_AUTO_Automatic, null, null, Array.Empty()); @@ -191,7 +194,7 @@ public class IrtStandard : XmlNamedElement MakePeptide(@"DSTLIMQLLR", 101.79), }); - public static readonly IrtStandard CIRT = new IrtStandard(@"CiRT", null, null, + public static readonly IrtStandard CIRT = new IrtStandard(@"CiRT", @"CiRT_all.sky", null, new[] { MakePeptide(@"ADTLDPALLRPGR", 35.99), MakePeptide(@"AFEEAEK", -21.36), @@ -341,7 +344,7 @@ public IrtStandard(string name, string skyFile, string docXml, IEnumerable Peptides { get; private set; } @@ -522,7 +525,7 @@ private static DbIrtPeptide MakePeptide(string sequence, double time) public static IrtStandard WhichStandard(IEnumerable peptides) { var list = peptides.Select(p => new DbIrtPeptide(p, 0, true, TimeSource.peak)).ToList(); - return ALL.FirstOrDefault(s => s.ContainsAll(list, null)) ?? EMPTY; + return ALL.Append(CIRT).FirstOrDefault(s => s.ContainsAll(list, null)) ?? EMPTY; } public IrtStandard ChangePeptides(IEnumerable peptides) @@ -535,11 +538,6 @@ public IrtStandard ChangeDocXml(string docXml) return ChangeProp(ImClone(this), im => im.DocXml = docXml); } - public override string ToString() - { - return Name; - } - public static List BestMatch(IEnumerable targets) { var targetMap = new TargetMap(targets.Select(t => new KeyValuePair(t, true))); @@ -586,5 +584,127 @@ public static List BestMatch(ICollection targets) return matches; } + + #region Implementation of IXmlSerializable + + /// + /// For serialization + /// + private IrtStandard() + { + } + + private enum ATTR + { + resource_sky_file, + sequence, + value + } + + private enum EL + { + irt_peptide, + doc_xml + } + + public static IrtStandard Deserialize(XmlReader reader) + { + return reader.Deserialize(new IrtStandard()); + } + + public override void ReadXml(XmlReader reader) + { + // Read tag attributes + base.ReadXml(reader); + + _resourceSkyFile = reader.GetAttribute(ATTR.resource_sky_file); + + bool empty = reader.IsEmptyElement; + // Consume tag + reader.Read(); + + var listPeptides = new List(); + if (!empty) + { + while (reader.IsStartElement(EL.irt_peptide)) + { + string sequence = reader.GetAttribute(ATTR.sequence); + double? value = reader.GetNullableDoubleAttribute(ATTR.value); + if (string.IsNullOrEmpty(sequence) || !value.HasValue) + throw new InvalidDataException(IrtResources.IrtStandard_ReadXml_Standard_peptides_must_specify_a_sequence_and_score_); + listPeptides.Add(MakePeptide(sequence, value.Value)); + reader.Read(); + } + + if (reader.IsStartElement(EL.doc_xml)) + { + reader.ReadElementContentAsString(); + } + reader.ReadEndElement(); + } + + Peptides = ImmutableList.ValueOf(listPeptides); + } + + public override void WriteXml(XmlWriter writer) + { + // Write tag attributes + base.WriteXml(writer); + + writer.WriteAttributeIfString(ATTR.resource_sky_file, _resourceSkyFile); + foreach (var dbIrtPeptide in Peptides) + { + writer.WriteStartElement(EL.irt_peptide); + writer.WriteAttributeString(ATTR.sequence, dbIrtPeptide.Target.Sequence); + writer.WriteAttribute(ATTR.value, dbIrtPeptide.Irt); + writer.WriteEndElement(); + } + + if (!string.IsNullOrEmpty(DocXml)) + { + writer.WriteStartElement(EL.doc_xml); + writer.WriteString(DocXml); + writer.WriteEndElement(); + } + } + + #endregion + + #region object overrides + + protected bool Equals(IrtStandard other) + { + return base.Equals(other) && + _resourceSkyFile == other._resourceSkyFile && + DocXml == other.DocXml && + Equals(Peptides, other.Peptides); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != this.GetType()) return false; + return Equals((IrtStandard)obj); + } + + public override int GetHashCode() + { + unchecked + { + int hashCode = base.GetHashCode(); + hashCode = (hashCode * 397) ^ (_resourceSkyFile != null ? _resourceSkyFile.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (DocXml != null ? DocXml.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Peptides != null ? Peptides.GetHashCode() : 0); + return hashCode; + } + } + + public override string ToString() + { + return Name; + } + + #endregion } } diff --git a/pwiz_tools/Skyline/Model/Irt/RCalcIrt.cs b/pwiz_tools/Skyline/Model/Irt/RCalcIrt.cs index 3b987271f9..aa9ee8ac94 100644 --- a/pwiz_tools/Skyline/Model/Irt/RCalcIrt.cs +++ b/pwiz_tools/Skyline/Model/Irt/RCalcIrt.cs @@ -27,6 +27,7 @@ using pwiz.Skyline.Model.RetentionTimes; using pwiz.Skyline.Properties; using pwiz.Skyline.Util; +using pwiz.Skyline.Util.Extensions; namespace pwiz.Skyline.Model.Irt { @@ -149,7 +150,7 @@ public override IEnumerable ChooseRegressionPeptides(IEnumerable inStandardButNotTargets.ExceptWith(pepArr); //Console.Out.WriteLine(@"Database standards: {0}", string.Join(@"; ", _database.StandardPeptides)); //Console.Out.WriteLine(@"Chosen ({0}): {1}", pepArr.Length, string.Join(@"; ", pepArr.Select(pep => pep.ToString()))); - throw new IncompleteStandardException(this, databaseCount, inStandardButNotTargets); + throw new IncompleteStandardException(this, databaseCount, MinStandardCount(databaseCount), inStandardButNotTargets); } minCount = MinStandardCount(databaseCount); @@ -161,6 +162,13 @@ public override IEnumerable GetStandardPeptides(IEnumerable pept return ChooseRegressionPeptides(peptides, out _); } + public bool IsStandard(Target seq) + { + RequireUsable(); + + return _database.IsStandard(seq); + } + public override double? ScoreSequence(Target seq) { return _database?.ScoreSequence(seq); @@ -874,7 +882,7 @@ public override IEnumerable ChooseRegressionPeptides(IEnumerable var inStandardButNotTargets = new SortedSet(_dictStandards.Keys); inStandardButNotTargets.ExceptWith(peptideArray); - throw new IncompleteStandardException(this, standardsCount, inStandardButNotTargets); + throw new IncompleteStandardException(this, standardsCount, RCalcIrt.MinStandardCount(standardsCount), inStandardButNotTargets); } minCount = RCalcIrt.MinStandardCount(standardsCount); @@ -889,17 +897,27 @@ public override IEnumerable GetStandardPeptides(IEnumerable pept public class IncompleteStandardException : CalculatorException { - //This will only be thrown by ChooseRegressionPeptides so it is OK to have an error specific to regressions. - private static string ERROR => IrtResources - .IncompleteStandardException_The_calculator__0__requires_all__1__of_its_standard_peptides_to_be_in_the_targets_list_in_order_to_determine_a_regression_The_following__2__peptides_are_missing___3__; - public RetentionScoreCalculatorSpec Calculator { get; private set; } - public IncompleteStandardException(RetentionScoreCalculatorSpec calc, int standardPeptideCount, ICollection missingPeptides) - : base(String.Format(ERROR, calc.Name, standardPeptideCount, missingPeptides.Count, - string.Join(Environment.NewLine, missingPeptides.Select(o => o.Sequence)))) + public IncompleteStandardException(RetentionScoreCalculatorSpec calc, int standardCount, int minStandardCount, + ICollection missingTargets) : base(MissingTargetsMessage(calc, standardCount, minStandardCount, + missingTargets)) { Calculator = calc; } + + private static string MissingTargetsMessage(RetentionScoreCalculatorSpec calc, int standardCount, + int minStandardCount, ICollection missingTargets) + { + var lines = new List + { + string.Format( + IrtResources.IncompleteStandardException_MissingTargetsMessage_The_calculator__0__requires_at_least__1__of_its__2__standard_peptides__The_following__3__peptides_are_missing_, + calc.Name, standardCount, minStandardCount, missingTargets.Count), + string.Empty + }; + lines.AddRange(missingTargets.Select(target => target.ToString())); + return TextUtil.LineSeparate(lines); + } } } diff --git a/pwiz_tools/Skyline/Model/Irt/StandardsDocuments/CiRT.sky b/pwiz_tools/Skyline/Model/Irt/StandardsDocuments/CiRT.sky index c15b038605..6764ff3cc6 100644 --- a/pwiz_tools/Skyline/Model/Irt/StandardsDocuments/CiRT.sky +++ b/pwiz_tools/Skyline/Model/Irt/StandardsDocuments/CiRT.sky @@ -69,6 +69,7 @@ 421.758352 743.441014 15.557751 + @@ -379,30 +380,31 @@ 441.276378 501.303124 16.143291 - + 441.276378 614.387188 16.143291 - + 441.276378 711.439952 16.143291 - + 441.276378 551.355159 16.143291 - + 441.276378 768.461415 16.143291 + diff --git a/pwiz_tools/Skyline/Model/Irt/StandardsDocuments/CiRT_all.sky b/pwiz_tools/Skyline/Model/Irt/StandardsDocuments/CiRT_all.sky new file mode 100644 index 0000000000..85c0f681b6 --- /dev/null +++ b/pwiz_tools/Skyline/Model/Irt/StandardsDocuments/CiRT_all.sky @@ -0,0 +1,3182 @@ + + + + + + + + + + + + + + + + + 465.59653 + 440.279786 + + + + 465.59653 + 604.859129 + + + + 465.59653 + 497.793258 + + + + 465.59653 + 485.29429 + + + + + + + + 412.19525 + 605.277697 + + + + 412.19525 + 752.346111 + + + + 412.19525 + 476.235104 + + + + + + + + 489.26875 + 759.424696 + + + + 489.26875 + 646.340632 + + + + 489.26875 + 533.256568 + + + + 489.26875 + 404.213974 + + + + + + + + 488.72778 + 630.284179 + + + + 488.72778 + 701.321293 + + + + 488.72778 + 458.235772 + + + + 488.72778 + 424.698492 + + + + 488.72778 + 573.262716 + + + + + + + + 472.769251 + 575.330007 + + + + 472.769251 + 428.261593 + + + + 472.769251 + 703.388585 + + + + 472.769251 + 517.276909 + + + + + + + + 422.747984 + 660.367515 + + + + 422.747984 + 547.283451 + + + + 422.747984 + 490.261987 + + + + + + + + 417.198659 + 665.300164 + + + + 417.198659 + 461.210286 + + + + 417.198659 + 608.2787 + + + + 417.198659 + 545.235438 + + + + 417.198659 + 762.352928 + + + + + + + + 637.809833 + 962.432635 + + + + 637.809833 + 776.353322 + + + + 637.809833 + 661.326378 + + + + 637.809833 + 1075.516699 + + + + 637.809833 + 560.2787 + + + + + + + + 559.248406 + 752.326575 + + + + 559.248406 + 909.3697 + + + + 559.248406 + 1022.453764 + + + + 559.248406 + 716.808019 + + + + 559.248406 + 630.783815 + + + + + + + + 518.787307 + 751.398481 + + + + 518.787307 + 864.482545 + + + + 518.787307 + 694.377017 + + + + 518.787307 + 432.74491 + + + + 518.787307 + 623.339903 + + + + + + + + 639.843676 + 795.435929 + + + + 639.843676 + 694.38825 + + + + 639.843676 + 923.494506 + + + + 639.843676 + 1108.574548 + + + + 639.843676 + 1037.537434 + + + + + + + + 599.856389 + 441.269418 + + + + 599.856389 + 514.803625 + + + + 599.856389 + 485.29429 + + + + 599.856389 + 881.531561 + + + + + + 400.240018 + 514.803625 + + + + 400.240018 + 441.269418 + + + + 400.240018 + 584.362704 + + + + 400.240018 + 784.478797 + + + + + + + + + + + + + + 567.266412 + 688.326044 + + + + 567.266412 + 902.457787 + + + + 567.266412 + 587.278366 + + + + 567.266412 + 801.410108 + + + + + + + + 600.340769 + 742.456999 + + + + 600.340769 + 671.419885 + + + + 600.340769 + 855.541063 + + + + 600.340769 + 458.224539 + + + + + + 400.562938 + 501.314357 + + + + 400.562938 + 671.419885 + + + + 400.562938 + 586.283117 + + + + 400.562938 + 742.456999 + + + + + + + + 556.296361 + 788.462478 + + + + 556.296361 + 660.403901 + + + + 556.296361 + 463.264333 + + + + 556.296361 + 460.287808 + + + + 556.296361 + 539.220851 + + + + + + + + 509.276772 + 773.476731 + + + + 509.276772 + 660.392667 + + + + 509.276772 + 559.344989 + + + + 509.276772 + 446.260925 + + + + 509.276772 + 459.208555 + + + + + + + + + + + + + + 619.77883 + 808.361778 + + + + 619.77883 + 879.398892 + + + + 619.77883 + 648.33113 + + + + 619.77883 + 449.235438 + + + + 619.77883 + 1010.439376 + + + + + + + + 499.746793 + 770.375303 + + + + 499.746793 + 669.327624 + + + + 499.746793 + 554.300681 + + + + 499.746793 + 721.340297 + + + + + + + + 663.380425 + 855.541063 + + + + 663.380425 + 456.292893 + + + + 663.380425 + 685.435535 + + + + 663.380425 + 983.59964 + + + + 663.380425 + 798.519599 + + + + + + + + 463.216714 + 595.308603 + + + + 463.216714 + 696.356282 + + + + 463.216714 + 538.287139 + + + + + + + + 595.334098 + 660.386142 + + + + 595.334098 + 773.470206 + + + + 595.334098 + 886.55427 + + + + 595.334098 + 417.19799 + + + + + + + + 599.764757 + 734.331523 + + + + 599.764757 + 833.399937 + + + + 599.764757 + 465.19799 + + + + 599.764757 + 677.31006 + + + + 599.764757 + 562.283117 + + + + + + + + 453.737617 + 692.3726 + + + + 453.737617 + 564.314023 + + + + 453.737617 + 435.27143 + + + + + + + + 550.292756 + 798.47198 + + + + 550.292756 + 585.360639 + + + + 550.292756 + 684.429053 + + + + 550.292756 + 416.15646 + + + + 550.292756 + 515.224873 + + + + + + + + 518.58429 + 595.80128 + + + + 518.58429 + 822.425699 + + + + 518.58429 + 675.357285 + + + + 518.58429 + 547.274898 + + + + 518.58429 + 677.332944 + + + + + + + + + + + + + + 523.739834 + 757.399149 + + + + 523.739834 + 458.251029 + + + + 523.739834 + 571.335093 + + + + 523.739834 + 686.362036 + + + + + + + + 512.228144 + 637.305249 + + + + 512.228144 + 708.342363 + + + + 512.228144 + 409.219394 + + + + 512.228144 + 779.379477 + + + + + + + + 520.261987 + 740.368578 + + + + 520.261987 + 643.315814 + + + + 520.261987 + 431.236107 + + + + 520.261987 + 546.26305 + + + + + + + + 461.740691 + 656.3726 + + + + 461.740691 + 585.335487 + + + + 461.740691 + 651.309666 + + + + 461.740691 + 514.298373 + + + + + + + + 425.718893 + 608.303852 + + + + 425.718893 + 409.208161 + + + + 425.718893 + 537.266738 + + + + + + + + 408.732334 + 446.272158 + + + + 408.732334 + 574.330736 + + + + + + + + 408.23471 + 460.251423 + + + + 408.23471 + 573.335487 + + + + 408.23471 + 469.302061 + + + + + + + + 638.324982 + 920.431966 + + + + 638.324982 + 833.399937 + + + + 638.324982 + 1033.51603 + + + + 638.324982 + 719.35701 + + + + 638.324982 + 561.287868 + + + + + + + + 493.770602 + 627.382437 + + + + 493.770602 + 726.45085099999994 + + + + + + + + 534.314023 + 500.355494 + + + + 534.314023 + 637.414406 + + + + 534.314023 + 750.49847 + + + + 534.314023 + 568.272552 + + + + + + + + 621.819866 + 786.410442 + + + + 621.819866 + 1014.52145 + + + + 621.819866 + 627.334818 + + + + + + + + 690.294744 + 874.401334 + + + + 690.294744 + 817.379871 + + + + 690.294744 + 645.331464 + + + + 690.294744 + 402.245943 + + + + 690.294744 + 1002.459912 + + + + + + + + 444.220214 + 625.337795 + + + + 444.220214 + 740.364738 + + + + 444.220214 + 512.253731 + + + + 444.220214 + 507.227182 + + + + + + + + + + + + + + 522.732009 + 555.234393 + + + + 522.732009 + 782.361384 + + + + 522.732009 + 668.318457 + + + + 522.732009 + 897.388327 + + + + 522.732009 + 490.229624 + + + + + + + + + + + + + + 650.305538 + 781.366135 + + + + 650.305538 + 1023.492792 + + + + 650.305538 + 894.450199 + + + + 650.305538 + 406.160876 + + + + 650.305538 + 621.335487 + + + + + + + + 592.32713 + 537.314357 + + + + 592.32713 + 794.451913 + + + + 592.32713 + 907.535977 + + + + 592.32713 + 647.339903 + + + + 592.32713 + 707.419885 + + + + + + + + 599.334955 + 537.314357 + + + + 599.334955 + 707.419885 + + + + 599.334955 + 661.355553 + + + + 599.334955 + 808.467563 + + + + 599.334955 + 921.551627 + + + + + + + + 455.232502 + 518.268135 + + + + 455.232502 + 665.336549 + + + + 455.232502 + 447.231021 + + + + 455.232502 + 762.389313 + + + + + + + + 594.314023 + 912.493778 + + + + 594.314023 + 712.377686 + + + + 594.314023 + 556.287808 + + + + 594.314023 + 825.46175 + + + + 594.314023 + 655.356222 + + + + + + + + 718.380622 + 988.542185 + + + + 718.380622 + 1059.579299 + + + + 718.380622 + 616.377686 + + + + 718.380622 + 931.520721 + + + + 718.380622 + 844.488693 + + + + + + + + 410.234179 + 571.344989 + + + + 410.234179 + 672.392667 + + + + 410.234179 + 472.276575 + + + + 410.234179 + 463.218725 + + + + + + + + 722.88079 + 1085.533411 + + + + 722.88079 + 599.812376 + + + + 722.88079 + 746.379142 + + + + 722.88079 + 574.330736 + + + + 722.88079 + 971.490484 + + + + + + + + + + + + + + 467.73676 + 717.414131 + + + + 467.73676 + 588.371538 + + + + 467.73676 + 489.303124 + + + + 467.73676 + 446.170395 + + + + 467.73676 + 545.238809 + + + + + + + + 530.275095 + 631.352199 + + + + 530.275095 + 518.268135 + + + + 530.275095 + 431.236107 + + + + 530.275095 + 429.19799 + + + + 530.275095 + 744.436263 + + + + + + + + 796.407368 + 1062.481041 + + + + 796.407368 + 762.337671 + + + + 796.407368 + 1161.549455 + + + + 796.407368 + 918.427549 + + + + 796.407368 + 1005.459578 + + + + + + + + 586.837331 + 776.39373 + + + + 586.837331 + 613.330401 + + + + 586.837331 + 556.308937 + + + + 586.837331 + 459.256174 + + + + 586.837331 + 889.477794 + + + + + + + + 719.928074 + 1112.642233 + + + + 719.928074 + 831.468292 + + + + 719.928074 + 618.35695 + + + + 719.928074 + 495.303792 + + + + 719.928074 + 878.520662 + + + + + + + + + + + + + + 579.259453 + 849.388327 + + + + 579.259453 + 720.345734 + + + + 579.259453 + 489.277972 + + + + 579.259453 + 493.727257 + + + + 579.259453 + 560.315085 + + + + + + + + + + + + + + 664.310297 + 710.365407 + + + + 664.310297 + 781.40252 + + + + 664.310297 + 910.445113 + + + + 664.310297 + 1011.492792 + + + + 664.310297 + 522.303458 + + + + + + + + 579.829506 + 613.330401 + + + + 579.829506 + 556.308937 + + + + 579.829506 + 776.39373 + + + + 579.829506 + 889.477794 + + + + 579.829506 + 546.32861 + + + + + + + + 588.807716 + 613.330401 + + + + 588.807716 + 776.39373 + + + + 588.807716 + 556.308937 + + + + 588.807716 + 907.434214 + + + + 588.807716 + 564.285031 + + + + + + + + 674.835851 + 1064.5371 + + + + 674.835851 + 1211.605514 + + + + 674.835851 + 749.394064 + + + + 674.835851 + 878.436657 + + + + 674.835851 + 600.277637 + + + + + + 450.226326 + 564.314023 + + + + 450.226326 + 600.277637 + + + + 450.226326 + 785.357679 + + + + 450.226326 + 657.299101 + + + + + + + + 578.809105 + 906.467957 + + + + 578.809105 + 692.336215 + + + + 578.809105 + 805.420279 + + + + 578.809105 + 1019.552021 + + + + + + + + 425.766512 + 600.382771 + + + + 425.766512 + 713.466835 + + + + 425.766512 + 472.324194 + + + + 425.766512 + 563.330007 + + + + + + + + 480.742899 + 710.335546 + + + + 480.742899 + 823.41961 + + + + 480.742899 + 538.261987 + + + + 480.742899 + 423.223811 + + + + 480.742899 + 685.330401 + + + + + + + + 429.235044 + 621.335487 + + + + 429.235044 + 569.283057 + + + + 429.235044 + 720.403901 + + + + 429.235044 + 640.320171 + + + + 429.235044 + 711.357285 + + + + + + + + + + + + + + 476.239469 + 678.35695 + + + + 476.239469 + 838.387599 + + + + 476.239469 + 563.330007 + + + + 476.239469 + 416.261593 + + + + + + + + + + + + + + 574.947123 + 805.375014 + + + + 574.947123 + 725.35969 + + + + 574.947123 + 1027.520721 + + + + 574.947123 + 401.28708 + + + + 574.947123 + 842.44068 + + + + + + + + 484.284064 + 604.859129 + + + + 484.284064 + 440.279786 + + + + 484.284064 + 554.33529 + + + + 484.284064 + 669.380425 + + + + + + + + 513.30874 + 685.399149 + + + + 513.30874 + 428.261593 + + + + 513.30874 + 912.526141 + + + + 513.30874 + 628.377686 + + + + 513.30874 + 527.330007 + + + + + + + + 488.284734 + 692.3726 + + + + 488.284734 + 545.304186 + + + + 488.284734 + 862.478128 + + + + 488.284734 + 805.456664 + + + + 488.284734 + 431.261259 + + + + + + + + 441.276378 + 768.461415 + + + + 441.276378 + 501.303124 + + + + 441.276378 + 711.439952 + + + + 441.276378 + 614.387188 + + + + 441.276378 + 551.355159 + + + + + + + + 427.740159 + 604.330067 + + + + 427.740159 + 595.283451 + + + + 427.740159 + 475.287474 + + + + 427.740159 + 708.367515 + + + + + + + + 830.451245 + 1190.641565 + + + + 830.451245 + 666.345717 + + + + 830.451245 + 470.260925 + + + + 830.451245 + 595.82442 + + + + 830.451245 + 595.308603 + + + + + + + + + + + + + + 597.760432 + 918.366195 + + + + 597.760432 + 714.276317 + + + + 597.760432 + 1081.429523 + + + + 597.760432 + 551.212988 + + + + 597.760432 + 861.344731 + + + + + + + + 622.366452 + 1115.630666 + + + + 622.366452 + 905.493838 + + + + 622.366452 + 663.367181 + + + + 622.366452 + 1018.577902 + + + + 622.366452 + 792.409774 + + + + + + + + 408.714142 + 632.299829 + + + + 408.714142 + 703.336943 + + + + 408.714142 + 503.257236 + + + + + + + + 737.424833 + 918.540728 + + + + 737.424833 + 805.456664 + + + + 737.424833 + 478.277243 + + + + 737.424833 + 1118.656821 + + + + 737.424833 + 577.345657 + + + + + + + + 488.776742 + 750.37808 + + + + 488.776742 + 506.308544 + + + + 488.776742 + 621.335487 + + + + 488.776742 + 863.462144 + + + + 488.776742 + 618.313354 + + + + + + + + 422.268553 + 617.361701 + + + + 422.268553 + 504.277637 + + + + 422.268553 + 730.445765 + + + + 422.268553 + 453.343532 + + + + + + + + 488.279117 + 431.737085 + + + + 488.279117 + 765.414131 + + + + 488.279117 + 862.466895 + + + + 488.279117 + 652.330067 + + + + 488.279117 + 409.244546 + + + + + + + + 658.833308 + 962.432635 + + + + 658.833308 + 1075.516699 + + + + 658.833308 + 776.353322 + + + + 658.833308 + 489.241586 + + + + 658.833308 + 560.2787 + + + + + + + + + + + + + + 544.792066 + 664.2719 + + + + 544.792066 + 876.424378 + + + + 544.792066 + 763.340314 + + + + 544.792066 + 492.223494 + + + + 544.792066 + 607.250437 + + + + + + + + 508.292756 + 803.425758 + + + + 508.292756 + 591.27328 + + + + 508.292756 + 690.341694 + + + + 508.292756 + 419.224873 + + + + 508.292756 + 402.216517 + + + + + + + + 580.802957 + 884.451245 + + + + 580.802957 + 756.392667 + + + + 580.802957 + 867.424696 + + + + 580.802957 + 657.324253 + + + + 580.802957 + 405.213246 + + + + + + + + + + + + + + 490.718044 + 736.304263 + + + + 490.718044 + 418.204472 + + + + 490.718044 + 649.272235 + + + + 490.718044 + 849.388327 + + + + + + + + 488.782359 + 749.43045 + + + + 488.782359 + 636.346386 + + + + 488.782359 + 579.324922 + + + + 488.782359 + 522.303458 + + + + + + + + 471.771991 + 715.409714 + + + + 471.771991 + 616.3413 + + + + 471.771991 + 487.298707 + + + + 471.771991 + 416.261593 + + + + 471.771991 + 598.319502 + + + + + + + + 454.26601 + 680.397753 + + + + 454.26601 + 567.313689 + + + + 454.26601 + 480.28166 + + + + 454.26601 + 793.481817 + + + + + + + + 607.806228 + 987.478188 + + + + 607.806228 + 859.41961 + + + + 607.806228 + 696.356282 + + + + 607.806228 + 418.26601 + + + + + + + + 654.329878 + 763.384562 + + + + 654.329878 + 1062.569068 + + + + 654.329878 + 876.468626 + + + + 654.329878 + 456.220122 + + + + + + + + 492.777273 + 472.287808 + + + + 492.777273 + 686.383165 + + + + 492.777273 + 571.356222 + + + + 492.777273 + 785.451579 + + + + + + + + 457.78711 + 416.286745 + + + + 457.78711 + 586.392273 + + + + 457.78711 + 515.355159 + + + + 457.78711 + 685.460687 + + + + + + + + 402.216517 + 645.356616 + + + + 402.216517 + 548.303852 + + + + 402.216517 + 461.271824 + + + + 402.216517 + 558.251817 + + + + + + + + + + + + + + 592.750407 + 784.32289 + + + + 592.750407 + 637.254476 + + + + 592.750407 + 912.381468 + + + + 592.750407 + 401.177923 + + + + 592.750407 + 855.360004 + + + + + + + + 595.642139 + 902.524684 + + + + 595.642139 + 545.319443 + + + + 595.642139 + 658.403507 + + + + 595.642139 + 710.890429 + + + + 595.642139 + 805.471921 + + + + + + + + 416.25036 + 643.413737 + + + + 416.25036 + 514.371144 + + + + 416.25036 + 431.21364 + + + + 416.25036 + 544.297704 + + + + + + + + 560.803488 + 932.519993 + + + + 560.803488 + 730.424636 + + + + 560.803488 + 831.472314 + + + + 560.803488 + 466.763634 + + + + 560.803488 + 811.430844 + + + + + + + + 895.949597 + 1298.669905 + + + + 895.949597 + 689.357679 + + + + 895.949597 + 475.225936 + + + + 895.949597 + 802.441743 + + + + 895.949597 + 1086.590198 + + + + + + 597.63549 + 689.357679 + + + + 597.63549 + 475.225936 + + + + 597.63549 + 802.441743 + + + + 597.63549 + 989.457452 + + + + 597.63549 + 890.389038 + + + + + + + + 631.824094 + 1048.50917 + + + + 631.824094 + 846.431572 + + + + 631.824094 + 731.404629 + + + + 631.824094 + 977.472057 + + + + 631.824094 + 444.292893 + + + + + + + + 491.262944 + 767.38687 + + + + 491.262944 + 537.277972 + + + + 491.262944 + 668.318456 + + + + 491.262944 + 409.219394 + + + + + + + + 541.279846 + 867.420673 + + + + 541.279846 + 665.361701 + + + + 541.279846 + 780.388644 + + + + 541.279846 + 502.298373 + + + + + + + + 504.261456 + 692.336215 + + + + 504.261456 + 545.267801 + + + + 504.261456 + 805.420279 + + + + 504.261456 + 458.235772 + + + + 504.261456 + 463.255111 + + + + + + + + 744.35427 + 643.306592 + + + + 744.35427 + 839.389373 + + + + 744.35427 + 768.352259 + + + + 744.35427 + 938.457787 + + + + 744.35427 + 1285.605908 + + + + + + + + 483.77895 + 764.455267 + + + + 483.77895 + 665.386853 + + + + 483.77895 + 536.34426 + + + + 483.77895 + 865.502946 + + + + + + + + 567.811313 + 766.372994 + + + + 567.811313 + 695.335881 + + + + 567.811313 + 865.441408 + + + + 567.811313 + 964.509822 + + + + 567.811313 + 440.286745 + + + + + + + + + + + + + + + 758.386536 + 900.497149 + + + + 758.386536 + 616.275923 + + + + 758.386536 + 478.207843 + + + + 758.386536 + 591.291907 + + + + 758.386536 + 503.191859 + + + + + + + + 605.873913 + 998.588073 + + + + 605.873913 + 499.797674 + + + + 605.873913 + 901.535309 + + + + 605.873913 + 701.419216 + + + + 605.873913 + 814.50328 + + + + + + + + 628.845884 + 579.311677 + + + + 628.845884 + 1060.563314 + + + + 628.845884 + 876.442137 + + + + 628.845884 + 663.330795 + + + + 628.845884 + 989.526201 + + + + + + + + 438.724706 + 690.341694 + + + + 438.724706 + 777.373723 + + + + 438.724706 + 460.251423 + + + + 438.724706 + 589.294016 + + + + + + + + 584.33529 + 485.266876 + + + + 584.33529 + 969.526475 + + + + 584.33529 + 458.308544 + + + + 584.33529 + 872.473711 + + + + 584.33529 + 652.388919 + + + + + + + + 544.787444 + 658.367121 + + + + 544.787444 + 472.287808 + + + + 544.787444 + 902.488299 + + + + 544.787444 + 805.435535 + + + + 544.787444 + 431.207767 + + + + + + + + 447.739628 + 660.371538 + + + + 447.739628 + 731.408652 + + + + 447.739628 + 474.292225 + + + + 447.739628 + 421.187031 + + + + 447.739628 + 520.255445 + + + + + + + + 418.188291 + 557.279034 + + + + 418.188291 + 672.305977 + + + + 418.188291 + 470.247006 + + + + + + + + 723.874445 + 1136.609871 + + + + 723.874445 + 568.808573 + + + + 723.874445 + 938.509428 + + + + 723.874445 + 739.413737 + + + + 723.874445 + 810.45085099999994 + + + + + + + + 547.279846 + 817.405023 + + + + 547.279846 + 718.336609 + + + + 547.279846 + 605.252545 + + + + 547.279846 + 490.225602 + + + + 547.279846 + 930.489087 + + + + + + + + 649.636614 + 637.249768 + + + + 649.636614 + 823.329081 + + + + 649.636614 + 1038.419687 + + + + 649.636614 + 810.414465 + + + + 649.636614 + 522.222825 + + + + + + + + + + + + + + 660.798077 + 541.243895 + + + + 660.798077 + 928.419293 + + + + 660.798077 + 1056.47787 + + + + 660.798077 + 841.387264 + + + + + + \ No newline at end of file diff --git a/pwiz_tools/Skyline/Model/Koina/KoinaConstants.cs b/pwiz_tools/Skyline/Model/Koina/KoinaConstants.cs index 8d6e0f0b75..ea05280c01 100644 --- a/pwiz_tools/Skyline/Model/Koina/KoinaConstants.cs +++ b/pwiz_tools/Skyline/Model/Koina/KoinaConstants.cs @@ -31,7 +31,7 @@ public static class KoinaConstants public static readonly int BATCH_SIZE = 1000; public static readonly int MIN_NCE = 18; public static readonly int MAX_NCE = 39; - public static readonly int MAX_THREADS = 4; + public static int MAX_THREADS = 4; public static bool CACHE_PREV_PREDICTION = true; diff --git a/pwiz_tools/Skyline/Model/Koina/Models/KoinaIntensityModel.cs b/pwiz_tools/Skyline/Model/Koina/Models/KoinaIntensityModel.cs index ad2ff6ad2f..a2950b5754 100644 --- a/pwiz_tools/Skyline/Model/Koina/Models/KoinaIntensityModel.cs +++ b/pwiz_tools/Skyline/Model/Koina/Models/KoinaIntensityModel.cs @@ -199,6 +199,8 @@ public PeptidePrecursorNCE(PeptideDocNode nodePep, TransitionGroupDocNode nodeGr public PeptidePrecursorNCE WithNCE(int nce) { + if (NodePep != null) + return new PeptidePrecursorNCE(NodePep, NodeGroup, LabelType, nce); return new PeptidePrecursorNCE(Sequence, PrecursorCharge, PrecursorMz, ExplicitMods, LabelType, nce); } diff --git a/pwiz_tools/Skyline/Model/Koina/Models/KoinaModel.cs b/pwiz_tools/Skyline/Model/Koina/Models/KoinaModel.cs index e5c282ebbc..397ff5fe92 100644 --- a/pwiz_tools/Skyline/Model/Koina/Models/KoinaModel.cs +++ b/pwiz_tools/Skyline/Model/Koina/Models/KoinaModel.cs @@ -866,7 +866,7 @@ public static string EncodeSequence(string sequence, out KoinaException exceptio /// A list of string representations of the sequence public static string[] DecodeSequences(InferInputTensor tensor) { - return DecodeSequences2(tensor).Select(s => s.FullNames).ToArray(); + return DecodeSequences2(tensor).Select(s => s.MonoisotopicMasses).ToArray(); /*var n = tensor.TensorShape.Dim[0].Size; var result = new string[n]; @@ -925,22 +925,7 @@ public static int[] DecodeCharges(InferInputTensor tensor) var result = new int[tensor.Shape[0]]; for (int i = 0; i < tensor.Shape[0]; ++i) { - result[i] = -1; - for (int j = 0; j < tensor.Shape[1]; ++j) - { - if (tensor.Contents.Fp32Contents[i * KoinaConstants.PRECURSOR_CHARGES + j] == 1.0f) - { - result[i] = j + 1; - break; - } - } - - if (result[i] == -1) - { - var charges = tensor.Contents.Fp32Contents.Skip(i * KoinaConstants.PRECURSOR_CHARGES).Take(KoinaConstants.PRECURSOR_CHARGES); - throw new KoinaException(string.Format(@"[{0}] is not a valid one-hot encoded charge", string.Join( - @", ", charges))); - } + result[i] = tensor.Contents.IntContents[i]; } return result; diff --git a/pwiz_tools/Skyline/Model/Lib/BiblioSpecLite.cs b/pwiz_tools/Skyline/Model/Lib/BiblioSpecLite.cs index 28c3b5bfeb..cf8be83cc9 100644 --- a/pwiz_tools/Skyline/Model/Lib/BiblioSpecLite.cs +++ b/pwiz_tools/Skyline/Model/Lib/BiblioSpecLite.cs @@ -367,7 +367,7 @@ LEFT JOIN (SELECT rsInner.fileId, rsInner.scoreType AS scoreType, COUNT(DISTINCT ? Convert.ToDouble(reader.GetValue(icolCutoffScore)) : (double?)null; - if (!string.IsNullOrEmpty(scoreName)) + if (!string.IsNullOrEmpty(scoreName) && ScoreType.INVARIANT_NAMES.Contains(scoreName)) { var scoreType = new ScoreType(scoreName, probabilityType); sourceFileDetails.ScoreThresholds[scoreType] = cutoffScore; diff --git a/pwiz_tools/Skyline/Model/Serialization/DocumentWriter.cs b/pwiz_tools/Skyline/Model/Serialization/DocumentWriter.cs index e26de53987..340ee5a55b 100644 --- a/pwiz_tools/Skyline/Model/Serialization/DocumentWriter.cs +++ b/pwiz_tools/Skyline/Model/Serialization/DocumentWriter.cs @@ -731,7 +731,8 @@ private void WriteTransitionXml(XmlWriter writer, PeptideDocNode nodePep, Transi if (!transition.IsCustom()) { writer.WriteAttribute(ATTR.cleavage_aa, transition.AA.ToString(CultureInfo.InvariantCulture)); - writer.WriteAttribute(ATTR.loss_neutral_mass, nodeTransition.LostMass); //po + if (nodeTransition.HasLoss) + writer.WriteAttribute(ATTR.loss_neutral_mass, nodeTransition.LostMass); //po } } diff --git a/pwiz_tools/Skyline/Model/TransitionGroupDocNode.cs b/pwiz_tools/Skyline/Model/TransitionGroupDocNode.cs index 24ec1a22e3..10dd38f570 100644 --- a/pwiz_tools/Skyline/Model/TransitionGroupDocNode.cs +++ b/pwiz_tools/Skyline/Model/TransitionGroupDocNode.cs @@ -27,6 +27,7 @@ using pwiz.Skyline.Controls.SeqNode; using pwiz.Skyline.Model.Crosslinking; using pwiz.Skyline.Model.DocSettings; +using pwiz.Skyline.Model.Irt; using pwiz.Skyline.Model.Lib; using pwiz.Skyline.Model.Results; using pwiz.Skyline.Model.Results.Scoring; @@ -226,7 +227,7 @@ public IList GetPrecursorChoices(SrmSettings settings, ExplicitMods mod { SpectrumHeaderInfo libInfo = null; var transitionRanks = new Dictionary(); - GetLibraryInfo(settings, mods, useFilter, ref libInfo, transitionRanks); + GetLibraryInfo(settings, mods, false, useFilter, ref libInfo, transitionRanks); var listChoices = new List(); foreach (TransitionDocNode nodeTran in GetTransitions(settings, mods, @@ -955,6 +956,9 @@ public TransitionGroupDocNode ChangeSettings(SrmSettings settingsNew, PeptideDoc bool autoSelectTransitions = diff.DiffTransitions && settingsNew.TransitionSettings.Filter.AutoSelect && AutoManageChildren; + var preserveLibInfo = + settingsNew.PeptideSettings.Prediction.RetentionTime?.Calculator is RCalcIrt irt && + (!irt.IsUsable || irt.IsStandard(nodePep.ModifiedTarget)); if (!IsDecoy && (diff.DiffTransitionGroupProps || diff.DiffTransitions || diff.DiffTransitionProps)) { @@ -966,7 +970,7 @@ public TransitionGroupDocNode ChangeSettings(SrmSettings settingsNew, PeptideDoc // Otherwise, this can cause a lot of unnecessary work loading MS1 filtering documents. // If transitions are not changing, then it is necessary to get all rankings, // since any group may contain reranked transitions - GetLibraryInfo(settingsNew, mods, autoSelectTransitions, ref libInfo, transitionRanksLib); + GetLibraryInfo(settingsNew, mods, preserveLibInfo, autoSelectTransitions, ref libInfo, transitionRanksLib); } CrosslinkBuilder crosslinkBuilder = null; @@ -1102,6 +1106,8 @@ public TransitionGroupDocNode ChangeSettings(SrmSettings settingsNew, PeptideDoc var massH = settingsNew.RecalculateTransitionMass(mods, nodeTransition, isotopeDist); var quantInfo = TransitionDocNode.TransitionQuantInfo.GetTransitionQuantInfo(nodeTransition.ComplexFragmentIon, isotopeDist, Transition.CalcMass(massH, losses), transitionRanks).UseValuesFrom(nodeTransition.QuantInfo); + if (quantInfo.LibInfo == null && nodeTransition.LibInfo != null && preserveLibInfo) + quantInfo = quantInfo.ChangeLibInfo(nodeTransition.LibInfo); if (!ReferenceEquals(quantInfo.LibInfo, nodeTransition.LibInfo)) dotProductChange = true; @@ -3179,15 +3185,16 @@ public override string ToString() #endregion - public void GetLibraryInfo(SrmSettings settings, ExplicitMods mods, bool useFilter, - ref SpectrumHeaderInfo libInfo, - Dictionary transitionRanks) + public void GetLibraryInfo(SrmSettings settings, ExplicitMods mods, bool preserveLibInfo, bool useFilter, + ref SpectrumHeaderInfo libInfo, Dictionary transitionRanks) { - PeptideLibraries libraries = settings.PeptideSettings.Libraries; + var libraries = settings.PeptideSettings.Libraries; + var noLibInfo = preserveLibInfo ? libInfo : null; + // No libraries means no library info if (!libraries.HasLibraries) { - libInfo = null; + libInfo = noLibInfo; return; } // If not loaded, leave everything alone, and let the update @@ -3195,10 +3202,13 @@ public void GetLibraryInfo(SrmSettings settings, ExplicitMods mods, bool useFilt if (!libraries.IsLoaded) return; - IsotopeLabelType labelType; - if (!settings.TryGetLibInfo(TransitionGroup.Peptide, TransitionGroup.PrecursorAdduct, mods, out labelType, out libInfo)) - libInfo = null; - else if (transitionRanks != null) + if (!settings.TryGetLibInfo(TransitionGroup.Peptide, TransitionGroup.PrecursorAdduct, mods, out var labelType, out libInfo)) + { + libInfo = noLibInfo; + return; + } + + if (transitionRanks != null) { try { diff --git a/pwiz_tools/Skyline/Resources/StartPage/AbsoluteQuant_start-ja.png b/pwiz_tools/Skyline/Resources/StartPage/AbsoluteQuant_start-ja.png index 470b23ddcb..1b8df82815 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/AbsoluteQuant_start-ja.png and b/pwiz_tools/Skyline/Resources/StartPage/AbsoluteQuant_start-ja.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/AbsoluteQuant_start-zh-CHS.png b/pwiz_tools/Skyline/Resources/StartPage/AbsoluteQuant_start-zh-CHS.png index a9c003cbdd..164c130743 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/AbsoluteQuant_start-zh-CHS.png and b/pwiz_tools/Skyline/Resources/StartPage/AbsoluteQuant_start-zh-CHS.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/AbsoluteQuant_start.png b/pwiz_tools/Skyline/Resources/StartPage/AbsoluteQuant_start.png index 2198dff1ca..474dfb5d9c 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/AbsoluteQuant_start.png and b/pwiz_tools/Skyline/Resources/StartPage/AbsoluteQuant_start.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/AuditLog_start.png b/pwiz_tools/Skyline/Resources/StartPage/AuditLog_start.png index f72b46b0aa..94f9805df6 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/AuditLog_start.png and b/pwiz_tools/Skyline/Resources/StartPage/AuditLog_start.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/CustomReports_start-ja.png b/pwiz_tools/Skyline/Resources/StartPage/CustomReports_start-ja.png index 7c609801ef..f9c5f9ded1 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/CustomReports_start-ja.png and b/pwiz_tools/Skyline/Resources/StartPage/CustomReports_start-ja.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/CustomReports_start-zh-CHS.png b/pwiz_tools/Skyline/Resources/StartPage/CustomReports_start-zh-CHS.png index b4f713e888..96fa6c538b 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/CustomReports_start-zh-CHS.png and b/pwiz_tools/Skyline/Resources/StartPage/CustomReports_start-zh-CHS.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/CustomReports_start.png b/pwiz_tools/Skyline/Resources/StartPage/CustomReports_start.png index 4c495dba08..b6d7b0a66d 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/CustomReports_start.png and b/pwiz_tools/Skyline/Resources/StartPage/CustomReports_start.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/DDASearch_start-ja.png b/pwiz_tools/Skyline/Resources/StartPage/DDASearch_start-ja.png index 25c902d800..538d754f12 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/DDASearch_start-ja.png and b/pwiz_tools/Skyline/Resources/StartPage/DDASearch_start-ja.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/DDASearch_start-zh-CHS.png b/pwiz_tools/Skyline/Resources/StartPage/DDASearch_start-zh-CHS.png index 546f409858..7db42f34cd 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/DDASearch_start-zh-CHS.png and b/pwiz_tools/Skyline/Resources/StartPage/DDASearch_start-zh-CHS.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/DDASearch_start.png b/pwiz_tools/Skyline/Resources/StartPage/DDASearch_start.png index 3dca3cd7ee..f0e16be5c7 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/DDASearch_start.png and b/pwiz_tools/Skyline/Resources/StartPage/DDASearch_start.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/DIA-PASEF_start.png b/pwiz_tools/Skyline/Resources/StartPage/DIA-PASEF_start.png index d1d283e1d9..d4a6cf79d1 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/DIA-PASEF_start.png and b/pwiz_tools/Skyline/Resources/StartPage/DIA-PASEF_start.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/DIA-QE_start-ja.png b/pwiz_tools/Skyline/Resources/StartPage/DIA-QE_start-ja.png new file mode 100644 index 0000000000..f622409492 Binary files /dev/null and b/pwiz_tools/Skyline/Resources/StartPage/DIA-QE_start-ja.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/DIA-QE_start-zh-CHS.png b/pwiz_tools/Skyline/Resources/StartPage/DIA-QE_start-zh-CHS.png new file mode 100644 index 0000000000..beb22aa1ea Binary files /dev/null and b/pwiz_tools/Skyline/Resources/StartPage/DIA-QE_start-zh-CHS.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/DIA-QE_start.png b/pwiz_tools/Skyline/Resources/StartPage/DIA-QE_start.png new file mode 100644 index 0000000000..39daec9b2f Binary files /dev/null and b/pwiz_tools/Skyline/Resources/StartPage/DIA-QE_start.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/DIA-TTOF_start-ja.png b/pwiz_tools/Skyline/Resources/StartPage/DIA-TTOF_start-ja.png new file mode 100644 index 0000000000..2d843cb4eb Binary files /dev/null and b/pwiz_tools/Skyline/Resources/StartPage/DIA-TTOF_start-ja.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/DIA-TTOF_start-zh-CHS.png b/pwiz_tools/Skyline/Resources/StartPage/DIA-TTOF_start-zh-CHS.png new file mode 100644 index 0000000000..19c1d54b3c Binary files /dev/null and b/pwiz_tools/Skyline/Resources/StartPage/DIA-TTOF_start-zh-CHS.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/DIA-TTOF_start.png b/pwiz_tools/Skyline/Resources/StartPage/DIA-TTOF_start.png new file mode 100644 index 0000000000..a7a6e0a4fd Binary files /dev/null and b/pwiz_tools/Skyline/Resources/StartPage/DIA-TTOF_start.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/DIA-Umpire-TTOF_start.png b/pwiz_tools/Skyline/Resources/StartPage/DIA-Umpire-TTOF_start.png new file mode 100644 index 0000000000..0d53d7c6df Binary files /dev/null and b/pwiz_tools/Skyline/Resources/StartPage/DIA-Umpire-TTOF_start.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/DIA_start-ja.png b/pwiz_tools/Skyline/Resources/StartPage/DIA_start-ja.png index f6353e6780..646fa39eaf 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/DIA_start-ja.png and b/pwiz_tools/Skyline/Resources/StartPage/DIA_start-ja.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/DIA_start-zh-CHS.png b/pwiz_tools/Skyline/Resources/StartPage/DIA_start-zh-CHS.png index 5f33965ed3..436fb59417 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/DIA_start-zh-CHS.png and b/pwiz_tools/Skyline/Resources/StartPage/DIA_start-zh-CHS.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/DIA_start.png b/pwiz_tools/Skyline/Resources/StartPage/DIA_start.png index 5f117fb7e4..2141f3292d 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/DIA_start.png and b/pwiz_tools/Skyline/Resources/StartPage/DIA_start.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/ExistingQuant_start-ja.png b/pwiz_tools/Skyline/Resources/StartPage/ExistingQuant_start-ja.png index 60dc32b93d..44931baf63 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/ExistingQuant_start-ja.png and b/pwiz_tools/Skyline/Resources/StartPage/ExistingQuant_start-ja.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/ExistingQuant_start-zh-CHS.png b/pwiz_tools/Skyline/Resources/StartPage/ExistingQuant_start-zh-CHS.png index c10dfa11df..7b137aa08b 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/ExistingQuant_start-zh-CHS.png and b/pwiz_tools/Skyline/Resources/StartPage/ExistingQuant_start-zh-CHS.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/ExistingQuant_start.png b/pwiz_tools/Skyline/Resources/StartPage/ExistingQuant_start.png index 41c31cb588..bc20436e56 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/ExistingQuant_start.png and b/pwiz_tools/Skyline/Resources/StartPage/ExistingQuant_start.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/GroupedStudies_start-ja.png b/pwiz_tools/Skyline/Resources/StartPage/GroupedStudies_start-ja.png index 080fc1df33..b9220417ad 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/GroupedStudies_start-ja.png and b/pwiz_tools/Skyline/Resources/StartPage/GroupedStudies_start-ja.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/GroupedStudies_start-zh-CHS.png b/pwiz_tools/Skyline/Resources/StartPage/GroupedStudies_start-zh-CHS.png index 8a798bf024..8336c779be 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/GroupedStudies_start-zh-CHS.png and b/pwiz_tools/Skyline/Resources/StartPage/GroupedStudies_start-zh-CHS.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/GroupedStudies_start.png b/pwiz_tools/Skyline/Resources/StartPage/GroupedStudies_start.png index e7fc7a9fab..4e14df2923 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/GroupedStudies_start.png and b/pwiz_tools/Skyline/Resources/StartPage/GroupedStudies_start.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/HiResMetabolomics_start.png b/pwiz_tools/Skyline/Resources/StartPage/HiResMetabolomics_start.png index e553bdbe59..fb61fe0dfc 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/HiResMetabolomics_start.png and b/pwiz_tools/Skyline/Resources/StartPage/HiResMetabolomics_start.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/IMSFiltering_start.png b/pwiz_tools/Skyline/Resources/StartPage/IMSFiltering_start.png index fd3cf48cb3..c511ab79d0 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/IMSFiltering_start.png and b/pwiz_tools/Skyline/Resources/StartPage/IMSFiltering_start.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/LibraryExplorer_start.png b/pwiz_tools/Skyline/Resources/StartPage/LibraryExplorer_start.png index c6294bbe08..b62ff7354e 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/LibraryExplorer_start.png and b/pwiz_tools/Skyline/Resources/StartPage/LibraryExplorer_start.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/MS1Filtering_start-ja.png b/pwiz_tools/Skyline/Resources/StartPage/MS1Filtering_start-ja.png index b3f6102e4c..4eb455e0f8 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/MS1Filtering_start-ja.png and b/pwiz_tools/Skyline/Resources/StartPage/MS1Filtering_start-ja.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/MS1Filtering_start-zh-CHS.png b/pwiz_tools/Skyline/Resources/StartPage/MS1Filtering_start-zh-CHS.png index ee78309f8e..8cab0d2073 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/MS1Filtering_start-zh-CHS.png and b/pwiz_tools/Skyline/Resources/StartPage/MS1Filtering_start-zh-CHS.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/MS1Filtering_start.png b/pwiz_tools/Skyline/Resources/StartPage/MS1Filtering_start.png index d8efb7701c..cfbc4658ad 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/MS1Filtering_start.png and b/pwiz_tools/Skyline/Resources/StartPage/MS1Filtering_start.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/MethodEdit_start-ja.png b/pwiz_tools/Skyline/Resources/StartPage/MethodEdit_start-ja.png index 859c312994..e24a79b208 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/MethodEdit_start-ja.png and b/pwiz_tools/Skyline/Resources/StartPage/MethodEdit_start-ja.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/MethodEdit_start-zh-CHS.png b/pwiz_tools/Skyline/Resources/StartPage/MethodEdit_start-zh-CHS.png index 74eb15ebed..b2b6a7874e 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/MethodEdit_start-zh-CHS.png and b/pwiz_tools/Skyline/Resources/StartPage/MethodEdit_start-zh-CHS.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/MethodEdit_start.png b/pwiz_tools/Skyline/Resources/StartPage/MethodEdit_start.png index 3393a067fa..8ef800b706 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/MethodEdit_start.png and b/pwiz_tools/Skyline/Resources/StartPage/MethodEdit_start.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/MethodRefine_start-ja.png b/pwiz_tools/Skyline/Resources/StartPage/MethodRefine_start-ja.png index f545b92b0c..a0003b98c0 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/MethodRefine_start-ja.png and b/pwiz_tools/Skyline/Resources/StartPage/MethodRefine_start-ja.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/MethodRefine_start-zh-CHS.png b/pwiz_tools/Skyline/Resources/StartPage/MethodRefine_start-zh-CHS.png index 5a376f422c..3d4283f4f0 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/MethodRefine_start-zh-CHS.png and b/pwiz_tools/Skyline/Resources/StartPage/MethodRefine_start-zh-CHS.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/MethodRefine_start.png b/pwiz_tools/Skyline/Resources/StartPage/MethodRefine_start.png index 39bd5d4045..22ea0d4485 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/MethodRefine_start.png and b/pwiz_tools/Skyline/Resources/StartPage/MethodRefine_start.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/OptimizeCE_start.png b/pwiz_tools/Skyline/Resources/StartPage/OptimizeCE_start.png index 034437d48f..9377615375 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/OptimizeCE_start.png and b/pwiz_tools/Skyline/Resources/StartPage/OptimizeCE_start.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/PRM_start-ja.png b/pwiz_tools/Skyline/Resources/StartPage/PRM_start-ja.png new file mode 100644 index 0000000000..d531111f21 Binary files /dev/null and b/pwiz_tools/Skyline/Resources/StartPage/PRM_start-ja.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/PRM_start-zh-CHS.png b/pwiz_tools/Skyline/Resources/StartPage/PRM_start-zh-CHS.png new file mode 100644 index 0000000000..6393ed85ab Binary files /dev/null and b/pwiz_tools/Skyline/Resources/StartPage/PRM_start-zh-CHS.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/PRM_start.png b/pwiz_tools/Skyline/Resources/StartPage/PRM_start.png new file mode 100644 index 0000000000..94eca7e7c2 Binary files /dev/null and b/pwiz_tools/Skyline/Resources/StartPage/PRM_start.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/PeakPicking_start.png b/pwiz_tools/Skyline/Resources/StartPage/PeakPicking_start.png index 91302aa43f..4b99aaa692 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/PeakPicking_start.png and b/pwiz_tools/Skyline/Resources/StartPage/PeakPicking_start.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/SmallMolLibraries_start-ja.png b/pwiz_tools/Skyline/Resources/StartPage/SmallMolLibraries_start-ja.png deleted file mode 100644 index 1479c64edc..0000000000 Binary files a/pwiz_tools/Skyline/Resources/StartPage/SmallMolLibraries_start-ja.png and /dev/null differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/SmallMolLibraries_start-zh-CHS.png b/pwiz_tools/Skyline/Resources/StartPage/SmallMolLibraries_start-zh-CHS.png deleted file mode 100644 index 8a3a2d1370..0000000000 Binary files a/pwiz_tools/Skyline/Resources/StartPage/SmallMolLibraries_start-zh-CHS.png and /dev/null differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/SmallMolLibraries_start.png b/pwiz_tools/Skyline/Resources/StartPage/SmallMolLibraries_start.png deleted file mode 100644 index f62ca70e5b..0000000000 Binary files a/pwiz_tools/Skyline/Resources/StartPage/SmallMolLibraries_start.png and /dev/null differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/SmallMoleculeIMSLibraries_start.png b/pwiz_tools/Skyline/Resources/StartPage/SmallMoleculeIMSLibraries_start.png new file mode 100644 index 0000000000..2fbb157b00 Binary files /dev/null and b/pwiz_tools/Skyline/Resources/StartPage/SmallMoleculeIMSLibraries_start.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/SmallMoleculeMethodDevCEOpt_start-ja.png b/pwiz_tools/Skyline/Resources/StartPage/SmallMoleculeMethodDevCEOpt_start-ja.png index 6f136033ff..e40ccec3c0 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/SmallMoleculeMethodDevCEOpt_start-ja.png and b/pwiz_tools/Skyline/Resources/StartPage/SmallMoleculeMethodDevCEOpt_start-ja.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/SmallMoleculeMethodDevCEOpt_start-zh-CHS.png b/pwiz_tools/Skyline/Resources/StartPage/SmallMoleculeMethodDevCEOpt_start-zh-CHS.png index 261538082e..6139cda7c8 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/SmallMoleculeMethodDevCEOpt_start-zh-CHS.png and b/pwiz_tools/Skyline/Resources/StartPage/SmallMoleculeMethodDevCEOpt_start-zh-CHS.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/SmallMoleculeMethodDevCEOpt_start.png b/pwiz_tools/Skyline/Resources/StartPage/SmallMoleculeMethodDevCEOpt_start.png index bf90ef2961..3dc5883bf2 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/SmallMoleculeMethodDevCEOpt_start.png and b/pwiz_tools/Skyline/Resources/StartPage/SmallMoleculeMethodDevCEOpt_start.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/SmallMoleculeQuantification_start-ja.png b/pwiz_tools/Skyline/Resources/StartPage/SmallMoleculeQuantification_start-ja.png index 271ba536e3..fe50b48eed 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/SmallMoleculeQuantification_start-ja.png and b/pwiz_tools/Skyline/Resources/StartPage/SmallMoleculeQuantification_start-ja.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/SmallMoleculeQuantification_start-zh-CHS.png b/pwiz_tools/Skyline/Resources/StartPage/SmallMoleculeQuantification_start-zh-CHS.png index c10c912511..774cb340cc 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/SmallMoleculeQuantification_start-zh-CHS.png and b/pwiz_tools/Skyline/Resources/StartPage/SmallMoleculeQuantification_start-zh-CHS.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/SmallMoleculeQuantification_start.png b/pwiz_tools/Skyline/Resources/StartPage/SmallMoleculeQuantification_start.png index f308f94c28..88b1e97829 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/SmallMoleculeQuantification_start.png and b/pwiz_tools/Skyline/Resources/StartPage/SmallMoleculeQuantification_start.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/SmallMolecule_start-ja.png b/pwiz_tools/Skyline/Resources/StartPage/SmallMolecule_start-ja.png index a4c198c026..2ed0ada9b3 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/SmallMolecule_start-ja.png and b/pwiz_tools/Skyline/Resources/StartPage/SmallMolecule_start-ja.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/SmallMolecule_start-zh-CHS.png b/pwiz_tools/Skyline/Resources/StartPage/SmallMolecule_start-zh-CHS.png index 883e95ec71..92ecaf7847 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/SmallMolecule_start-zh-CHS.png and b/pwiz_tools/Skyline/Resources/StartPage/SmallMolecule_start-zh-CHS.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/SmallMolecule_start.png b/pwiz_tools/Skyline/Resources/StartPage/SmallMolecule_start.png index d84219e0d8..7562b37781 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/SmallMolecule_start.png and b/pwiz_tools/Skyline/Resources/StartPage/SmallMolecule_start.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/TargetedMSMS_start-ja.png b/pwiz_tools/Skyline/Resources/StartPage/TargetedMSMS_start-ja.png deleted file mode 100644 index 62c0c8ff6a..0000000000 Binary files a/pwiz_tools/Skyline/Resources/StartPage/TargetedMSMS_start-ja.png and /dev/null differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/TargetedMSMS_start-zh-CHS.png b/pwiz_tools/Skyline/Resources/StartPage/TargetedMSMS_start-zh-CHS.png deleted file mode 100644 index 3a6195b657..0000000000 Binary files a/pwiz_tools/Skyline/Resources/StartPage/TargetedMSMS_start-zh-CHS.png and /dev/null differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/TargetedMSMS_start.png b/pwiz_tools/Skyline/Resources/StartPage/TargetedMSMS_start.png deleted file mode 100644 index 037259aba1..0000000000 Binary files a/pwiz_tools/Skyline/Resources/StartPage/TargetedMSMS_start.png and /dev/null differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/iRT_start-ja.png b/pwiz_tools/Skyline/Resources/StartPage/iRT_start-ja.png index 6f2184aa81..770e35bbc2 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/iRT_start-ja.png and b/pwiz_tools/Skyline/Resources/StartPage/iRT_start-ja.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/iRT_start-zh-CHS.png b/pwiz_tools/Skyline/Resources/StartPage/iRT_start-zh-CHS.png index f8acb4122e..3395fdc27b 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/iRT_start-zh-CHS.png and b/pwiz_tools/Skyline/Resources/StartPage/iRT_start-zh-CHS.png differ diff --git a/pwiz_tools/Skyline/Resources/StartPage/iRT_start.png b/pwiz_tools/Skyline/Resources/StartPage/iRT_start.png index f7b709f203..90b0523744 100644 Binary files a/pwiz_tools/Skyline/Resources/StartPage/iRT_start.png and b/pwiz_tools/Skyline/Resources/StartPage/iRT_start.png differ diff --git a/pwiz_tools/Skyline/SettingsUI/Irt/CalibrateIrtDlg.cs b/pwiz_tools/Skyline/SettingsUI/Irt/CalibrateIrtDlg.cs index 69c6e31409..5ae51d1ec0 100644 --- a/pwiz_tools/Skyline/SettingsUI/Irt/CalibrateIrtDlg.cs +++ b/pwiz_tools/Skyline/SettingsUI/Irt/CalibrateIrtDlg.cs @@ -22,6 +22,7 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; +using System.Text; using System.Windows.Forms; using pwiz.Common.Collections; using pwiz.Common.DataBinding; @@ -184,9 +185,16 @@ public void OkDialog() { pep.Irt = regression.GetY(pep.Irt); } - IrtStandard = new IrtStandard(name, null, null, !IsRecalibration + + var irtPeptides = !IsRecalibration ? StandardPeptideList.Select(pep => new DbIrtPeptide(pep.Target, pep.Irt, true, TimeSource.peak)) - : _standard.Peptides.Select(pep => new DbIrtPeptide(pep.Target, regression.GetY(pep.Irt), true, TimeSource.peak))); + : _standard.Peptides.Select(pep => _updatePeptides.Contains(pep) ? pep : // Avoid double updating + new DbIrtPeptide(pep.Target, regression.GetY(pep.Irt), true, TimeSource.peak)); + var irtPeptideList = irtPeptides.ToList(); + string docXml = IrtDb.GenerateDocumentXml(irtPeptideList.Select(p => p.Target), + Program.ActiveDocumentUI, null); + IrtStandard = new IrtStandard(name, null, docXml, irtPeptideList); + DialogResult = DialogResult.OK; } @@ -737,25 +745,28 @@ private List PickPeptides(SrmDocument doc, int count, ICollecti } RegressionLine cirtRegression = null; - var useCirt = false; + List> cirtPeps = null; var cirtUsePredefined = false; - if (_picker.TryGetCirtRegression(count, out var tryCirtRegression, out var matchedPeptides)) + var cirtResult = _picker.GetCirtRegressionResult(count); + if (cirtResult.Valid) { + cirtRegression = cirtResult.Regression; + cirtPeps = cirtResult.DbIrtPeptides.Zip(cirtResult.NodePeps, Tuple.Create).ToList(); + var currentIsCirt = currentRegression != null && currentRegression.IsCirtDiscovered; switch (MultiButtonMsgDlg.Show(_parent, string.Format( IrtResources.CalibrationGridViewDriver_FindEvenlySpacedPeptides_This_document_contains__0__CiRT_peptides__Would_you_like_to_use__1__of_them_as_your_iRT_standards_, - _picker.CirtPeptideCount, count), MultiButtonMsgDlg.BUTTON_YES, MultiButtonMsgDlg.BUTTON_NO, true)) + _picker.CirtPeptideCount, count), MultiButtonMsgDlg.BUTTON_YES, MultiButtonMsgDlg.BUTTON_NO, true)) { case DialogResult.Yes: - cirtRegression = tryCirtRegression; - useCirt = true; + cirtRegression = cirtResult.Regression; if ((currentRegression != null && currentRegression.FixedPoint) || currentIsCirt) { switch (MultiButtonMsgDlg.Show(_parent, IrtResources.CalibrationGridViewDriver_FindEvenlySpacedPeptides_Would_you_like_to_use_the_predefined_iRT_values_, IrtResources.CalibrationGridViewDriver_FindEvenlySpacedPeptides_Predefined_values, IrtResources.CalibrationGridViewDriver_FindEvenlySpacedPeptides_Calculate_from_regression, - true)) + true)) { case DialogResult.Yes: cirtUsePredefined = true; @@ -768,15 +779,41 @@ private List PickPeptides(SrmDocument doc, int count, ICollecti } break; case DialogResult.No: - if (currentIsCirt) - cirtRegression = tryCirtRegression; + if (!currentIsCirt) + cirtRegression = null; + cirtResult = null; break; case DialogResult.Cancel: return null; } } + else if (_picker.CirtPeptideCount >= count) + { + var msg = new StringBuilder(); + + if (cirtResult.Regression == null) + { + msg.AppendLine(string.Format( + IrtResources.CalibrationGridViewDriver_PickPeptides__0__CiRT_peptides_were_found__but_a_valid_regression_could_not_be_calculated_, + _picker.CirtPeptideCount)); + } + else + { + msg.AppendLine(string.Format( + IrtResources.CalibrationGridViewDriver_PickPeptides__0__CiRT_peptides_were_found_and_a_regression_was_calculated_using__1__of_them__but_they_did_not_sufficiently_span_the_retention_time_range__2_0____to__3_0____minutes_, + _picker.CirtPeptideCount, cirtResult.Count, cirtResult.MinRt, cirtResult.MaxRt + )); + msg.AppendLine(); + foreach (var pep in cirtResult.Peptides.OrderBy(pep => pep.Time)) + { + msg.AppendLine(string.Format(@"{0} ({1})", pep.NodePep.ModifiedTarget, pep.Time.ToString(Formats.RETENTION_TIME))); + } + } + + MessageDlg.Show(_parent, msg.ToString()); + } - var bestPeptides = _picker.Pick(count, exclude, useCirt); + var bestPeptides = _picker.Pick(count, exclude, cirtResult); if (cirtRegression != null) { var standardPeptides = bestPeptides.Select(pep => new StandardPeptide @@ -785,8 +822,8 @@ private List PickPeptides(SrmDocument doc, int count, ICollecti RetentionTime = pep.RetentionTime, Target = pep.Target }).ToList(); - cirt = new RegressionOption(Resources.CalibrationGridViewDriver_CiRT_option_name, cirtRegression, false, - matchedPeptides.ToList(), standardPeptides); + cirt = new RegressionOption(Resources.CalibrationGridViewDriver_CiRT_option_name, cirtRegression, + false, cirtPeps, standardPeptides); } return bestPeptides; } diff --git a/pwiz_tools/Skyline/SettingsUI/Irt/ChangeIrtPeptidesDlg.cs b/pwiz_tools/Skyline/SettingsUI/Irt/ChangeIrtPeptidesDlg.cs index d04b3d3ee1..b0c6c99478 100644 --- a/pwiz_tools/Skyline/SettingsUI/Irt/ChangeIrtPeptidesDlg.cs +++ b/pwiz_tools/Skyline/SettingsUI/Irt/ChangeIrtPeptidesDlg.cs @@ -306,17 +306,17 @@ public void UseResults() } } - var useCirt = false; - if (_picker.TryGetCirtRegression(count, out _, out _)) + var cirtResult = _picker.GetCirtRegressionResult(count); + if (cirtResult.Valid) { switch (MultiButtonMsgDlg.Show(this, string.Format( IrtResources.CalibrationGridViewDriver_FindEvenlySpacedPeptides_This_document_contains__0__CiRT_peptides__Would_you_like_to_use__1__of_them_as_your_iRT_standards_, - _picker.CirtPeptideCount, count), MultiButtonMsgDlg.BUTTON_YES, MultiButtonMsgDlg.BUTTON_NO, true)) + _picker.CirtPeptideCount, count), MultiButtonMsgDlg.BUTTON_YES, MultiButtonMsgDlg.BUTTON_NO, true)) { case DialogResult.Yes: - useCirt = true; break; case DialogResult.No: + cirtResult = null; break; case DialogResult.Cancel: return; @@ -324,7 +324,7 @@ public void UseResults() } comboProteins.SelectedIndex = 0; - PeptideLines = _picker.Pick(count, null, useCirt).Select(pep => pep.Target.ToString()).ToArray(); + PeptideLines = _picker.Pick(count, null, cirtResult).Select(pep => pep.Target.ToString()).ToArray(); } } } \ No newline at end of file diff --git a/pwiz_tools/Skyline/SettingsUI/Irt/EditIrtCalcDlg.cs b/pwiz_tools/Skyline/SettingsUI/Irt/EditIrtCalcDlg.cs index 50aaca63d8..03d37fbc96 100644 --- a/pwiz_tools/Skyline/SettingsUI/Irt/EditIrtCalcDlg.cs +++ b/pwiz_tools/Skyline/SettingsUI/Irt/EditIrtCalcDlg.cs @@ -226,7 +226,7 @@ public void ClearLibraryPeptides() private void btnCreateDb_Click(object sender, EventArgs e) { - if (DatabaseChanged) + if (!string.IsNullOrEmpty(CalcPath) && DatabaseChanged) { var result = MultiButtonMsgDlg.Show(this, IrtResources.EditIrtCalcDlg_btnCreateDb_Click_Are_you_sure_you_want_to_create_a_new_database_file_Any_changes_to_the_current_calculator_will_be_lost, MessageBoxButtons.YesNo); diff --git a/pwiz_tools/Skyline/SettingsUI/Irt/IrtResources.designer.cs b/pwiz_tools/Skyline/SettingsUI/Irt/IrtResources.designer.cs index d020039f5f..e8d85d4f24 100644 --- a/pwiz_tools/Skyline/SettingsUI/Irt/IrtResources.designer.cs +++ b/pwiz_tools/Skyline/SettingsUI/Irt/IrtResources.designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 @@ -19,7 +19,7 @@ namespace pwiz.Skyline.SettingsUI.Irt { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] public class IrtResources { @@ -471,6 +471,27 @@ public static string CalibrationGridViewDriver_FindEvenlySpacedPeptides_Would_yo } } + /// + /// Looks up a localized string similar to {0} CiRT peptides were found, but a valid regression could not be calculated.. + /// + public static string CalibrationGridViewDriver_PickPeptides__0__CiRT_peptides_were_found__but_a_valid_regression_could_not_be_calculated_ { + get { + return ResourceManager.GetString("CalibrationGridViewDriver_PickPeptides__0__CiRT_peptides_were_found__but_a_valid_" + + "regression_could_not_be_calculated_", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} CiRT peptides were found and a regression was calculated using {1} of them, but they did not sufficiently span the retention time range {2:0.#} to {3:0.#} minutes:. + /// + public static string CalibrationGridViewDriver_PickPeptides__0__CiRT_peptides_were_found_and_a_regression_was_calculated_using__1__of_them__but_they_did_not_sufficiently_span_the_retention_time_range__2_0____to__3_0____minutes_ { + get { + return ResourceManager.GetString("CalibrationGridViewDriver_PickPeptides__0__CiRT_peptides_were_found_and_a_regress" + + "ion_was_calculated_using__1__of_them__but_they_did_not_sufficiently_span_the_ret" + + "ention_time_range__2_0____to__3_0____minutes_", resourceCulture); + } + } + /// /// Looks up a localized string similar to Standard peptides must exist in the database.. /// diff --git a/pwiz_tools/Skyline/SettingsUI/Irt/IrtResources.resx b/pwiz_tools/Skyline/SettingsUI/Irt/IrtResources.resx index 00c57736f1..fc140aa41f 100644 --- a/pwiz_tools/Skyline/SettingsUI/Irt/IrtResources.resx +++ b/pwiz_tools/Skyline/SettingsUI/Irt/IrtResources.resx @@ -385,4 +385,10 @@ The peptide {0} is already present in the {1} table, and may not be pasted into the {2} table. + + {0} CiRT peptides were found, but a valid regression could not be calculated. + + + {0} CiRT peptides were found and a regression was calculated using {1} of them, but they did not sufficiently span the retention time range {2:0.#} to {3:0.#} minutes: + \ No newline at end of file diff --git a/pwiz_tools/Skyline/Skyline.cs b/pwiz_tools/Skyline/Skyline.cs index 66cf6238bb..938c6bb620 100644 --- a/pwiz_tools/Skyline/Skyline.cs +++ b/pwiz_tools/Skyline/Skyline.cs @@ -2334,7 +2334,7 @@ public void HandleStandardsChanged(ICollection oldStandard, RCalcIrt cal var tranGroupList = new List(); foreach (TransitionGroupDocNode nodeTranGroup in nodePep.Children) { - var transitions = nodeTranGroup.Transitions.Take(numTransitions).ToArray(); + var transitions = nodeTranGroup.Transitions.OrderBy(nodeTran => nodeTran.LibInfo?.Rank).Take(numTransitions).ToArray(); Array.Sort(transitions, TransitionGroup.CompareTransitions); tranGroupList.Add(nodeTranGroup.ChangeChildren(transitions.Cast().ToList())); } diff --git a/pwiz_tools/Skyline/Skyline.csproj b/pwiz_tools/Skyline/Skyline.csproj index 95f861dbfb..1f7a3eb8e3 100644 --- a/pwiz_tools/Skyline/Skyline.csproj +++ b/pwiz_tools/Skyline/Skyline.csproj @@ -2973,13 +2973,16 @@ TutorialImageResources.resx + Designer ResXFileCodeGenerator TutorialImageResources.Designer.cs + Designer TutorialImageResources.resx + Designer TutorialLinkResources.resx @@ -3861,7 +3864,7 @@ QTFLDebugLog.dll PreserveNewest - + MBI_SDK.dll PreserveNewest @@ -4082,6 +4085,7 @@ PreserveNewest + PreserveNewest @@ -4191,9 +4195,6 @@ - - - PreserveNewest @@ -4222,6 +4223,19 @@ + + + + + + + + + + + + + PreserveNewest diff --git a/pwiz_tools/Skyline/SkylineTester/SkylineTesterWindow.cs b/pwiz_tools/Skyline/SkylineTester/SkylineTesterWindow.cs index 0651746253..7f50e23e29 100644 --- a/pwiz_tools/Skyline/SkylineTester/SkylineTesterWindow.cs +++ b/pwiz_tools/Skyline/SkylineTester/SkylineTesterWindow.cs @@ -1971,6 +1971,7 @@ private void runMode_SelectedIndexChanged(object sender, EventArgs e) // Adjust settings to match the mode var runModeTest = RunTestMode.SelectedItem.ToString(); bool offScreenEnabled = true; + bool translationLanguagesOnly = false; if (!Equals(runModeTest, "Test")) { runSerial.Checked = true; @@ -1985,8 +1986,13 @@ private void runMode_SelectedIndexChanged(object sender, EventArgs e) runLoopsCount.Text = 1.ToString(); Offscreen.Checked = false; // Can't do screenshots offscreen offScreenEnabled = false; + translationLanguagesOnly = true; } } + + TestsFrench.Enabled = TestsTurkish.Enabled = !translationLanguagesOnly; + if (translationLanguagesOnly) + TestsFrench.Checked = TestsTurkish.Checked = false; Offscreen.Enabled = offScreenEnabled; } diff --git a/pwiz_tools/Skyline/SkylineTester/WindowThumbnail.cs b/pwiz_tools/Skyline/SkylineTester/WindowThumbnail.cs index 09067b09dc..925da4cc9e 100644 --- a/pwiz_tools/Skyline/SkylineTester/WindowThumbnail.cs +++ b/pwiz_tools/Skyline/SkylineTester/WindowThumbnail.cs @@ -56,7 +56,7 @@ private void UnregisterThumb() { if (_thumb != IntPtr.Zero) { - DwmapiTest.UnregisterThumbnail(_thumb); + DwmapiTest.DwmUnregisterThumbnail(_thumb); _thumb = IntPtr.Zero; } } @@ -71,7 +71,7 @@ private void RegisterThumb() } IntPtr newThumb; - DwmapiTest.RegisterThumbnail(MainWindow.Handle, window, out newThumb); + DwmapiTest.DwmRegisterThumbnail(MainWindow.Handle, window, out newThumb); if (newThumb == IntPtr.Zero) { UnregisterThumb(); @@ -86,7 +86,7 @@ private void RegisterThumb() Point locationOnForm = MainWindow.PointToClient(Parent.PointToScreen(Location)); PInvokeCommon.SIZE size; - DwmapiTest.QueryThumbnailSourceSize(_thumb, out size); + DwmapiTest.DwmQueryThumbnailSourceSize(_thumb, out size); var props = new DwmapiTest.THUMBNAIL_PROPERTIES { @@ -105,7 +105,7 @@ private void RegisterThumb() if (size.cy < Height) props.rcDestination.bottom = props.rcDestination.top + size.cy; - DwmapiTest.UpdateThumbnailProperties(_thumb, ref props); + DwmapiTest.DwmUpdateThumbnailProperties(_thumb, ref props); } private IntPtr FindWindow(int processId) diff --git a/pwiz_tools/Skyline/Test/CodeInspectionTest.cs b/pwiz_tools/Skyline/Test/CodeInspectionTest.cs index 59992d1f42..7e6e16e7ae 100644 --- a/pwiz_tools/Skyline/Test/CodeInspectionTest.cs +++ b/pwiz_tools/Skyline/Test/CodeInspectionTest.cs @@ -548,7 +548,7 @@ private static void InspectPInvokeApi(string root, List errors) { // {type, expected # of methods with DllImport attribute} { typeof(Advapi32), 3 }, - { typeof(Gdi32), 3 }, + { typeof(Gdi32), 4 }, { typeof(Kernel32), 6 }, { typeof(Shell32), 1 }, { typeof(Shlwapi), 1 }, @@ -559,7 +559,7 @@ private static void InspectPInvokeApi(string root, List errors) { typeof(Kernel32Test), 5 }, { typeof(Ole32Test), 1 }, { typeof(Shell32Test), 1 }, - { typeof(User32Test), 8 } + { typeof(User32Test), 9 } }; // add types from production code diff --git a/pwiz_tools/Skyline/TestConnected/KoinaBuildLibraryTest.cs b/pwiz_tools/Skyline/TestConnected/KoinaBuildLibraryTest.cs index 57477ba7cf..032dd44122 100644 --- a/pwiz_tools/Skyline/TestConnected/KoinaBuildLibraryTest.cs +++ b/pwiz_tools/Skyline/TestConnected/KoinaBuildLibraryTest.cs @@ -20,6 +20,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using pwiz.Skyline.EditUI; using pwiz.Skyline.Model.Irt; +using pwiz.Skyline.Model.Koina; using pwiz.Skyline.Model.Koina.Models; using pwiz.Skyline.SettingsUI; using pwiz.Skyline.SettingsUI.Irt; @@ -32,20 +33,34 @@ namespace pwiz.SkylineTestConnected [TestClass] public class KoinaBuildLibraryTest : AbstractFunctionalTest { - //[TestMethod, NoParallelTesting(TestExclusionReason.DOCKER_ROOT_CERTS)] + private bool RecordData => false; + + [TestMethod, NoParallelTesting(TestExclusionReason.DOCKER_ROOT_CERTS)] public void TestKoinaBuildLibrary() { if (!HasKoinaServer()) { return; } + RunFunctionalTest(); } private string LibraryPathWithoutIrt => TestContext.GetTestPath("TestKoinaBuildLibrary\\LibraryWithoutIrt.blib"); private string LibraryPathWithIrt => TestContext.GetTestPath("TestKoinaBuildLibrary\\LibraryWithIrt.blib"); + private string ExpectedQueriesJsonFilepath => TestContext.GetProjectDirectory("TestConnected/KoinaBuildLibraryTest.data/koinaQueries.json"); protected override void DoTest() + { + KoinaConstants.CACHE_PREV_PREDICTION = false; + using (new FakeKoina(RecordData, ExpectedQueriesJsonFilepath)) + { + TestInner(); + } + KoinaConstants.CACHE_PREV_PREDICTION = true; + } + + void TestInner() { var toolsOptionsUi = ShowDialog(SkylineWindow.ShowToolOptionsUI); RunUI(()=> @@ -96,6 +111,9 @@ protected override void DoTest() OkDialog(addRetentionTimePredictorDlg, addRetentionTimePredictorDlg.NoDialog); OkDialog(peptideSettings, peptideSettings.OkDialog); + if (RecordData) + return; + var spectralLibraryViewer = ShowDialog(SkylineWindow.ViewSpectralLibraries); RunUI(() => { diff --git a/pwiz_tools/Skyline/TestConnected/KoinaBuildLibraryTest.data/koinaQueries.json b/pwiz_tools/Skyline/TestConnected/KoinaBuildLibraryTest.data/koinaQueries.json new file mode 100644 index 0000000000..a2e5ef958a --- /dev/null +++ b/pwiz_tools/Skyline/TestConnected/KoinaBuildLibraryTest.data/koinaQueries.json @@ -0,0 +1,251 @@ +[ + { + "$type": "pwiz.SkylineTestUtil.KoinaRetentionTimeQuery, TestUtil", + "_modifiedSequences": [ + "SSAAPPPPPR", + "GISNEGQNASIK", + "HVLTSIGEK", + "DIPVPKPK", + "IGDYAGIK", + "TASEFDSAIAQDK", + "SAAGAFGPELSR", + "ELGQSGVDTYLQTK", + "SFANQPLEVVYSK", + "GLILVGGYGTR", + "GILFVGSGVSGGEEGAR", + "LTILEELR", + "ELASGLSFPVGFK", + "LSSEAPALFQFDLK" + ], + "_iRTs": [ + -10.65266, + 0.7272606, + 11.3466187, + 22.96262, + 28.6249084, + 43.67517, + 51.8412628, + 61.44421, + 83.202446, + 84.8745346, + 87.24197, + 107.941422, + 123.178665, + 131.357788 + ] + }, + { + "$type": "pwiz.SkylineTestUtil.KoinaIntensityQuery, TestUtil", + "_inputs": [ + { + "ModifiedSequence": "ELVIS", + "NormalizedCollisionEnergy": 27.0, + "PrecursorCharge": 2 + }, + { + "ModifiedSequence": "LIVES", + "NormalizedCollisionEnergy": 27.0, + "PrecursorCharge": 2 + }, + { + "ModifiedSequence": "FISAM[+15.994915]LPC[+57.021464]NKFC[+57.021464]K", + "NormalizedCollisionEnergy": 27.0, + "PrecursorCharge": 2 + } + ], + "_ionTables": [ + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y"] + ,"IonNumber":[1,1,2,2,3,3,4,4,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.012645564,0.0,0.5427482,0.006074454,0.2402625,0.0,0.1905743,0.0113444068,0.00228195637,0.0,0.0448338166,0.0,0.477117449,0.0,1.0,0.0]} + }, + { + "_store":{"IonType":["b","b","b","b","b","b","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,4,4,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[1.0,0.0,0.2520284,0.0101964287,0.23487629,0.03027267,0.451555043,0.0,0.4214165,0.0,0.252584219,0.0,0.765113,0.0]} + }, + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,4,4,5,5,6,6,9,9,10,10,11,11,12,12,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.1720183,0.0,0.06937586,0.0,0.0415464081,0.000357862,0.117047414,0.0,0.125355765,0.0,0.00331615843,0.0,0.0322769023,0.00215974823,0.0487149358,0.005940363,0.0224514417,0.004324801,0.0,0.08573958,0.218287334,0.556978166,0.0486256331,0.109176867,0.123692557,0.06044983,0.220712245,0.01747605,1.0,0.0133654,0.03721781,0.0,0.029788563,0.0,0.0410230346,0.0,0.106770568,0.0,0.154672638,0.0,0.0659079,0.0]} + } + ] + }, + { + "$type": "pwiz.SkylineTestUtil.KoinaRetentionTimeQuery, TestUtil", + "_modifiedSequences": [ + "ELVIS", + "LIVES", + "FISAM[+15.994915]LPC[+57.021464]NKFC[+57.021464]K" + ], + "_iRTs": [ + 59.9891357, + 32.4056053, + 64.38522 + ] + }, + { + "$type": "pwiz.SkylineTestUtil.KoinaIntensityQuery, TestUtil", + "_inputs": [ + { + "ModifiedSequence": "SSAAPPPPPR", + "NormalizedCollisionEnergy": 27.0, + "PrecursorCharge": 2 + }, + { + "ModifiedSequence": "GISNEGQNASIK", + "NormalizedCollisionEnergy": 27.0, + "PrecursorCharge": 2 + }, + { + "ModifiedSequence": "HVLTSIGEK", + "NormalizedCollisionEnergy": 27.0, + "PrecursorCharge": 2 + }, + { + "ModifiedSequence": "DIPVPKPK", + "NormalizedCollisionEnergy": 27.0, + "PrecursorCharge": 2 + }, + { + "ModifiedSequence": "IGDYAGIK", + "NormalizedCollisionEnergy": 27.0, + "PrecursorCharge": 2 + }, + { + "ModifiedSequence": "TASEFDSAIAQDK", + "NormalizedCollisionEnergy": 27.0, + "PrecursorCharge": 2 + }, + { + "ModifiedSequence": "SAAGAFGPELSR", + "NormalizedCollisionEnergy": 27.0, + "PrecursorCharge": 2 + }, + { + "ModifiedSequence": "ELGQSGVDTYLQTK", + "NormalizedCollisionEnergy": 27.0, + "PrecursorCharge": 2 + }, + { + "ModifiedSequence": "SFANQPLEVVYSK", + "NormalizedCollisionEnergy": 27.0, + "PrecursorCharge": 2 + }, + { + "ModifiedSequence": "GLILVGGYGTR", + "NormalizedCollisionEnergy": 27.0, + "PrecursorCharge": 2 + }, + { + "ModifiedSequence": "GILFVGSGVSGGEEGAR", + "NormalizedCollisionEnergy": 27.0, + "PrecursorCharge": 2 + }, + { + "ModifiedSequence": "LTILEELR", + "NormalizedCollisionEnergy": 27.0, + "PrecursorCharge": 2 + }, + { + "ModifiedSequence": "ELASGLSFPVGFK", + "NormalizedCollisionEnergy": 27.0, + "PrecursorCharge": 2 + }, + { + "ModifiedSequence": "LSSEAPALFQFDLK", + "NormalizedCollisionEnergy": 27.0, + "PrecursorCharge": 2 + } + ], + "_ionTables": [ + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.0,0.0003539717,0.0195946,0.0,0.2003551,0.0,0.15159063,0.0,0.0314450227,0.00312345638,0.006730591,0.00167884945,0.00273385178,0.0,0.00029594035,0.0,-1.0,-1.0,-1.0,-1.0,0.0165592432,0.019680826,0.6959737,1.0,0.181655392,0.071340546,0.08927853,0.0227801222,0.0228997543,0.0,-1.0,-1.0,0.0,0.0003809718]} + }, + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.385429144,0.0,0.123175889,0.0,0.0392140448,0.003771685,0.112957075,0.0,0.0157497786,0.0,0.009818854,0.0,0.012786366,0.0,0.0170970764,0.0,0.0135055147,0.0,0.0122696282,0.0,0.0,0.02773757,0.6788335,0.318958849,0.265999049,0.06856682,0.398976445,0.0469611324,1.0,0.0,0.12180198,0.0,0.203193724,0.0,0.113513522,0.0,0.206718221,0.0,0.09218556,0.0,0.2006175,0.0]} + }, + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.0392443538,0.0009551142,0.768493354,0.0,0.05964639,0.0,0.01694947,0.00156450656,0.0255790222,0.000484452641,0.0336995125,0.00222377572,0.04670236,0.00400436949,0.0593277551,0.0,0.3745376,0.0,1.0,0.0,0.154088318,0.0,0.0557299219,0.0,0.0308363773,0.000210823826,0.118451253,0.0,0.029740775,0.0,0.124956235,0.0]} + }, + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,4,4,5,5,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.160871238,0.0,0.0390447825,0.0005864887,0.0121626724,0.000256154279,0.00035636418,0.0,0.0,0.00168183492,0.731408358,1.0,0.06205366,0.0013481864,0.739241242,0.0150672272,0.0146443322,0.0,0.112387553,0.0,0.00765751,0.0]} + }, + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,4,4,5,5,6,6,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.09858595,0.0,0.0211198665,0.000272798236,0.00192964857,0.00132999662,0.0049186023,0.000195991277,0.007743069,0.0,1.0,0.0,0.222631767,0.0,0.126973331,0.0,0.06463496,0.0009623696,0.0658437,0.0,0.0206695814,0.0,0.0398800373,0.0]} + }, + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.753322542,0.0,0.2283506,0.0,0.15500918,0.0062481584,0.0758803859,0.0030085505,0.0339235,0.001029042,0.0243435074,0.0,0.03204403,0.0,0.034901496,0.0,0.0141495671,0.0,0.00487619173,0.0,0.0,0.0161046647,0.8270511,0.120993674,0.298477173,0.029610958,1.0,0.0787391961,0.793252349,0.0007117696,0.464521319,0.0,0.227653235,0.0,0.2646432,0.0,0.6401744,0.0,0.178017437,0.0,0.184258983,0.0,0.07155873,0.0]} + }, + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.330419153,0.0,0.176939145,0.0,0.147226185,0.007483494,0.248911262,0.00200943649,0.08874124,0.0,0.0241060685,0.0,0.00217626756,0.0,0.00288010668,0.0,0.006109097,0.0,0.0,0.007188614,0.189899489,0.155550137,0.395845562,0.0207055286,0.153673962,0.03340108,0.893583834,0.08468722,1.0,0.03329645,0.399394631,0.0117959026,0.009904076,0.0,0.0486208424,0.0,0.0565291345,0.0,0.03581492,0.0]} + }, + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.203156367,0.0,0.06770097,0.0,0.11361102,0.00196760381,0.0632776842,0.0006474904,0.0240551922,0.000131072549,0.03669353,0.0,0.0133256624,0.0,0.009394315,0.0,0.0138014508,0.0,0.0151272491,0.0,0.00759388739,0.0,0.00252787955,0.0,0.0,0.0278470237,0.305504054,0.08214411,0.0565009266,0.03684668,1.0,0.038971927,0.7061399,0.0,0.1925905,0.000288570067,0.777277946,0.0,0.259531617,0.0,0.1564729,0.0,0.25680083,0.0,0.227746859,0.0,0.257432,0.0,0.08731105,0.0]} + }, + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.309432,0.0,0.1562693,0.0,0.106726818,0.00267612841,0.162191063,0.0,0.000458017428,0.0,0.00456598261,0.0,0.0124300541,0.0,0.017519379,0.0,0.0152848335,0.0,0.005683468,0.0,0.0,0.005136877,0.1277759,0.0246405825,0.1336394,0.0136803091,0.112857178,0.026047593,1.0,0.0559977777,0.0464040451,0.0,0.07303775,0.0,0.0929026157,0.0,0.130515516,0.0,0.197775528,0.0,0.09802607,0.0,0.0353745632,0.0]} + }, + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,4,4,5,5,6,6,7,7,8,8,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.07336509,0.0,0.5046588,0.0,0.279180855,0.0,0.100256413,0.000373967458,0.011247986,0.0,0.00319345249,0.0,0.00131969992,0.0,-1.0,-1.0,0.053048376,0.0340338238,0.423732519,0.03199257,0.665996552,0.0153969554,1.0,0.0,0.1468877,0.0,0.036290437,0.0,0.03109545,0.0,0.00489054434,0.0,0.0105648991,0.0]} + }, + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,15,15,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.07954531,0.0,0.416128159,0.0,0.284758478,0.0,0.131800219,0.00016941916,0.02756367,0.0,0.02518577,0.0,0.0262486283,0.0,0.036782518,0.0,0.0133281769,0.0,0.00381526747,0.0,0.000538075634,0.0,0.002006665,0.0,0.0,0.0003398029,-1.0,-1.0,0.004974223,0.0483159758,0.142591655,0.08423652,0.380586624,0.07195828,1.0,0.006567556,0.2334699,0.0,0.2713416,0.0,0.106286541,0.0,0.3970299,0.0,0.180293873,0.0,0.05309247,0.0,0.0151419984,0.0,0.03999327,0.0,0.052397985,0.0,0.000670483045,0.0,0.03547874,0.0]} + }, + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,4,4,5,5,6,6,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.496537775,0.0,0.07571766,0.0,0.0255699176,0.00157774461,0.00293420022,0.0,0.00263571669,0.0,0.316367835,0.0206225272,1.0,0.135086626,0.9804981,0.02264145,0.613890469,0.0,0.131231233,0.0,0.1044129,0.0,0.0420899019,0.0]} + }, + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.5312961,0.0,0.172791973,0.0,0.05727757,0.004320076,0.0524907857,0.0018229651,0.0493401848,0.0,0.0171452444,0.0,0.0137863224,0.0,0.00195622747,0.0,0.0,0.009480495,0.660589337,0.04259811,0.6863655,0.0356620438,0.603766263,0.0160447937,0.244472951,0.004964968,1.0,0.0,0.343481153,0.0,0.6276071,0.0,0.0367209353,0.0,0.174953446,0.0,0.05494807,0.0,0.06171783,0.0]} + }, + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.08862826,0.000254013547,0.0208401643,0.0,0.07755952,0.00121347315,0.135455,0.0,0.00657699164,0.0,0.01112827,0.0,0.01667096,0.0,0.008140888,0.0,0.003871068,0.0,0.0004582173,0.0,0.00275508757,0.0,0.0205000713,0.005283944,0.0723241046,0.005744654,0.04622958,0.0,0.2021201,0.07743183,1.0,0.219425812,0.06042628,0.0,0.08082863,0.0,0.148851261,0.0,0.0588461272,0.0,0.0575762875,0.0,0.0277170483,0.0,0.0527866445,0.0,0.024704162,0.0]} + } + ] + } +] \ No newline at end of file diff --git a/pwiz_tools/Skyline/TestFunctional/AccessServerTest.cs b/pwiz_tools/Skyline/TestFunctional/AccessServerTest.cs index 4c424e6502..f1a9aa8203 100644 --- a/pwiz_tools/Skyline/TestFunctional/AccessServerTest.cs +++ b/pwiz_tools/Skyline/TestFunctional/AccessServerTest.cs @@ -44,7 +44,7 @@ public class AccessServerTest : AbstractFunctionalTest public void TestAccessServer() { TestFilesZip = @"TestFunctional\AccessServerTest.zip"; - using (new FakeKoina(null)) + using (new FakeKoina(true, null)) { RunFunctionalTest(); } diff --git a/pwiz_tools/Skyline/TestFunctional/AddIrtStandardsTest.cs b/pwiz_tools/Skyline/TestFunctional/AddIrtStandardsTest.cs new file mode 100644 index 0000000000..aee33f2694 --- /dev/null +++ b/pwiz_tools/Skyline/TestFunctional/AddIrtStandardsTest.cs @@ -0,0 +1,180 @@ +/* + * Original author: Nicholas Shulman , + * MacCoss Lab, Department of Genome Sciences, UW + * + * Copyright 2024 University of Washington - Seattle, WA + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using pwiz.Skyline.Alerts; +using pwiz.Skyline.Properties; +using pwiz.Skyline.SettingsUI; +using pwiz.Skyline.SettingsUI.Irt; +using pwiz.SkylineTestUtil; + +namespace pwiz.SkylineTestFunctional +{ + [TestClass] + public class AddIrtStandardsTest : AbstractFunctionalTest + { + private const int CIRT_STANDARD_COUNT = 20; + private const string CIRT_STANDARDS_NAME = "20 CiRT Peptides"; + private const string CIRT_DATABASE_NAME = "20Cirt.irtdb"; + private const string CIRT_CALCULATOR_NAME = "CirtCalculator"; + + private const int DOC_STANDARD_COUNT = 50; + private const string DOC_STANDARDS_NAME = "50 Document Peptides"; + private const string DOC_DATABASE_NAME = "50Doc.irtdb"; + private const string DOC_CALCULATOR_NAME = "DocCalculator"; + [TestMethod] + public void TestAddIrtStandards() + { + TestFilesZip = @"TestFunctional\AddIrtStandardsTest.zip"; + RunFunctionalTest(); + } + + protected override void DoTest() + { + RunUI(()=> + { + SkylineWindow.OpenFile(TestFilesDir.GetTestPath("AddIrtStandardsTest.sky")); + }); + WaitForDocumentLoaded(); + RunLongDlg(SkylineWindow.ShowPeptideSettingsUI, peptideSettingsUi => + { + RunUI(()=>peptideSettingsUi.SelectedTab = PeptideSettingsUI.TABS.Prediction); + CreateCalculatorWithCirtPeptides(peptideSettingsUi); + Assert.IsTrue(Settings.Default.IrtStandardList.ContainsKey(CIRT_STANDARDS_NAME)); + Assert.IsTrue(Settings.Default.RTScoreCalculatorList.ContainsKey(CIRT_CALCULATOR_NAME)); + CreateCalculatorWithDocumentPeptides(peptideSettingsUi); + Assert.IsTrue(Settings.Default.IrtStandardList.ContainsKey(DOC_STANDARDS_NAME)); + Assert.IsTrue(Settings.Default.RTScoreCalculatorList.ContainsKey(DOC_CALCULATOR_NAME)); + }, peptideSettingsUi=>peptideSettingsUi.OkDialog()); + RunUI(() => + { + SkylineWindow.NewDocument(); + }); + + // Create a new document using the CIRT calculator and make sure the correct number of peptides get added + RunLongDlg(SkylineWindow.ShowPeptideSettingsUI, peptideSettingsUi => + { + RunDlg(peptideSettingsUi.AddRTRegression, editRtDlg => + { + editRtDlg.ChooseCalculator(CIRT_CALCULATOR_NAME); + editRtDlg.OkDialog(); + }); + RunDlg(peptideSettingsUi.OkDialog, addIrtStandardsToDocumentDlg => + { + addIrtStandardsToDocumentDlg.BtnYesClick(); + }); + }, peptideSettingsUi=>{}); + Assert.AreEqual(CIRT_STANDARD_COUNT, SkylineWindow.Document.PeptideCount); + RunUI(() => + { + SkylineWindow.SaveDocument(TestFilesDir.GetTestPath("CirtStandards.sky")); + SkylineWindow.NewDocument(); + }); + + // Create a new document using the other iRT calculator and make sure the correct number of peptides get added + RunLongDlg(SkylineWindow.ShowPeptideSettingsUI, peptideSettingsUi => + { + RunDlg(peptideSettingsUi.AddRTRegression, editRtDlg => + { + editRtDlg.ChooseCalculator(DOC_CALCULATOR_NAME); + editRtDlg.OkDialog(); + }); + RunDlg(peptideSettingsUi.OkDialog, addIrtStandardsToDocumentDlg => + { + addIrtStandardsToDocumentDlg.BtnYesClick(); + }); + }, peptideSettingsUi => { }); + Assert.AreEqual(DOC_STANDARD_COUNT, SkylineWindow.Document.PeptideCount); + } + + /// + /// Create an iRT database using 20 peptides from the document, and say "Yes" when asked + /// if you want to use the CiRT peptides that were found in the document + /// + private void CreateCalculatorWithCirtPeptides(PeptideSettingsUI peptideSettingsUi) + { + var editIrtCalcDlg = ShowDialog(peptideSettingsUi.EditCalculator); + var calibrateDlg = ShowDialog(editIrtCalcDlg.Calibrate); + var countDlg = ShowDialog(calibrateDlg.UseResults); + RunUI(() => + { + countDlg.StandardCount = CIRT_STANDARD_COUNT; + }); + var useCirtPeptidesDlg = ShowDialog(countDlg.OkDialog); + Assert.AreEqual(string.Format(IrtResources + .CalibrationGridViewDriver_FindEvenlySpacedPeptides_This_document_contains__0__CiRT_peptides__Would_you_like_to_use__1__of_them_as_your_iRT_standards_, + 27, 20), useCirtPeptidesDlg.Message); + OkDialog(useCirtPeptidesDlg, useCirtPeptidesDlg.ClickYes); + var usePredefinedCirtValuesDlg = WaitForOpenForm(); + Assert.AreEqual(IrtResources.CalibrationGridViewDriver_FindEvenlySpacedPeptides_Would_you_like_to_use_the_predefined_iRT_values_, usePredefinedCirtValuesDlg.Message); + OkDialog(usePredefinedCirtValuesDlg, usePredefinedCirtValuesDlg.ClickYes); + + RunUI(() => + { + calibrateDlg.StandardName = CIRT_STANDARDS_NAME; + }); + OkDialog(calibrateDlg, calibrateDlg.OkDialog); + var addIrtPeptidesDlg = ShowDialog(editIrtCalcDlg.AddResults); + OkDialog(addIrtPeptidesDlg, addIrtPeptidesDlg.OkDialog); + var recalibrateIrtDlg = WaitForOpenForm(); + StringAssert.StartsWith(recalibrateIrtDlg.Message, Resources.LibraryGridViewDriver_AddToLibrary_Do_you_want_to_recalibrate_the_iRT_standard_values_relative_to_the_peptides_being_added_); + OkDialog(recalibrateIrtDlg, recalibrateIrtDlg.ClickNo); + + RunUI(() => + { + editIrtCalcDlg.CreateDatabase(TestFilesDir.GetTestPath(CIRT_DATABASE_NAME)); + editIrtCalcDlg.CalcName = CIRT_CALCULATOR_NAME; + }); + OkDialog(editIrtCalcDlg, editIrtCalcDlg.OkDialog); + } + + /// + /// Create an iRT database using 50 peptides from the document. Because there are only + /// 27 available CiRT peptides in the document, the questions about using CiRT will not + /// be asked. + /// + private void CreateCalculatorWithDocumentPeptides(PeptideSettingsUI peptideSettingsUi) + { + var editIrtCalcDlg = ShowDialog(peptideSettingsUi.EditCalculator); + var calibrateDlg = ShowDialog(editIrtCalcDlg.Calibrate); + var countDlg = ShowDialog(calibrateDlg.UseResults); + RunUI(() => + { + countDlg.StandardCount = DOC_STANDARD_COUNT; + }); + OkDialog(countDlg, countDlg.OkDialog); + RunUI(() => + { + calibrateDlg.StandardName = DOC_STANDARDS_NAME; + }); + OkDialog(calibrateDlg, calibrateDlg.OkDialog); + var addIrtPeptidesDlg = ShowDialog(editIrtCalcDlg.AddResults); + OkDialog(addIrtPeptidesDlg, addIrtPeptidesDlg.OkDialog); + var recalibrateIrtDlg = WaitForOpenForm(); + StringAssert.StartsWith(recalibrateIrtDlg.Message, Resources.LibraryGridViewDriver_AddToLibrary_Do_you_want_to_recalibrate_the_iRT_standard_values_relative_to_the_peptides_being_added_); + OkDialog(recalibrateIrtDlg, recalibrateIrtDlg.ClickNo); + + RunUI(() => + { + editIrtCalcDlg.CreateDatabase(TestFilesDir.GetTestPath(DOC_DATABASE_NAME)); + editIrtCalcDlg.CalcName = DOC_CALCULATOR_NAME; + }); + OkDialog(editIrtCalcDlg, editIrtCalcDlg.OkDialog); + } + } +} diff --git a/pwiz_tools/Skyline/TestFunctional/AddIrtStandardsTest.zip b/pwiz_tools/Skyline/TestFunctional/AddIrtStandardsTest.zip new file mode 100644 index 0000000000..d8414e9552 Binary files /dev/null and b/pwiz_tools/Skyline/TestFunctional/AddIrtStandardsTest.zip differ diff --git a/pwiz_tools/Skyline/TestFunctional/IrtCalibrationTest.cs b/pwiz_tools/Skyline/TestFunctional/IrtCalibrationTest.cs new file mode 100644 index 0000000000..98b89fedea --- /dev/null +++ b/pwiz_tools/Skyline/TestFunctional/IrtCalibrationTest.cs @@ -0,0 +1,146 @@ +/* + * Original author: Brendan MacLean , + * MacCoss Lab, Department of Genome Sciences, UW + * + * Copyright 2024 University of Washington - Seattle, WA + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System.Linq; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using pwiz.Skyline.Alerts; +using pwiz.Skyline.Controls.Graphs; +using pwiz.Skyline.Model; +using pwiz.Skyline.Model.Irt; +using pwiz.Skyline.Properties; +using pwiz.Skyline.SettingsUI; +using pwiz.Skyline.SettingsUI.Irt; +using pwiz.SkylineTestUtil; +using IrtResources = pwiz.Skyline.SettingsUI.Irt.IrtResources; + +namespace pwiz.SkylineTestFunctional +{ + [TestClass] + public class IrtCalibrationTest : AbstractFunctionalTestEx + { + private const string CALCULATOR_NAME = "CoralEggs-Cirt"; + private const int STANDARD_PEP_COUNT = 20; + + [TestMethod] + public void TestIrtCalibration() + { + TestFilesZip = @"TestFunctional\IrtCalibrationTest.zip"; + RunFunctionalTest(); + } + + protected override void DoTest() + { + CalibrateIrtCalculator(); + UseIrtCalculator(); + } + + private void CalibrateIrtCalculator() + { + var doc = OpenDocument(TestFilesDir.GetTestPath("CoralEggs-dda-min.sky")); + var peptideSettingsUI = ShowDialog(SkylineWindow.ShowPeptideSettingsUI); + RunUI(() => peptideSettingsUI.SelectedTab = PeptideSettingsUI.TABS.Prediction); + var irtCalcDlg = ShowDialog(peptideSettingsUI.AddCalculator); + RunUI(() => + { + irtCalcDlg.CreateDatabase(TestFilesDir.GetTestPath(CALCULATOR_NAME + IrtDb.EXT)); + irtCalcDlg.CalcName = CALCULATOR_NAME; + }); + var calibrateDlg = ShowDialog(irtCalcDlg.Calibrate); + RunUI(() => calibrateDlg.StandardName = CALCULATOR_NAME); + var pickPeptidesDlg = ShowDialog(calibrateDlg.UseResults); + RunUI(() => pickPeptidesDlg.StandardCount = 20); + var useCirtMessage = ShowDialog(pickPeptidesDlg.OkDialog); + RunUI(() => Assert.AreEqual(string.Format( + IrtResources + .CalibrationGridViewDriver_FindEvenlySpacedPeptides_This_document_contains__0__CiRT_peptides__Would_you_like_to_use__1__of_them_as_your_iRT_standards_, + 33, STANDARD_PEP_COUNT), useCirtMessage.Message)); + OkDialog(useCirtMessage, + useCirtMessage.BtnYesClick); // Make sure this form goes away before checking for the next MultiButtonMsgDlg + var recalibrateMessage = WaitForOpenForm(); + RunUI(() => Assert.AreEqual( + IrtResources + .CalibrationGridViewDriver_FindEvenlySpacedPeptides_Would_you_like_to_use_the_predefined_iRT_values_, + recalibrateMessage.Message)); + OkDialog(recalibrateMessage, recalibrateMessage.Btn1Click); // Don't recalibrate + RunUI(() => { Assert.AreEqual(STANDARD_PEP_COUNT, calibrateDlg.StandardPeptideCount); }); + RunDlg(calibrateDlg.GraphRegression, dlgRegression => + { + Assert.AreEqual(1, dlgRegression.RegressionGraphDatas.Count); + var regressionData = dlgRegression.RegressionGraphDatas.First(); + Assert.AreEqual(33, regressionData.XValues.Length); // Uses all available CiRT values - should it? + Assert.AreEqual(2.162, regressionData.RegressionLine.Slope, 0.001); + Assert.AreEqual(-85.602, regressionData.RegressionLine.Intercept, 0.001); + dlgRegression.CloseDialog(); + }); + OkDialog(calibrateDlg, calibrateDlg.OkDialog); + RunUI(() => Assert.AreEqual(STANDARD_PEP_COUNT, irtCalcDlg.StandardPeptideCount)); + var addIrtPeptidesDlg = ShowDialog(irtCalcDlg.AddResults); + RunUI(() => + { + Assert.AreEqual(57, addIrtPeptidesDlg.PeptidesCount); + Assert.AreEqual(2, addIrtPeptidesDlg.RunsConvertedCount); // 2 replicates + Assert.AreEqual(0, addIrtPeptidesDlg.RunsFailedCount); + }); + var recalibratePepsMessage = ShowDialog(addIrtPeptidesDlg.OkDialog); + OkDialog(recalibratePepsMessage, recalibratePepsMessage.ClickNo); + RunUI(() => Assert.AreEqual(57, irtCalcDlg.LibraryPeptideCount)); + OkDialog(irtCalcDlg, irtCalcDlg.OkDialog); + OkDialog(peptideSettingsUI, + peptideSettingsUI.CancelDialog); // The point was to create the new calculator not to use it here + + RunUI(() => + { + var calibratedStandard = Settings.Default.IrtStandardList[CALCULATOR_NAME]; + Assert.IsNotNull(calibratedStandard); + Assert.AreEqual(STANDARD_PEP_COUNT, calibratedStandard.Peptides.Count); + Assert.IsNotNull(calibratedStandard.DocXml); + AssertEx.RoundTrip(calibratedStandard); + var docStandard = calibratedStandard.GetDocument(); + ValidateDocWithCalibratedIrts(docStandard); + }); + } + + private static void UseIrtCalculator() + { + // Create a new default document and add the new calculator to it + var docNew = new SrmDocument(SrmSettingsList.GetDefault()); + RunUI(() => SkylineWindow.SwitchDocument(docNew, null)); + + var peptideSettingsUI = ShowDialog(SkylineWindow.ShowPeptideSettingsUI); + RunUI(() => + { + peptideSettingsUI.SelectedTab = PeptideSettingsUI.TABS.Prediction; + peptideSettingsUI.SelectedRTPredictor = CALCULATOR_NAME; + }); + var addIrtPepsToDoc = ShowDialog(peptideSettingsUI.OkDialog); + RunUI(() => addIrtPepsToDoc.NumTransitions = 6); + OkDialog(addIrtPepsToDoc, addIrtPepsToDoc.BtnYesClick); + var docWithStandards = WaitForDocumentChangeLoaded(docNew); + ValidateDocWithCalibratedIrts(docWithStandards); + } + + private static void ValidateDocWithCalibratedIrts(SrmDocument docWithStandards) + { + // Not all standards have 6 transitions, but the fact that there are 94 below shows there are more than 3 each (60 total) + AssertEx.IsDocumentState(docWithStandards, null, 1, STANDARD_PEP_COUNT, STANDARD_PEP_COUNT, 94); + // Now make sure they are all fragment ions + Assert.IsFalse(docWithStandards.PeptideTransitions.Any(t => t.IsMs1)); + } + } +} \ No newline at end of file diff --git a/pwiz_tools/Skyline/TestFunctional/IrtCalibrationTest.zip b/pwiz_tools/Skyline/TestFunctional/IrtCalibrationTest.zip new file mode 100644 index 0000000000..a8225f25b5 Binary files /dev/null and b/pwiz_tools/Skyline/TestFunctional/IrtCalibrationTest.zip differ diff --git a/pwiz_tools/Skyline/TestFunctional/IrtTest.cs b/pwiz_tools/Skyline/TestFunctional/IrtTest.cs index c9ce7ec137..fe9da61de1 100644 --- a/pwiz_tools/Skyline/TestFunctional/IrtTest.cs +++ b/pwiz_tools/Skyline/TestFunctional/IrtTest.cs @@ -22,6 +22,7 @@ using System.Linq; using System.Text; using System.Windows.Forms; +using System.Xml.Serialization; using Microsoft.VisualStudio.TestTools.UnitTesting; using pwiz.Skyline; using pwiz.Skyline.Alerts; @@ -123,8 +124,8 @@ private void RunIrtTest() RunDlg(countDlg.OkDialog, messageDlg => messageDlg.OkDialog()); RunUI(() => countDlg.StandardCount = peptideCount); OkDialog(countDlg, countDlg.OkDialog); - - Assert.AreEqual(peptideCount, calibrateDlg.StandardPeptideCount); + TryWaitForConditionUI(() => peptideCount == calibrateDlg.StandardPeptideCount); + RunUI(() => Assert.AreEqual(peptideCount, calibrateDlg.StandardPeptideCount)); //Bypass the UI foreach (int i in new[] @@ -219,12 +220,13 @@ private void RunIrtTest() // Recalibrate const int shift = 100; const int skew = 10; - RunDlg(irtDlg1.Calibrate, recalDlg => + var recalcDlg1 = ShowDialog(irtDlg1.Calibrate); + RunUI(() => { - recalDlg.SetIrtRange(standard[1].RetentionTime + shift, standard[standard.Length - 1].RetentionTime * skew + shift); - recalDlg.SetFixedPoints(1, standard.Length - 1); - recalDlg.OkDialog(); + recalcDlg1.SetIrtRange(standard[1].RetentionTime + shift, standard[standard.Length - 1].RetentionTime * skew + shift); + recalcDlg1.SetFixedPoints(1, standard.Length - 1); }); + OkDialog(recalcDlg1, recalcDlg1.OkDialog); RunUI(() => { for (int i = 0; i < irtDlg1.StandardPeptideCount; i++) @@ -233,12 +235,13 @@ private void RunIrtTest() irtDlg1.StandardPeptides.Skip(i).First().Irt); } }); - RunDlg(irtDlg1.Calibrate, recalDlg => + var recalcDlg2 = ShowDialog(irtDlg1.Calibrate); + RunUI(() => { - recalDlg.SetIrtRange(standard[2].RetentionTime, standard[standard.Length - 2].RetentionTime); - recalDlg.SetFixedPoints(2, standard.Length - 2); - recalDlg.OkDialog(); + recalcDlg2.SetIrtRange(standard[2].RetentionTime, standard[standard.Length - 2].RetentionTime); + recalcDlg2.SetFixedPoints(2, standard.Length - 2); }); + OkDialog(recalcDlg2, recalcDlg2.OkDialog); // Change peptides var changePeptides = irtDlg1.LibraryPeptides.Where((p, i) => i%2 == 0).ToArray(); @@ -373,19 +376,19 @@ private void RunIrtTest() line = SkylineWindow.RTGraphController.RegressionRefined.Conversion as RegressionLineElement; }); Assert.IsNotNull(stats); - Assert.IsTrue(stats.R > 0.999); + Assert.AreEqual(1.0, stats.R, 0.001); Assert.IsNotNull(line); //These values were taken from the graph, which shows values to 2 decimal places, so the real values must //be +/- 0.01 from these values - Assert.IsTrue(Math.Abs(line.Intercept - 14.17) < 0.01); - Assert.IsTrue(Math.Abs(line.Slope - 0.15) < 0.01); + Assert.AreEqual(14.17, line.Intercept, 0.01); + Assert.AreEqual(0.15, line.Slope, 0.01); RunUI(() => SkylineWindow.ChooseCalculator(ssrCalc)); WaitForRegression(); RunUI(() => stats = SkylineWindow.RTGraphController.RegressionRefined.CalcStatistics(docPeptides, null)); Assert.IsNotNull(stats); - Assert.IsTrue(Math.Abs(stats.R - 0.97) < 0.01); + Assert.AreEqual(0.97, stats.R, 0.01); /* * Delete all peptides except the standard @@ -1434,4 +1437,116 @@ private void CheckIrtDbFile() Assert.AreEqual(0, expectedLibrary.Count); } } + + [TestClass] + public class IrtDocumentTest : AbstractFunctionalTestEx + { + [TestMethod] + public void IrtDocumentFunctionalTest() + { + RunFunctionalTest(); + } + + protected override void DoTest() + { + foreach (var standard in IrtStandard.ALL.Where(standard => standard.HasDocument)) + { + if (ReferenceEquals(standard, IrtStandard.REPLICAL)) + continue; // TODO: Fix neutral loss transition bug and remove this. + + TestStandardDocument(standard); + } + + // Test full CiRT with first 20 peptides not found in short CiRT list. + TestStandardDocument(IrtStandard.CIRT, + IrtStandard.CIRT.Peptides.Where(pep => !IrtStandard.CIRT_SHORT.Contains(pep.ModifiedTarget)).Take(20)); + + RunUI(() => SkylineWindow.SaveDocument(TestContext.GetTestResultsPath("test.sky"))); + } + + private void TestStandardDocument(IrtStandard standard, IEnumerable overrideStandards = null, int numTransitions = 3) + { + RunUI(() => SkylineWindow.NewDocument(true)); + var peptideSettings = ShowDialog(SkylineWindow.ShowPeptideSettingsUI); + + var standards = (overrideStandards ?? standard.Peptides).ToArray(); + + // Add iRT calculator. + RunDlg(peptideSettings.AddCalculator, dlg => + { + dlg.CalcName = string.Format("Test {0}", standard.Name); + dlg.CreateDatabase(TestContext.GetTestResultsPath("test.irtdb")); + dlg.StandardPeptides = standards; + dlg.OkDialog(); + }); + + // Add the iRT standards to the document. + RunDlg(peptideSettings.OkDialog, dlg => + { + dlg.NumTransitions = numTransitions; + dlg.BtnYesClick(); + }); + + WaitForCondition(() => SkylineWindow.Document.Peptides.Any() && SkylineWindow.Document.IsLoaded); + + // Check that the document contains the standards. + var doc = SkylineWindow.Document; + Assert.AreEqual(standards.Length, doc.PeptideCount, + $"{standard.Name}: have {doc.PeptideCount} peptides in document but want {standards.Length}"); + var docTargets = new TargetMap(doc.Peptides.Select(pep => + new KeyValuePair(pep.ModifiedTarget, pep))); + Assert.IsTrue(standards.All(pep => docTargets.ContainsKey(pep.ModifiedTarget)), + $"{standard.Name}: have document peptides {string.Join(", ", docTargets.Keys)} but want {string.Join(",", standards.Select(pep => pep.ModifiedTarget))}"); + + // Compare the added standards to the reference document. + var refDoc = (SrmDocument)(new XmlSerializer(typeof(SrmDocument))).Deserialize(standard.GetReader()); + Assert.AreEqual(standard.Peptides.Count, refDoc.PeptideCount, + $"{standard.Name}: have {refDoc.PeptideCount} peptides in reference document but want {standard.Peptides.Count}"); + var refDocTargets = new TargetMap(refDoc.Peptides.Select(pep => + new KeyValuePair(pep.ModifiedTarget, pep))); + foreach (var pep in docTargets) + { + var target = pep.Key; + var nodePep = pep.Value; + + Assert.IsTrue(refDocTargets.TryGetValue(target, out var refNodePep), + $"{standard.Name}: reference document does not contain added target {target}"); + + // Check precursors. + var nodeTranGroups = nodePep.TransitionGroups.OrderBy(nodeTranGroup => nodeTranGroup.PrecursorMz).ToArray(); + var refNodeTranGroups = refNodePep.TransitionGroups.OrderBy(nodeTranGroup => nodeTranGroup.PrecursorMz).ToArray(); + Assert.AreEqual(refNodeTranGroups.Length, nodeTranGroups.Length, + $"{standard.Name}: have {nodePep.TransitionGroupCount} precursors but want {refNodePep.TransitionGroupCount} for {target}"); + for (var i = 0; i < nodeTranGroups.Length; i++) + { + // Check transitions. + var nodeTranGroup = nodeTranGroups[i]; + var refNodeTranGroup = refNodeTranGroups[i]; + Assert.AreEqual(refNodeTranGroup.PrecursorMz, nodeTranGroup.PrecursorMz, + $"{standard.Name}: have precursor m/z {nodeTranGroup.PrecursorMz} for {target} but want {refNodeTranGroup.PrecursorMz}"); + + foreach (var nodeTran in refNodeTranGroup.Transitions) + Assert.IsTrue(nodeTran.HasLibInfo, + $"{standard.Name}: reference document missing LibInfo for {target}, {refNodeTranGroup.PrecursorMz}, {nodeTran.FragmentIonName}"); + + foreach (var nodeTran in nodeTranGroup.Transitions) + Assert.IsTrue(nodeTran.HasLibInfo, + $"{standard.Name}: missing LibInfo for added target {target}, {nodeTranGroup.PrecursorMz}, {nodeTran.FragmentIonName}"); + + var expectedTransitions = refNodeTranGroup.Transitions.OrderBy(nodeTran => nodeTran.LibInfo.Rank).Take(numTransitions).ToArray(); + var actualTransitions = nodeTranGroup.Transitions.OrderBy(nodeTran => nodeTran.LibInfo.Rank).ToArray(); + Assert.AreEqual(expectedTransitions.Length, actualTransitions.Length, + $"{standard.Name}: have {actualTransitions.Length} transitions for {target}, {nodeTranGroup.PrecursorMz} but want {expectedTransitions.Length}"); + + for (var j = 0; j < actualTransitions.Length; j++) + { + var actualTransition = actualTransitions[j]; + var expectedTransition = expectedTransitions[j]; + Assert.AreEqual(expectedTransition, actualTransition, + $"{standard.Name}: {target}, {nodeTranGroup.PrecursorMz} transition {actualTransition.FragmentIonName} does not equal expected transition"); + } + } + } + } + } } diff --git a/pwiz_tools/Skyline/TestFunctional/KoinaSkylineIntegrationTest.cs b/pwiz_tools/Skyline/TestFunctional/KoinaSkylineIntegrationTest.cs index 7796800b4a..884b2800b8 100644 --- a/pwiz_tools/Skyline/TestFunctional/KoinaSkylineIntegrationTest.cs +++ b/pwiz_tools/Skyline/TestFunctional/KoinaSkylineIntegrationTest.cs @@ -18,17 +18,10 @@ */ using System; -using System.Collections.Generic; using System.IO; using System.Linq; -using System.Text; using System.Windows.Forms; -using Google.Protobuf; -using Grpc.Core; -using Inference; using Microsoft.VisualStudio.TestTools.UnitTesting; -using pwiz.Common.Collections; -using pwiz.Skyline; using pwiz.Skyline.Controls; using pwiz.Skyline.Controls.Graphs; using pwiz.Skyline.Controls.SeqNode; @@ -36,7 +29,6 @@ using pwiz.Skyline.Model.Lib; using pwiz.Skyline.Model.Koina; using pwiz.Skyline.Model.Koina.Communication; -using pwiz.Skyline.Model.Koina.Config; using pwiz.Skyline.Model.Koina.Models; using pwiz.Skyline.Properties; using pwiz.Skyline.SettingsUI; @@ -50,1321 +42,9 @@ namespace pwiz.SkylineTestFunctional [TestClass] public class KoinaSkylineIntegrationTest : AbstractFunctionalTestEx { - private bool RecordData { get { return false; } } + private bool RecordData => false; - - public static KoinaQuery PING_QUERY_MS2 = new KoinaIntensityQuery( - new[] - { - new KoinaIntensityInput("PING", 0.3200f, 1) - }, - new[] - { - new[] - { - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - } - } - ); - - public static KoinaQuery PING_QUERY_IRT = new KoinaRetentionTimeQuery( - new[] - { - "PING" - }, - new[] {0.0f}); - - private static List QUERIES = new List(new KoinaQuery[] - { - new KoinaIntensityQuery( - new[] - { - new KoinaIntensityInput("C[unimod:4]SLPRPWALTFSYGR", 0.2800f, 2) - }, - new[] - { - new[] - { - 00.6462f, 00.0000f, 00.0052f, 00.0000f, 00.0000f, 00.0000f, - 00.0481f, 00.0000f, 00.0190f, 00.2609f, 00.0000f, 00.0000f, - 00.0031f, 00.0000f, 00.0860f, 00.2766f, 00.0000f, 00.0000f, - 00.0606f, 00.0000f, 00.1441f, 00.0000f, 00.0000f, 00.0000f, - 00.0341f, 00.0000f, 00.0769f, 00.3538f, 00.0000f, 00.0000f, - 00.1313f, 00.0000f, 00.0446f, 00.0000f, 00.0000f, 00.0000f, - 00.1047f, 00.0000f, 00.0000f, 00.0623f, 00.0000f, 00.0000f, - 00.1203f, 00.0000f, 00.0002f, 00.0829f, 00.0000f, 00.0000f, - 00.0054f, 00.0000f, 00.0000f, 00.1518f, 00.0179f, 00.0000f, - 01.2122f, 00.0996f, 00.0856f, 00.0864f, 00.0159f, 00.0086f, - 00.0000f, 00.0000f, 00.0968f, 00.1349f, 00.0193f, 00.0000f, - 00.0112f, 00.4437f, 00.0848f, 00.1889f, 00.0344f, 00.0000f, - 00.0000f, 00.0772f, 00.0844f, 00.0653f, 00.0163f, 00.0000f, - 00.0000f, 00.0685f, 00.0959f, 00.2330f, 00.0000f, 00.0000f, - 00.0081f, 00.2222f, 00.1793f, 00.2075f, 00.0033f, 00.0094f, - 00.0757f, 00.2487f, 00.1889f, 00.0083f, 00.0066f, 00.0154f, - 00.0640f, 00.2320f, 00.1659f, 00.0741f, 00.0029f, 00.0182f, - 00.0674f, 00.1956f, 00.2280f, 00.0000f, 00.0226f, 00.0201f, - 00.0762f, 00.1435f, 00.2334f, 00.0000f, 00.0000f, 00.0215f, - 00.0928f, 00.1372f, 00.1918f, 00.0000f, 00.0000f, 00.0175f, - 00.1501f, 00.1331f, 00.2328f, 00.0000f, 00.0075f, 00.0112f, - 00.2064f, 00.1221f, 00.2546f, 00.0183f, 00.0167f, 00.0000f, - 00.1455f, 00.0972f, 00.1552f, 00.0367f, 00.0000f, 00.0000f, - 00.4986f, 00.1516f, 00.0506f, 00.1853f, 00.0000f, 00.0000f, - 00.3394f, 00.1697f, 00.0730f, 00.0744f, 00.0160f, 00.0000f, - 00.3572f, 00.1354f, 00.0830f, 00.1141f, 00.0000f, 00.0000f, - 00.3186f, 00.1134f, 00.0722f, 00.0915f, 00.0000f, 00.0000f, - 00.1953f, 00.1130f, 00.2348f, 00.0758f, 00.0000f, 00.0000f, - 00.0888f, 00.1775f, 00.3485f, 00.1778f, 00.0502f, 00.0720f - } - } - ), - new KoinaRetentionTimeQuery( - new[] - { - "C[unimod:4]SLPRPWALTFSYGR" - }, - new[] - { - 1.2758f - } - ), - new KoinaIntensityQuery( - new[] - { - new KoinaIntensityInput("C[unimod:4]SLPRPWALTFSYGR", 0.2500f, 2) - }, - new[] - { - new[] - { - 00.5830f, 00.0000f, 00.0187f, 00.0000f, 00.0000f, 00.0000f, - 00.0216f, 00.0000f, 00.0255f, 00.1427f, 00.0000f, 00.0000f, - 00.0100f, 00.0000f, 00.0913f, 00.2454f, 00.0000f, 00.0000f, - 00.0722f, 00.0000f, 00.1459f, 00.0000f, 00.0000f, 00.0000f, - 00.0171f, 00.0000f, 00.0866f, 00.3487f, 00.0000f, 00.0000f, - 00.0989f, 00.0000f, 00.0557f, 00.0000f, 00.0000f, 00.0000f, - 00.0619f, 00.0000f, 00.0060f, 00.0457f, 00.0000f, 00.0000f, - 00.0854f, 00.0000f, 00.0122f, 00.0412f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.1067f, 00.0027f, 00.0000f, - 00.8993f, 00.0311f, 00.0970f, 00.0420f, 00.0037f, 00.0057f, - 00.0000f, 00.0000f, 00.0963f, 00.0942f, 00.0090f, 00.0000f, - 00.0335f, 00.3927f, 00.1065f, 00.1465f, 00.0252f, 00.0000f, - 00.0000f, 00.0542f, 00.1210f, 00.0452f, 00.0121f, 00.0000f, - 00.0000f, 00.0255f, 00.1290f, 00.2240f, 00.0000f, 00.0000f, - 00.0185f, 00.1537f, 00.2175f, 00.2112f, 00.0137f, 00.0122f, - 00.0794f, 00.1904f, 00.2342f, 00.0000f, 00.0029f, 00.0160f, - 00.0874f, 00.1845f, 00.1943f, 00.0447f, 00.0000f, 00.0230f, - 00.0764f, 00.1500f, 00.2642f, 00.0000f, 00.0096f, 00.0257f, - 00.0827f, 00.1098f, 00.2740f, 00.0000f, 00.0000f, 00.0259f, - 00.1191f, 00.0850f, 00.2120f, 00.0000f, 00.0000f, 00.0217f, - 00.1671f, 00.0806f, 00.2889f, 00.0000f, 00.0062f, 00.0097f, - 00.3111f, 00.0811f, 00.2294f, 00.0581f, 00.0000f, 00.0000f, - 00.2472f, 00.0516f, 00.1269f, 00.0201f, 00.0000f, 00.0000f, - 00.6905f, 00.2069f, 00.0647f, 00.3026f, 00.0000f, 00.0000f, - 00.6349f, 00.1877f, 00.0557f, 00.0407f, 00.0000f, 00.0000f, - 00.4823f, 00.2164f, 00.1307f, 00.2852f, 00.0000f, 00.0000f, - 00.4782f, 00.2001f, 00.2834f, 00.0783f, 00.0000f, 00.0000f, - 00.3489f, 00.1800f, 00.3470f, 00.3913f, 00.0000f, 00.0000f, - 00.0000f, 00.2600f, 00.7002f, 00.4010f, 00.0523f, 00.0916f - } - } - ), - new KoinaRetentionTimeQuery( - new[] - { - "C[unimod:4]SLPRPWALTFSYGR" - }, - new[] - { - 1.2758f - } - ), - new KoinaIntensityQuery( - new[] - { - new KoinaIntensityInput("C[unimod:4]SLPRPWALTFSYGR", 0.2600f, 2) - }, - new[] - { - new[] - { - 00.6077f, 00.0000f, 00.0163f, 00.0000f, 00.0000f, 00.0000f, - 00.0282f, 00.0000f, 00.0251f, 00.1801f, 00.0000f, 00.0000f, - 00.0023f, 00.0000f, 00.0929f, 00.2566f, 00.0000f, 00.0000f, - 00.0642f, 00.0000f, 00.1468f, 00.0000f, 00.0000f, 00.0000f, - 00.0213f, 00.0000f, 00.0849f, 00.3547f, 00.0000f, 00.0000f, - 00.1086f, 00.0000f, 00.0533f, 00.0000f, 00.0000f, 00.0000f, - 00.0755f, 00.0000f, 00.0014f, 00.0504f, 00.0000f, 00.0000f, - 00.0947f, 00.0000f, 00.0093f, 00.0543f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.1208f, 00.0077f, 00.0000f, - 00.9942f, 00.0502f, 00.1003f, 00.0557f, 00.0081f, 00.0067f, - 00.0000f, 00.0000f, 00.0990f, 00.1075f, 00.0130f, 00.0000f, - 00.0253f, 00.4108f, 00.1019f, 00.1607f, 00.0286f, 00.0000f, - 00.0000f, 00.0622f, 00.1116f, 00.0532f, 00.0138f, 00.0000f, - 00.0000f, 00.0402f, 00.1134f, 00.2283f, 00.0000f, 00.0000f, - 00.0154f, 00.1772f, 00.1996f, 00.2125f, 00.0100f, 00.0117f, - 00.0785f, 00.2127f, 00.2158f, 00.0006f, 00.0044f, 00.0158f, - 00.0783f, 00.2012f, 00.1818f, 00.0557f, 00.0000f, 00.0215f, - 00.0720f, 00.1674f, 00.2520f, 00.0000f, 00.0147f, 00.0235f, - 00.0798f, 00.1226f, 00.2660f, 00.0000f, 00.0000f, 00.0244f, - 00.1087f, 00.1016f, 00.2075f, 00.0000f, 00.0000f, 00.0199f, - 00.1639f, 00.0968f, 00.2731f, 00.0000f, 00.0066f, 00.0101f, - 00.2803f, 00.0915f, 00.2380f, 00.0440f, 00.0056f, 00.0000f, - 00.2060f, 00.0636f, 00.1335f, 00.0208f, 00.0000f, 00.0000f, - 00.6317f, 00.1940f, 00.0560f, 00.2867f, 00.0000f, 00.0000f, - 00.5311f, 00.1840f, 00.0545f, 00.0437f, 00.0063f, 00.0000f, - 00.4538f, 00.1946f, 00.1143f, 00.2327f, 00.0000f, 00.0000f, - 00.4345f, 00.1891f, 00.2464f, 00.0482f, 00.0000f, 00.0000f, - 00.2881f, 00.1920f, 00.3373f, 00.3290f, 00.0000f, 00.0000f, - 00.0000f, 00.2325f, 00.6021f, 00.3237f, 00.0539f, 00.0899f - } - } - ), - new KoinaRetentionTimeQuery( - new[] - { - "C[unimod:4]SLPRPWALTFSYGR" - }, - new[] - { - 1.2758f - } - ), - new KoinaIntensityQuery( - new[] - { - new KoinaIntensityInput("LGGEEVSVAC[unimod:4]K", 0.2600f, 2) - }, - new[] - { - new[] - { - 00.1251f, 00.0000f, 00.0043f, 00.0000f, 00.0000f, 00.0000f, - 00.3919f, 00.0000f, 00.0081f, 00.5678f, 00.0000f, 00.0000f, - 00.6387f, 00.0000f, 00.0170f, 00.2681f, 00.0000f, 00.0000f, - 00.2780f, 00.0000f, 00.0000f, 00.3714f, 00.0000f, 00.0000f, - 01.4825f, 00.0000f, 00.0000f, 00.2861f, 00.0000f, 00.0000f, - 00.9143f, 00.0000f, 00.0000f, 00.2506f, 00.0000f, 00.0000f, - 00.9412f, 00.0207f, 00.0000f, 00.0631f, 00.0000f, 00.0016f, - 00.2121f, 00.0249f, 00.0322f, 00.0672f, 00.0000f, 00.0064f, - 00.7087f, 00.1002f, 00.0000f, 00.0493f, 00.0000f, 00.0034f, - 01.2851f, 00.0702f, 00.0000f, 00.0154f, 00.0000f, 00.0000f, - 00.4713f, 00.1194f, 00.0488f, 00.0249f, 00.0000f, 00.0092f, - 00.2944f, 00.1485f, 00.0343f, 00.0098f, 00.0115f, 00.0048f, - 00.2835f, 00.1719f, 00.0000f, 00.0000f, 00.0218f, 00.0046f, - 00.3277f, 00.2056f, 00.0112f, 00.0289f, 00.0504f, 00.0116f, - 00.2851f, 00.1710f, 00.0530f, 00.0423f, 00.0535f, 00.0198f, - 00.2407f, 00.1144f, 00.0925f, 00.0047f, 00.0313f, 00.0204f, - 00.2282f, 00.0823f, 00.1356f, 00.0000f, 00.0139f, 00.0160f, - 00.2526f, 00.0680f, 00.1460f, 00.0226f, 00.0050f, 00.0116f, - 00.2505f, 00.0617f, 00.1643f, 00.0503f, 00.0008f, 00.0053f, - 00.3049f, 00.0503f, 00.2027f, 00.0604f, 00.0023f, 00.0000f, - 00.3331f, 00.0329f, 00.1310f, 00.0609f, 00.0000f, 00.0000f, - 00.2463f, 00.0246f, 00.0763f, 00.0581f, 00.0000f, 00.0000f, - 00.1110f, 00.0331f, 00.0916f, 00.0680f, 00.0014f, 00.0000f, - 00.0000f, 00.0515f, 00.1539f, 00.0628f, 00.0054f, 00.0000f, - 00.0000f, 00.0525f, 00.1722f, 00.0830f, 00.0141f, 00.0000f, - 00.0310f, 00.0342f, 00.0964f, 00.0791f, 00.0278f, 00.0000f, - 00.0968f, 00.0092f, 00.0070f, 00.0640f, 00.0552f, 00.0000f, - 00.1475f, 00.0467f, 00.0000f, 00.0760f, 00.0941f, 00.0000f, - 00.2460f, 00.1242f, 00.0535f, 00.0311f, 00.1119f, 00.0020f - } - } - ), - new KoinaRetentionTimeQuery( - new[] - { - "LGGEEVSVAC[unimod:4]K" - }, - new[] - { - -0.6807f - } - ), - new KoinaIntensityQuery( - new[] - { - new KoinaIntensityInput("LGGEEVSVAC[unimod:4]K", 0.2700f, 2) - }, - new[] - { - new[] - { - 00.1257f, 00.0000f, 00.0040f, 00.0000f, 00.0000f, 00.0000f, - 00.4191f, 00.0000f, 00.0073f, 00.5884f, 00.0000f, 00.0000f, - 00.6531f, 00.0000f, 00.0098f, 00.2856f, 00.0000f, 00.0000f, - 00.2813f, 00.0000f, 00.0000f, 00.3593f, 00.0006f, 00.0000f, - 01.4928f, 00.0000f, 00.0000f, 00.2630f, 00.0000f, 00.0000f, - 00.9262f, 00.0000f, 00.0000f, 00.2153f, 00.0000f, 00.0000f, - 00.9594f, 00.0205f, 00.0000f, 00.0554f, 00.0000f, 00.0025f, - 00.2173f, 00.0236f, 00.0273f, 00.0542f, 00.0004f, 00.0073f, - 00.7281f, 00.0748f, 00.0000f, 00.0408f, 00.0000f, 00.0045f, - 01.3693f, 00.0454f, 00.0000f, 00.0110f, 00.0000f, 00.0000f, - 00.4869f, 00.0866f, 00.0452f, 00.0149f, 00.0000f, 00.0112f, - 00.2978f, 00.1205f, 00.0374f, 00.0007f, 00.0114f, 00.0043f, - 00.2843f, 00.1562f, 00.0000f, 00.0000f, 00.0230f, 00.0039f, - 00.3312f, 00.1967f, 00.0053f, 00.0182f, 00.0529f, 00.0108f, - 00.2922f, 00.1684f, 00.0471f, 00.0369f, 00.0575f, 00.0199f, - 00.2502f, 00.1118f, 00.0844f, 00.0009f, 00.0358f, 00.0200f, - 00.2318f, 00.0811f, 00.1231f, 00.0000f, 00.0167f, 00.0149f, - 00.2592f, 00.0672f, 00.1409f, 00.0199f, 00.0074f, 00.0095f, - 00.2575f, 00.0607f, 00.1522f, 00.0512f, 00.0010f, 00.0020f, - 00.3074f, 00.0502f, 00.1832f, 00.0602f, 00.0023f, 00.0000f, - 00.3356f, 00.0325f, 00.1174f, 00.0607f, 00.0004f, 00.0000f, - 00.2306f, 00.0220f, 00.0745f, 00.0575f, 00.0009f, 00.0000f, - 00.1107f, 00.0299f, 00.0832f, 00.0720f, 00.0026f, 00.0000f, - 00.0000f, 00.0517f, 00.1511f, 00.0661f, 00.0070f, 00.0000f, - 00.0000f, 00.0568f, 00.1755f, 00.0837f, 00.0156f, 00.0000f, - 00.0447f, 00.0326f, 00.0909f, 00.0771f, 00.0302f, 00.0000f, - 00.1165f, 00.0061f, 00.0013f, 00.0627f, 00.0578f, 00.0000f, - 00.1699f, 00.0498f, 00.0000f, 00.0737f, 00.0959f, 00.0000f, - 00.2736f, 00.1198f, 00.0496f, 00.0285f, 00.1074f, 00.0031f - } - } - ), - new KoinaRetentionTimeQuery( - new[] - { - "LGGEEVSVAC[unimod:4]K" - }, - new[] - { - -0.6807f - } - ), - new KoinaIntensityQuery( - new[] - { - new KoinaIntensityInput("GSYNLQDLLAQAK", 0.2700f, 2) - }, - new[] - { - new[] - { - 00.2222f, 00.0000f, 00.0216f, 00.0000f, 00.0000f, 00.0000f, - 00.5488f, 00.0000f, 00.0027f, 00.0341f, 00.0000f, 00.0000f, - 00.4643f, 00.0000f, 00.0232f, 00.1653f, 00.0000f, 00.0000f, - 01.1210f, 00.0000f, 00.0000f, 00.3590f, 00.0000f, 00.0000f, - 00.5599f, 00.0000f, 00.0000f, 00.5036f, 00.0000f, 00.0000f, - 00.4345f, 00.0000f, 00.0000f, 00.1177f, 00.0000f, 00.0000f, - 01.3181f, 00.0000f, 00.0000f, 00.0715f, 00.0000f, 00.0000f, - 01.8204f, 00.0102f, 00.0000f, 00.0909f, 00.0000f, 00.0000f, - 00.8764f, 00.0263f, 00.0000f, 00.0836f, 00.0000f, 00.0000f, - 00.6053f, 00.0485f, 00.0000f, 00.0459f, 00.0000f, 00.0064f, - 00.0243f, 00.2193f, 00.0622f, 00.0340f, 00.0000f, 00.0061f, - 00.0000f, 00.0069f, 00.0051f, 00.0152f, 00.0000f, 00.0112f, - 00.0490f, 00.0543f, 00.0754f, 00.0400f, 00.0178f, 00.0210f, - 00.1673f, 00.0810f, 00.0217f, 00.0780f, 00.0346f, 00.0200f, - 00.2067f, 00.1737f, 00.0457f, 00.0269f, 00.0413f, 00.0290f, - 00.2043f, 00.1116f, 00.0755f, 00.0375f, 00.0511f, 00.0418f, - 00.1739f, 00.0911f, 00.1149f, 00.0216f, 00.0317f, 00.0423f, - 00.1691f, 00.0842f, 00.1352f, 00.0175f, 00.0103f, 00.0340f, - 00.1944f, 00.0627f, 00.1495f, 00.0497f, 00.0069f, 00.0216f, - 00.2423f, 00.0545f, 00.1611f, 00.0761f, 00.0164f, 00.0110f, - 00.2670f, 00.0438f, 00.1386f, 00.0760f, 00.0335f, 00.0091f, - 00.2238f, 00.0296f, 00.0874f, 00.0568f, 00.0331f, 00.0119f, - 00.1468f, 00.0211f, 00.0795f, 00.0205f, 00.0136f, 00.0150f, - 00.0388f, 00.0236f, 00.1051f, 00.0298f, 00.0000f, 00.0123f, - 00.0000f, 00.0271f, 00.1415f, 00.0373f, 00.0000f, 00.0032f, - 00.0000f, 00.0224f, 00.1853f, 00.0452f, 00.0129f, 00.0000f, - 00.0000f, 00.0172f, 00.1179f, 00.0478f, 00.0271f, 00.0000f, - 00.0422f, 00.0475f, 00.0781f, 00.0536f, 00.0420f, 00.0000f, - 00.1369f, 00.0929f, 00.0299f, 00.0000f, 00.0621f, 00.0000f - } - } - ), - new KoinaRetentionTimeQuery( - new[] - { - "GSYNLQDLLAQAK" - }, - new[] - { - 1.2877f - } - ), - new KoinaIntensityQuery( - new[] - { - new KoinaIntensityInput("GSYNLQDLLAQAK", 0.2800f, 2) - }, - new[] - { - new[] - { - 00.2228f, 00.0000f, 00.0218f, 00.0000f, 00.0000f, 00.0000f, - 00.5515f, 00.0000f, 00.0027f, 00.0427f, 00.0000f, 00.0000f, - 00.4695f, 00.0000f, 00.0186f, 00.1676f, 00.0000f, 00.0000f, - 01.1469f, 00.0000f, 00.0000f, 00.3616f, 00.0000f, 00.0000f, - 00.5819f, 00.0000f, 00.0000f, 00.4666f, 00.0000f, 00.0000f, - 00.4595f, 00.0000f, 00.0000f, 00.1023f, 00.0000f, 00.0000f, - 01.3380f, 00.0000f, 00.0000f, 00.0642f, 00.0000f, 00.0000f, - 01.8074f, 00.0090f, 00.0000f, 00.0799f, 00.0000f, 00.0000f, - 00.8862f, 00.0218f, 00.0000f, 00.0657f, 00.0000f, 00.0000f, - 00.6142f, 00.0319f, 00.0000f, 00.0345f, 00.0000f, 00.0073f, - 00.0243f, 00.1586f, 00.0551f, 00.0246f, 00.0000f, 00.0071f, - 00.0000f, 00.0000f, 00.0009f, 00.0087f, 00.0000f, 00.0115f, - 00.0472f, 00.0417f, 00.0674f, 00.0319f, 00.0162f, 00.0205f, - 00.1676f, 00.0688f, 00.0183f, 00.0716f, 00.0345f, 00.0179f, - 00.2081f, 00.1642f, 00.0417f, 00.0271f, 00.0428f, 00.0284f, - 00.2109f, 00.1084f, 00.0723f, 00.0368f, 00.0521f, 00.0401f, - 00.1776f, 00.0887f, 00.1105f, 00.0217f, 00.0332f, 00.0401f, - 00.1745f, 00.0828f, 00.1301f, 00.0163f, 00.0119f, 00.0290f, - 00.2024f, 00.0627f, 00.1475f, 00.0512f, 00.0091f, 00.0157f, - 00.2487f, 00.0551f, 00.1604f, 00.0742f, 00.0203f, 00.0054f, - 00.2699f, 00.0420f, 00.1315f, 00.0733f, 00.0382f, 00.0037f, - 00.2188f, 00.0266f, 00.0818f, 00.0544f, 00.0367f, 00.0073f, - 00.1405f, 00.0179f, 00.0791f, 00.0179f, 00.0151f, 00.0103f, - 00.0345f, 00.0184f, 00.0999f, 00.0311f, 00.0000f, 00.0073f, - 00.0000f, 00.0251f, 00.1322f, 00.0427f, 00.0000f, 00.0000f, - 00.0000f, 00.0172f, 00.1711f, 00.0487f, 00.0127f, 00.0000f, - 00.0000f, 00.0109f, 00.0951f, 00.0506f, 00.0269f, 00.0000f, - 00.0603f, 00.0367f, 00.0602f, 00.0552f, 00.0433f, 00.0000f, - 00.1520f, 00.0739f, 00.0162f, 00.0000f, 00.0571f, 00.0000f - } - } - ), - new KoinaRetentionTimeQuery( - new[] - { - "GSYNLQDLLAQAK" - }, - new[] - { - 1.2877f - } - ), - new KoinaIntensityQuery( - new[] - { - new KoinaIntensityInput("TGTNLM[Oxidation (M)]DFLSR", 0.2800f, 2) - }, - new[] - { - new[] - { - 00.2001f, 00.0000f, 00.0075f, 00.0000f, 00.0000f, 00.0000f, - 00.6741f, 00.0000f, 00.0045f, 00.3808f, 00.0000f, 00.0000f, - 00.4529f, 00.0000f, 00.0027f, 00.3228f, 00.0000f, 00.0000f, - 00.5212f, 00.0000f, 00.0000f, 00.2289f, 00.0009f, 00.0001f, - 01.0849f, 00.0000f, 00.0000f, 00.2898f, 00.0000f, 00.0000f, - 01.6378f, 00.0416f, 00.0000f, 00.0786f, 00.0000f, 00.0000f, - 00.8101f, 00.2102f, 00.0000f, 00.0514f, 00.0000f, 00.0000f, - 00.6873f, 00.1890f, 00.0000f, 00.0398f, 00.0000f, 00.0042f, - 00.1427f, 00.3835f, 00.0594f, 00.0466f, 00.0000f, 00.0053f, - 00.0705f, 00.1046f, 00.0243f, 00.0132f, 00.0000f, 00.0073f, - 00.1122f, 00.1279f, 00.0738f, 00.0278f, 00.0000f, 00.0121f, - 00.1488f, 00.1239f, 00.0188f, 00.0284f, 00.0101f, 00.0180f, - 00.1614f, 00.1289f, 00.0209f, 00.0000f, 00.0234f, 00.0288f, - 00.2013f, 00.1515f, 00.0401f, 00.0232f, 00.0348f, 00.0303f, - 00.1740f, 00.1373f, 00.0853f, 00.0213f, 00.0334f, 00.0267f, - 00.1708f, 00.1064f, 00.1397f, 00.0076f, 00.0246f, 00.0238f, - 00.1927f, 00.0842f, 00.1587f, 00.0172f, 00.0164f, 00.0194f, - 00.2296f, 00.0723f, 00.1648f, 00.0400f, 00.0107f, 00.0174f, - 00.2553f, 00.0654f, 00.1777f, 00.0861f, 00.0106f, 00.0136f, - 00.2335f, 00.0572f, 00.1971f, 00.0886f, 00.0077f, 00.0114f, - 00.1800f, 00.0507f, 00.2045f, 00.0475f, 00.0000f, 00.0118f, - 00.0000f, 00.0504f, 00.2612f, 00.0425f, 00.0000f, 00.0156f, - 00.0000f, 00.0686f, 00.2467f, 00.0685f, 00.0018f, 00.0061f, - 00.0000f, 00.0810f, 00.2641f, 00.0806f, 00.0221f, 00.0000f, - 00.0000f, 00.0556f, 00.1427f, 00.0839f, 00.0265f, 00.0000f, - 00.1853f, 00.0624f, 00.0000f, 00.0597f, 00.0363f, 00.0000f, - 00.2176f, 00.0947f, 00.0000f, 00.0438f, 00.0518f, 00.0000f, - 00.2753f, 00.1264f, 00.0000f, 00.0443f, 00.0611f, 00.0000f, - 00.2349f, 00.1835f, 00.0329f, 00.0167f, 00.0738f, 00.0000f - } - } - ), - new KoinaRetentionTimeQuery( - new[] - { - "TGTNLM[Oxidation (M)]DFLSR" - }, - new[] - { - 0.7566f - } - ), - new KoinaIntensityQuery( - new[] - { - new KoinaIntensityInput("TGTNLM[Oxidation (M)]DFLSR", 0.2900f, 2) - }, - new[] - { - new[] - { - 00.2269f, 00.0000f, 00.0046f, 00.0000f, 00.0000f, 00.0000f, - 00.6578f, 00.0000f, 00.0000f, 00.4145f, 00.0000f, 00.0000f, - 00.4566f, 00.0000f, 00.0000f, 00.3164f, 00.0000f, 00.0000f, - 00.5774f, 00.0000f, 00.0000f, 00.2119f, 00.0013f, 00.0011f, - 01.1391f, 00.0000f, 00.0000f, 00.2512f, 00.0000f, 00.0000f, - 01.6669f, 00.0455f, 00.0000f, 00.0628f, 00.0000f, 00.0000f, - 00.8299f, 00.2046f, 00.0000f, 00.0413f, 00.0000f, 00.0000f, - 00.6934f, 00.1543f, 00.0000f, 00.0290f, 00.0000f, 00.0043f, - 00.1387f, 00.2774f, 00.0474f, 00.0338f, 00.0000f, 00.0054f, - 00.0662f, 00.0772f, 00.0148f, 00.0049f, 00.0000f, 00.0065f, - 00.1031f, 00.0994f, 00.0692f, 00.0136f, 00.0000f, 00.0105f, - 00.1448f, 00.1055f, 00.0177f, 00.0208f, 00.0099f, 00.0143f, - 00.1587f, 00.1164f, 00.0214f, 00.0000f, 00.0246f, 00.0241f, - 00.1986f, 00.1404f, 00.0440f, 00.0191f, 00.0363f, 00.0257f, - 00.1739f, 00.1290f, 00.0881f, 00.0138f, 00.0335f, 00.0213f, - 00.1731f, 00.0997f, 00.1354f, 00.0000f, 00.0217f, 00.0186f, - 00.1958f, 00.0767f, 00.1508f, 00.0100f, 00.0127f, 00.0149f, - 00.2294f, 00.0644f, 00.1495f, 00.0401f, 00.0076f, 00.0140f, - 00.2461f, 00.0578f, 00.1503f, 00.0760f, 00.0076f, 00.0125f, - 00.2324f, 00.0499f, 00.1589f, 00.0662f, 00.0022f, 00.0118f, - 00.1869f, 00.0404f, 00.1765f, 00.0441f, 00.0000f, 00.0121f, - 00.0000f, 00.0449f, 00.2472f, 00.0473f, 00.0000f, 00.0139f, - 00.0000f, 00.0608f, 00.2718f, 00.0706f, 00.0022f, 00.0000f, - 00.0000f, 00.0653f, 00.2894f, 00.0878f, 00.0212f, 00.0000f, - 00.0000f, 00.0729f, 00.1649f, 00.0890f, 00.0250f, 00.0000f, - 00.1639f, 00.0871f, 00.0104f, 00.0644f, 00.0330f, 00.0000f, - 00.2272f, 00.0854f, 00.0020f, 00.0522f, 00.0407f, 00.0000f, - 00.2954f, 00.1215f, 00.0146f, 00.0508f, 00.0454f, 00.0000f, - 00.2318f, 00.1913f, 00.0668f, 00.0299f, 00.0681f, 00.0000f - } - } - ), - new KoinaRetentionTimeQuery( - new[] - { - "TGTNLM[Oxidation (M)]DFLSR" - }, - new[] - { - 0.7566f - } - ), - new KoinaIntensityQuery( - new[] - { - new KoinaIntensityInput("C[unimod:4]SLPRPWALTFSYGR", 0.2500f, 2) - }, - new[] - { - new[] - { - 00.5830f, 00.0000f, 00.0187f, 00.0000f, 00.0000f, 00.0000f, - 00.0216f, 00.0000f, 00.0255f, 00.1427f, 00.0000f, 00.0000f, - 00.0100f, 00.0000f, 00.0913f, 00.2454f, 00.0000f, 00.0000f, - 00.0722f, 00.0000f, 00.1459f, 00.0000f, 00.0000f, 00.0000f, - 00.0171f, 00.0000f, 00.0866f, 00.3487f, 00.0000f, 00.0000f, - 00.0989f, 00.0000f, 00.0557f, 00.0000f, 00.0000f, 00.0000f, - 00.0619f, 00.0000f, 00.0060f, 00.0457f, 00.0000f, 00.0000f, - 00.0854f, 00.0000f, 00.0122f, 00.0412f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.1067f, 00.0027f, 00.0000f, - 00.8993f, 00.0311f, 00.0970f, 00.0420f, 00.0037f, 00.0057f, - 00.0000f, 00.0000f, 00.0963f, 00.0942f, 00.0090f, 00.0000f, - 00.0335f, 00.3927f, 00.1065f, 00.1465f, 00.0252f, 00.0000f, - 00.0000f, 00.0542f, 00.1210f, 00.0452f, 00.0121f, 00.0000f, - 00.0000f, 00.0255f, 00.1290f, 00.2240f, 00.0000f, 00.0000f, - 00.0185f, 00.1537f, 00.2175f, 00.2112f, 00.0137f, 00.0122f, - 00.0794f, 00.1904f, 00.2342f, 00.0000f, 00.0029f, 00.0160f, - 00.0874f, 00.1845f, 00.1943f, 00.0447f, 00.0000f, 00.0230f, - 00.0764f, 00.1500f, 00.2642f, 00.0000f, 00.0096f, 00.0257f, - 00.0827f, 00.1098f, 00.2740f, 00.0000f, 00.0000f, 00.0259f, - 00.1191f, 00.0850f, 00.2120f, 00.0000f, 00.0000f, 00.0217f, - 00.1671f, 00.0806f, 00.2889f, 00.0000f, 00.0062f, 00.0097f, - 00.3111f, 00.0811f, 00.2294f, 00.0581f, 00.0000f, 00.0000f, - 00.2472f, 00.0516f, 00.1269f, 00.0201f, 00.0000f, 00.0000f, - 00.6905f, 00.2069f, 00.0647f, 00.3026f, 00.0000f, 00.0000f, - 00.6349f, 00.1877f, 00.0557f, 00.0407f, 00.0000f, 00.0000f, - 00.4823f, 00.2164f, 00.1307f, 00.2852f, 00.0000f, 00.0000f, - 00.4782f, 00.2001f, 00.2834f, 00.0783f, 00.0000f, 00.0000f, - 00.3489f, 00.1800f, 00.3470f, 00.3913f, 00.0000f, 00.0000f, - 00.0000f, 00.2600f, 00.7002f, 00.4010f, 00.0523f, 00.0916f - } - } - ), - new KoinaRetentionTimeQuery( - new[] - { - "C[unimod:4]SLPRPWALTFSYGR" - }, - new[] - { - 1.2758f - } - ), - new KoinaIntensityQuery( - new[] - { - new KoinaIntensityInput("C[unimod:4]SLPRPWALTFSYGR", 0.2600f, 2) - }, - new[] - { - new[] - { - 00.6077f, 00.0000f, 00.0163f, 00.0000f, 00.0000f, 00.0000f, - 00.0282f, 00.0000f, 00.0251f, 00.1801f, 00.0000f, 00.0000f, - 00.0023f, 00.0000f, 00.0929f, 00.2566f, 00.0000f, 00.0000f, - 00.0642f, 00.0000f, 00.1468f, 00.0000f, 00.0000f, 00.0000f, - 00.0213f, 00.0000f, 00.0849f, 00.3547f, 00.0000f, 00.0000f, - 00.1086f, 00.0000f, 00.0533f, 00.0000f, 00.0000f, 00.0000f, - 00.0755f, 00.0000f, 00.0014f, 00.0504f, 00.0000f, 00.0000f, - 00.0947f, 00.0000f, 00.0093f, 00.0543f, 00.0000f, 00.0000f, - 00.0000f, 00.0000f, 00.0000f, 00.1208f, 00.0077f, 00.0000f, - 00.9942f, 00.0502f, 00.1003f, 00.0557f, 00.0081f, 00.0067f, - 00.0000f, 00.0000f, 00.0990f, 00.1075f, 00.0130f, 00.0000f, - 00.0253f, 00.4108f, 00.1019f, 00.1607f, 00.0286f, 00.0000f, - 00.0000f, 00.0622f, 00.1116f, 00.0532f, 00.0138f, 00.0000f, - 00.0000f, 00.0402f, 00.1134f, 00.2283f, 00.0000f, 00.0000f, - 00.0154f, 00.1772f, 00.1996f, 00.2125f, 00.0100f, 00.0117f, - 00.0785f, 00.2127f, 00.2158f, 00.0006f, 00.0044f, 00.0158f, - 00.0783f, 00.2012f, 00.1818f, 00.0557f, 00.0000f, 00.0215f, - 00.0720f, 00.1674f, 00.2520f, 00.0000f, 00.0147f, 00.0235f, - 00.0798f, 00.1226f, 00.2660f, 00.0000f, 00.0000f, 00.0244f, - 00.1087f, 00.1016f, 00.2075f, 00.0000f, 00.0000f, 00.0199f, - 00.1639f, 00.0968f, 00.2731f, 00.0000f, 00.0066f, 00.0101f, - 00.2803f, 00.0915f, 00.2380f, 00.0440f, 00.0056f, 00.0000f, - 00.2060f, 00.0636f, 00.1335f, 00.0208f, 00.0000f, 00.0000f, - 00.6317f, 00.1940f, 00.0560f, 00.2867f, 00.0000f, 00.0000f, - 00.5311f, 00.1840f, 00.0545f, 00.0437f, 00.0063f, 00.0000f, - 00.4538f, 00.1946f, 00.1143f, 00.2327f, 00.0000f, 00.0000f, - 00.4345f, 00.1891f, 00.2464f, 00.0482f, 00.0000f, 00.0000f, - 00.2881f, 00.1920f, 00.3373f, 00.3290f, 00.0000f, 00.0000f, - 00.0000f, 00.2325f, 00.6021f, 00.3237f, 00.0539f, 00.0899f - } - } - ), - new KoinaRetentionTimeQuery( - new[] - { - "C[unimod:4]SLPRPWALTFSYGR" - }, - new[] - { - 1.2758f - } - ), - new KoinaIntensityQuery( - new[] - { - new KoinaIntensityInput("LGGEEVSVAC[unimod:4]K", 0.2600f, 2) - }, - new[] - { - new[] - { - 00.1251f, 00.0000f, 00.0043f, 00.0000f, 00.0000f, 00.0000f, - 00.3919f, 00.0000f, 00.0081f, 00.5678f, 00.0000f, 00.0000f, - 00.6387f, 00.0000f, 00.0170f, 00.2681f, 00.0000f, 00.0000f, - 00.2780f, 00.0000f, 00.0000f, 00.3714f, 00.0000f, 00.0000f, - 01.4825f, 00.0000f, 00.0000f, 00.2861f, 00.0000f, 00.0000f, - 00.9143f, 00.0000f, 00.0000f, 00.2506f, 00.0000f, 00.0000f, - 00.9412f, 00.0207f, 00.0000f, 00.0631f, 00.0000f, 00.0016f, - 00.2121f, 00.0249f, 00.0322f, 00.0672f, 00.0000f, 00.0064f, - 00.7087f, 00.1002f, 00.0000f, 00.0493f, 00.0000f, 00.0034f, - 01.2851f, 00.0702f, 00.0000f, 00.0154f, 00.0000f, 00.0000f, - 00.4713f, 00.1194f, 00.0488f, 00.0249f, 00.0000f, 00.0092f, - 00.2944f, 00.1485f, 00.0343f, 00.0098f, 00.0115f, 00.0048f, - 00.2835f, 00.1719f, 00.0000f, 00.0000f, 00.0218f, 00.0046f, - 00.3277f, 00.2056f, 00.0112f, 00.0289f, 00.0504f, 00.0116f, - 00.2851f, 00.1710f, 00.0530f, 00.0423f, 00.0535f, 00.0198f, - 00.2407f, 00.1144f, 00.0925f, 00.0047f, 00.0313f, 00.0204f, - 00.2282f, 00.0823f, 00.1356f, 00.0000f, 00.0139f, 00.0160f, - 00.2526f, 00.0680f, 00.1460f, 00.0226f, 00.0050f, 00.0116f, - 00.2505f, 00.0617f, 00.1643f, 00.0503f, 00.0008f, 00.0053f, - 00.3049f, 00.0503f, 00.2027f, 00.0604f, 00.0023f, 00.0000f, - 00.3331f, 00.0329f, 00.1310f, 00.0609f, 00.0000f, 00.0000f, - 00.2463f, 00.0246f, 00.0763f, 00.0581f, 00.0000f, 00.0000f, - 00.1110f, 00.0331f, 00.0916f, 00.0680f, 00.0014f, 00.0000f, - 00.0000f, 00.0515f, 00.1539f, 00.0628f, 00.0054f, 00.0000f, - 00.0000f, 00.0525f, 00.1722f, 00.0830f, 00.0141f, 00.0000f, - 00.0310f, 00.0342f, 00.0964f, 00.0791f, 00.0278f, 00.0000f, - 00.0968f, 00.0092f, 00.0070f, 00.0640f, 00.0552f, 00.0000f, - 00.1475f, 00.0467f, 00.0000f, 00.0760f, 00.0941f, 00.0000f, - 00.2460f, 00.1242f, 00.0535f, 00.0311f, 00.1119f, 00.0020f - } - } - ), - new KoinaRetentionTimeQuery( - new[] - { - "LGGEEVSVAC[unimod:4]K" - }, - new[] - { - -0.6807f - } - ), - new KoinaIntensityQuery( - new[] - { - new KoinaIntensityInput("LGGEEVSVAC[unimod:4]K", 0.2700f, 2) - }, - new[] - { - new[] - { - 00.1257f, 00.0000f, 00.0040f, 00.0000f, 00.0000f, 00.0000f, - 00.4191f, 00.0000f, 00.0073f, 00.5884f, 00.0000f, 00.0000f, - 00.6531f, 00.0000f, 00.0098f, 00.2856f, 00.0000f, 00.0000f, - 00.2813f, 00.0000f, 00.0000f, 00.3593f, 00.0006f, 00.0000f, - 01.4928f, 00.0000f, 00.0000f, 00.2630f, 00.0000f, 00.0000f, - 00.9262f, 00.0000f, 00.0000f, 00.2153f, 00.0000f, 00.0000f, - 00.9594f, 00.0205f, 00.0000f, 00.0554f, 00.0000f, 00.0025f, - 00.2173f, 00.0236f, 00.0273f, 00.0542f, 00.0004f, 00.0073f, - 00.7281f, 00.0748f, 00.0000f, 00.0408f, 00.0000f, 00.0045f, - 01.3693f, 00.0454f, 00.0000f, 00.0110f, 00.0000f, 00.0000f, - 00.4869f, 00.0866f, 00.0452f, 00.0149f, 00.0000f, 00.0112f, - 00.2978f, 00.1205f, 00.0374f, 00.0007f, 00.0114f, 00.0043f, - 00.2843f, 00.1562f, 00.0000f, 00.0000f, 00.0230f, 00.0039f, - 00.3312f, 00.1967f, 00.0053f, 00.0182f, 00.0529f, 00.0108f, - 00.2922f, 00.1684f, 00.0471f, 00.0369f, 00.0575f, 00.0199f, - 00.2502f, 00.1118f, 00.0844f, 00.0009f, 00.0358f, 00.0200f, - 00.2318f, 00.0811f, 00.1231f, 00.0000f, 00.0167f, 00.0149f, - 00.2592f, 00.0672f, 00.1409f, 00.0199f, 00.0074f, 00.0095f, - 00.2575f, 00.0607f, 00.1522f, 00.0512f, 00.0010f, 00.0020f, - 00.3074f, 00.0502f, 00.1832f, 00.0602f, 00.0023f, 00.0000f, - 00.3356f, 00.0325f, 00.1174f, 00.0607f, 00.0004f, 00.0000f, - 00.2306f, 00.0220f, 00.0745f, 00.0575f, 00.0009f, 00.0000f, - 00.1107f, 00.0299f, 00.0832f, 00.0720f, 00.0026f, 00.0000f, - 00.0000f, 00.0517f, 00.1511f, 00.0661f, 00.0070f, 00.0000f, - 00.0000f, 00.0568f, 00.1755f, 00.0837f, 00.0156f, 00.0000f, - 00.0447f, 00.0326f, 00.0909f, 00.0771f, 00.0302f, 00.0000f, - 00.1165f, 00.0061f, 00.0013f, 00.0627f, 00.0578f, 00.0000f, - 00.1699f, 00.0498f, 00.0000f, 00.0737f, 00.0959f, 00.0000f, - 00.2736f, 00.1198f, 00.0496f, 00.0285f, 00.1074f, 00.0031f - } - } - ), - new KoinaRetentionTimeQuery( - new[] - { - "LGGEEVSVAC[unimod:4]K" - }, - new[] - { - -0.6807f - } - ), - new KoinaIntensityQuery( - new[] - { - new KoinaIntensityInput("GSYNLQDLLAQAK", 0.2700f, 2) - }, - new[] - { - new[] - { - 00.2222f, 00.0000f, 00.0216f, 00.0000f, 00.0000f, 00.0000f, - 00.5488f, 00.0000f, 00.0027f, 00.0341f, 00.0000f, 00.0000f, - 00.4643f, 00.0000f, 00.0232f, 00.1653f, 00.0000f, 00.0000f, - 01.1210f, 00.0000f, 00.0000f, 00.3590f, 00.0000f, 00.0000f, - 00.5599f, 00.0000f, 00.0000f, 00.5036f, 00.0000f, 00.0000f, - 00.4345f, 00.0000f, 00.0000f, 00.1177f, 00.0000f, 00.0000f, - 01.3181f, 00.0000f, 00.0000f, 00.0715f, 00.0000f, 00.0000f, - 01.8204f, 00.0102f, 00.0000f, 00.0909f, 00.0000f, 00.0000f, - 00.8764f, 00.0263f, 00.0000f, 00.0836f, 00.0000f, 00.0000f, - 00.6053f, 00.0485f, 00.0000f, 00.0459f, 00.0000f, 00.0064f, - 00.0243f, 00.2193f, 00.0622f, 00.0340f, 00.0000f, 00.0061f, - 00.0000f, 00.0069f, 00.0051f, 00.0152f, 00.0000f, 00.0112f, - 00.0490f, 00.0543f, 00.0754f, 00.0400f, 00.0178f, 00.0210f, - 00.1673f, 00.0810f, 00.0217f, 00.0780f, 00.0346f, 00.0200f, - 00.2067f, 00.1737f, 00.0457f, 00.0269f, 00.0413f, 00.0290f, - 00.2043f, 00.1116f, 00.0755f, 00.0375f, 00.0511f, 00.0418f, - 00.1739f, 00.0911f, 00.1149f, 00.0216f, 00.0317f, 00.0423f, - 00.1691f, 00.0842f, 00.1352f, 00.0175f, 00.0103f, 00.0340f, - 00.1944f, 00.0627f, 00.1495f, 00.0497f, 00.0069f, 00.0216f, - 00.2423f, 00.0545f, 00.1611f, 00.0761f, 00.0164f, 00.0110f, - 00.2670f, 00.0438f, 00.1386f, 00.0760f, 00.0335f, 00.0091f, - 00.2238f, 00.0296f, 00.0874f, 00.0568f, 00.0331f, 00.0119f, - 00.1468f, 00.0211f, 00.0795f, 00.0205f, 00.0136f, 00.0150f, - 00.0388f, 00.0236f, 00.1051f, 00.0298f, 00.0000f, 00.0123f, - 00.0000f, 00.0271f, 00.1415f, 00.0373f, 00.0000f, 00.0032f, - 00.0000f, 00.0224f, 00.1853f, 00.0452f, 00.0129f, 00.0000f, - 00.0000f, 00.0172f, 00.1179f, 00.0478f, 00.0271f, 00.0000f, - 00.0422f, 00.0475f, 00.0781f, 00.0536f, 00.0420f, 00.0000f, - 00.1369f, 00.0929f, 00.0299f, 00.0000f, 00.0621f, 00.0000f - } - } - ), - new KoinaRetentionTimeQuery( - new[] - { - "GSYNLQDLLAQAK" - }, - new[] - { - 1.2877f - } - ), - new KoinaIntensityQuery( - new[] - { - new KoinaIntensityInput("GSYNLQDLLAQAK", 0.2800f, 2) - }, - new[] - { - new[] - { - 00.2228f, 00.0000f, 00.0218f, 00.0000f, 00.0000f, 00.0000f, - 00.5515f, 00.0000f, 00.0027f, 00.0427f, 00.0000f, 00.0000f, - 00.4695f, 00.0000f, 00.0186f, 00.1676f, 00.0000f, 00.0000f, - 01.1469f, 00.0000f, 00.0000f, 00.3616f, 00.0000f, 00.0000f, - 00.5819f, 00.0000f, 00.0000f, 00.4666f, 00.0000f, 00.0000f, - 00.4595f, 00.0000f, 00.0000f, 00.1023f, 00.0000f, 00.0000f, - 01.3380f, 00.0000f, 00.0000f, 00.0642f, 00.0000f, 00.0000f, - 01.8074f, 00.0090f, 00.0000f, 00.0799f, 00.0000f, 00.0000f, - 00.8862f, 00.0218f, 00.0000f, 00.0657f, 00.0000f, 00.0000f, - 00.6142f, 00.0319f, 00.0000f, 00.0345f, 00.0000f, 00.0073f, - 00.0243f, 00.1586f, 00.0551f, 00.0246f, 00.0000f, 00.0071f, - 00.0000f, 00.0000f, 00.0009f, 00.0087f, 00.0000f, 00.0115f, - 00.0472f, 00.0417f, 00.0674f, 00.0319f, 00.0162f, 00.0205f, - 00.1676f, 00.0688f, 00.0183f, 00.0716f, 00.0345f, 00.0179f, - 00.2081f, 00.1642f, 00.0417f, 00.0271f, 00.0428f, 00.0284f, - 00.2109f, 00.1084f, 00.0723f, 00.0368f, 00.0521f, 00.0401f, - 00.1776f, 00.0887f, 00.1105f, 00.0217f, 00.0332f, 00.0401f, - 00.1745f, 00.0828f, 00.1301f, 00.0163f, 00.0119f, 00.0290f, - 00.2024f, 00.0627f, 00.1475f, 00.0512f, 00.0091f, 00.0157f, - 00.2487f, 00.0551f, 00.1604f, 00.0742f, 00.0203f, 00.0054f, - 00.2699f, 00.0420f, 00.1315f, 00.0733f, 00.0382f, 00.0037f, - 00.2188f, 00.0266f, 00.0818f, 00.0544f, 00.0367f, 00.0073f, - 00.1405f, 00.0179f, 00.0791f, 00.0179f, 00.0151f, 00.0103f, - 00.0345f, 00.0184f, 00.0999f, 00.0311f, 00.0000f, 00.0073f, - 00.0000f, 00.0251f, 00.1322f, 00.0427f, 00.0000f, 00.0000f, - 00.0000f, 00.0172f, 00.1711f, 00.0487f, 00.0127f, 00.0000f, - 00.0000f, 00.0109f, 00.0951f, 00.0506f, 00.0269f, 00.0000f, - 00.0603f, 00.0367f, 00.0602f, 00.0552f, 00.0433f, 00.0000f, - 00.1520f, 00.0739f, 00.0162f, 00.0000f, 00.0571f, 00.0000f - } - } - ), - new KoinaRetentionTimeQuery( - new[] - { - "GSYNLQDLLAQAK" - }, - new[] - { - 1.2877f - } - ), - new KoinaIntensityQuery( - new[] - { - new KoinaIntensityInput("GSYNLQDLLAQAK", 0.2800f, 2) - }, - new[] - { - new[] - { - 00.2228f, 00.0000f, 00.0218f, 00.0000f, 00.0000f, 00.0000f, - 00.5515f, 00.0000f, 00.0027f, 00.0427f, 00.0000f, 00.0000f, - 00.4695f, 00.0000f, 00.0186f, 00.1676f, 00.0000f, 00.0000f, - 01.1469f, 00.0000f, 00.0000f, 00.3616f, 00.0000f, 00.0000f, - 00.5819f, 00.0000f, 00.0000f, 00.4666f, 00.0000f, 00.0000f, - 00.4595f, 00.0000f, 00.0000f, 00.1023f, 00.0000f, 00.0000f, - 01.3380f, 00.0000f, 00.0000f, 00.0642f, 00.0000f, 00.0000f, - 01.8074f, 00.0090f, 00.0000f, 00.0799f, 00.0000f, 00.0000f, - 00.8862f, 00.0218f, 00.0000f, 00.0657f, 00.0000f, 00.0000f, - 00.6142f, 00.0319f, 00.0000f, 00.0345f, 00.0000f, 00.0073f, - 00.0243f, 00.1586f, 00.0551f, 00.0246f, 00.0000f, 00.0071f, - 00.0000f, 00.0000f, 00.0009f, 00.0087f, 00.0000f, 00.0115f, - 00.0472f, 00.0417f, 00.0674f, 00.0319f, 00.0162f, 00.0205f, - 00.1676f, 00.0688f, 00.0183f, 00.0716f, 00.0345f, 00.0179f, - 00.2081f, 00.1642f, 00.0417f, 00.0271f, 00.0428f, 00.0284f, - 00.2109f, 00.1084f, 00.0723f, 00.0368f, 00.0521f, 00.0401f, - 00.1776f, 00.0887f, 00.1105f, 00.0217f, 00.0332f, 00.0401f, - 00.1745f, 00.0828f, 00.1301f, 00.0163f, 00.0119f, 00.0290f, - 00.2024f, 00.0627f, 00.1475f, 00.0512f, 00.0091f, 00.0157f, - 00.2487f, 00.0551f, 00.1604f, 00.0742f, 00.0203f, 00.0054f, - 00.2699f, 00.0420f, 00.1315f, 00.0733f, 00.0382f, 00.0037f, - 00.2188f, 00.0266f, 00.0818f, 00.0544f, 00.0367f, 00.0073f, - 00.1405f, 00.0179f, 00.0791f, 00.0179f, 00.0151f, 00.0103f, - 00.0345f, 00.0184f, 00.0999f, 00.0311f, 00.0000f, 00.0073f, - 00.0000f, 00.0251f, 00.1322f, 00.0427f, 00.0000f, 00.0000f, - 00.0000f, 00.0172f, 00.1711f, 00.0487f, 00.0127f, 00.0000f, - 00.0000f, 00.0109f, 00.0951f, 00.0506f, 00.0269f, 00.0000f, - 00.0603f, 00.0367f, 00.0602f, 00.0552f, 00.0433f, 00.0000f, - 00.1520f, 00.0739f, 00.0162f, 00.0000f, 00.0571f, 00.0000f - } - } - ), - new KoinaRetentionTimeQuery( - new[] - { - "GSYNLQDLLAQAK" - }, - new[] - { - 1.2877f - } - ), - new KoinaIntensityQuery( - new[] - { - new KoinaIntensityInput("GSYNLQDLLAQAK", 0.2900f, 2) - }, - new[] - { - new[] - { - 00.2425f, 00.0000f, 00.0244f, 00.0000f, 00.0000f, 00.0000f, - 00.5506f, 00.0000f, 00.0000f, 00.0501f, 00.0000f, 00.0000f, - 00.4761f, 00.0000f, 00.0034f, 00.1620f, 00.0000f, 00.0000f, - 01.1821f, 00.0000f, 00.0000f, 00.3413f, 00.0010f, 00.0000f, - 00.6041f, 00.0000f, 00.0000f, 00.3995f, 00.0000f, 00.0000f, - 00.4869f, 00.0000f, 00.0000f, 00.0820f, 00.0000f, 00.0000f, - 01.3484f, 00.0000f, 00.0000f, 00.0521f, 00.0000f, 00.0000f, - 01.7696f, 00.0056f, 00.0000f, 00.0635f, 00.0000f, 00.0000f, - 00.8861f, 00.0151f, 00.0000f, 00.0471f, 00.0000f, 00.0000f, - 00.6096f, 00.0155f, 00.0000f, 00.0212f, 00.0000f, 00.0076f, - 00.0139f, 00.0977f, 00.0420f, 00.0113f, 00.0000f, 00.0075f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0107f, - 00.0443f, 00.0260f, 00.0651f, 00.0187f, 00.0148f, 00.0170f, - 00.1673f, 00.0518f, 00.0199f, 00.0648f, 00.0349f, 00.0151f, - 00.2039f, 00.1476f, 00.0527f, 00.0219f, 00.0460f, 00.0256f, - 00.2123f, 00.1012f, 00.0861f, 00.0289f, 00.0541f, 00.0351f, - 00.1822f, 00.0853f, 00.1262f, 00.0104f, 00.0340f, 00.0354f, - 00.1777f, 00.0755f, 00.1392f, 00.0065f, 00.0111f, 00.0245f, - 00.1950f, 00.0527f, 00.1436f, 00.0538f, 00.0058f, 00.0135f, - 00.2195f, 00.0447f, 00.1400f, 00.0653f, 00.0140f, 00.0080f, - 00.2346f, 00.0343f, 00.1001f, 00.0442f, 00.0228f, 00.0076f, - 00.2198f, 00.0215f, 00.0511f, 00.0421f, 00.0146f, 00.0074f, - 00.1670f, 00.0123f, 00.0429f, 00.0392f, 00.0013f, 00.0014f, - 00.0415f, 00.0110f, 00.0821f, 00.0434f, 00.0000f, 00.0000f, - 00.0000f, 00.0058f, 00.1566f, 00.0584f, 00.0000f, 00.0000f, - 00.0000f, 00.0147f, 00.1425f, 00.0630f, 00.0096f, 00.0000f, - 00.0000f, 00.0155f, 00.0551f, 00.0675f, 00.0239f, 00.0000f, - 00.0799f, 00.0405f, 00.0424f, 00.0578f, 00.0304f, 00.0000f, - 00.1844f, 00.1147f, 00.0701f, 00.0419f, 00.0582f, 00.0000f - } - } - ), - new KoinaRetentionTimeQuery( - new[] - { - "GSYNLQDLLAQAK" - }, - new[] - { - 1.2877f - } - ), - new KoinaIntensityQuery( - new[] - { - new KoinaIntensityInput("TGTNLM[Oxidation (M)]DFLSR", 0.2900f, 2) - }, - new[] - { - new[] - { - 00.2269f, 00.0000f, 00.0046f, 00.0000f, 00.0000f, 00.0000f, - 00.6578f, 00.0000f, 00.0000f, 00.4145f, 00.0000f, 00.0000f, - 00.4566f, 00.0000f, 00.0000f, 00.3164f, 00.0000f, 00.0000f, - 00.5774f, 00.0000f, 00.0000f, 00.2119f, 00.0013f, 00.0011f, - 01.1391f, 00.0000f, 00.0000f, 00.2512f, 00.0000f, 00.0000f, - 01.6669f, 00.0455f, 00.0000f, 00.0628f, 00.0000f, 00.0000f, - 00.8299f, 00.2046f, 00.0000f, 00.0413f, 00.0000f, 00.0000f, - 00.6934f, 00.1543f, 00.0000f, 00.0290f, 00.0000f, 00.0043f, - 00.1387f, 00.2774f, 00.0474f, 00.0338f, 00.0000f, 00.0054f, - 00.0662f, 00.0772f, 00.0148f, 00.0049f, 00.0000f, 00.0065f, - 00.1031f, 00.0994f, 00.0692f, 00.0136f, 00.0000f, 00.0105f, - 00.1448f, 00.1055f, 00.0177f, 00.0208f, 00.0099f, 00.0143f, - 00.1587f, 00.1164f, 00.0214f, 00.0000f, 00.0246f, 00.0241f, - 00.1986f, 00.1404f, 00.0440f, 00.0191f, 00.0363f, 00.0257f, - 00.1739f, 00.1290f, 00.0881f, 00.0138f, 00.0335f, 00.0213f, - 00.1731f, 00.0997f, 00.1354f, 00.0000f, 00.0217f, 00.0186f, - 00.1958f, 00.0767f, 00.1508f, 00.0100f, 00.0127f, 00.0149f, - 00.2294f, 00.0644f, 00.1495f, 00.0401f, 00.0076f, 00.0140f, - 00.2461f, 00.0578f, 00.1503f, 00.0760f, 00.0076f, 00.0125f, - 00.2324f, 00.0499f, 00.1589f, 00.0662f, 00.0022f, 00.0118f, - 00.1869f, 00.0404f, 00.1765f, 00.0441f, 00.0000f, 00.0121f, - 00.0000f, 00.0449f, 00.2472f, 00.0473f, 00.0000f, 00.0139f, - 00.0000f, 00.0608f, 00.2718f, 00.0706f, 00.0022f, 00.0000f, - 00.0000f, 00.0653f, 00.2894f, 00.0878f, 00.0212f, 00.0000f, - 00.0000f, 00.0729f, 00.1649f, 00.0890f, 00.0250f, 00.0000f, - 00.1639f, 00.0871f, 00.0104f, 00.0644f, 00.0330f, 00.0000f, - 00.2272f, 00.0854f, 00.0020f, 00.0522f, 00.0407f, 00.0000f, - 00.2954f, 00.1215f, 00.0146f, 00.0508f, 00.0454f, 00.0000f, - 00.2318f, 00.1913f, 00.0668f, 00.0299f, 00.0681f, 00.0000f - } - } - ), - new KoinaRetentionTimeQuery( - new[] - { - "TGTNLM[Oxidation (M)]DFLSR" - }, - new[] - { - 0.7566f - } - ), - new KoinaIntensityQuery( - new[] - { - new KoinaIntensityInput("TGTNLM[Oxidation (M)]DFLSR", 0.3000f, 2) - }, - new[] - { - new[] - { - 00.2502f, 00.0000f, 00.0027f, 00.0000f, 00.0000f, 00.0000f, - 00.6503f, 00.0000f, 00.0000f, 00.4567f, 00.0000f, 00.0000f, - 00.4638f, 00.0000f, 00.0000f, 00.3079f, 00.0000f, 00.0000f, - 00.6495f, 00.0000f, 00.0000f, 00.1937f, 00.0016f, 00.0008f, - 01.1949f, 00.0000f, 00.0000f, 00.2121f, 00.0000f, 00.0000f, - 01.6636f, 00.0489f, 00.0000f, 00.0475f, 00.0000f, 00.0000f, - 00.8235f, 00.1841f, 00.0000f, 00.0309f, 00.0000f, 00.0000f, - 00.6736f, 00.1113f, 00.0000f, 00.0175f, 00.0000f, 00.0050f, - 00.1290f, 00.1707f, 00.0327f, 00.0197f, 00.0000f, 00.0055f, - 00.0628f, 00.0470f, 00.0039f, 00.0000f, 00.0000f, 00.0060f, - 00.0908f, 00.0638f, 00.0609f, 00.0002f, 00.0000f, 00.0094f, - 00.1393f, 00.0824f, 00.0175f, 00.0156f, 00.0089f, 00.0121f, - 00.1505f, 00.0996f, 00.0216f, 00.0000f, 00.0246f, 00.0197f, - 00.1855f, 00.1174f, 00.0501f, 00.0195f, 00.0366f, 00.0207f, - 00.1662f, 00.1099f, 00.0932f, 00.0100f, 00.0314f, 00.0160f, - 00.1682f, 00.0874f, 00.1256f, 00.0000f, 00.0173f, 00.0140f, - 00.1880f, 00.0667f, 00.1273f, 00.0097f, 00.0080f, 00.0112f, - 00.2094f, 00.0578f, 00.1208f, 00.0395f, 00.0042f, 00.0113f, - 00.2274f, 00.0553f, 00.1163f, 00.0555f, 00.0044f, 00.0109f, - 00.2371f, 00.0467f, 00.1136f, 00.0526f, 00.0000f, 00.0097f, - 00.1991f, 00.0314f, 00.1402f, 00.0540f, 00.0000f, 00.0073f, - 00.0001f, 00.0396f, 00.2207f, 00.0643f, 00.0000f, 00.0067f, - 00.0000f, 00.0518f, 00.2796f, 00.0797f, 00.0046f, 00.0000f, - 00.0000f, 00.0632f, 00.2993f, 00.0938f, 00.0219f, 00.0000f, - 00.0000f, 00.0799f, 00.1694f, 00.0879f, 00.0253f, 00.0000f, - 00.1787f, 00.0833f, 00.0192f, 00.0677f, 00.0326f, 00.0000f, - 00.2551f, 00.0865f, 00.0021f, 00.0541f, 00.0355f, 00.0000f, - 00.3283f, 00.1276f, 00.0176f, 00.0509f, 00.0359f, 00.0000f, - 00.2612f, 00.2054f, 00.0724f, 00.0290f, 00.0614f, 00.0000f - } - } - ), - new KoinaRetentionTimeQuery( - new[] - { - "TGTNLM[Oxidation (M)]DFLSR" - }, - new[] - { - 0.7566f - } - ), - new KoinaIntensityQuery( - new[] - { - new KoinaIntensityInput("LGGEEVSVAC[unimod:4]K", 0.2700f, 2) - }, - new[] - { - new[] - { - 00.1257f, 00.0000f, 00.0040f, 00.0000f, 00.0000f, 00.0000f, - 00.4191f, 00.0000f, 00.0073f, 00.5884f, 00.0000f, 00.0000f, - 00.6531f, 00.0000f, 00.0098f, 00.2856f, 00.0000f, 00.0000f, - 00.2813f, 00.0000f, 00.0000f, 00.3593f, 00.0006f, 00.0000f, - 01.4928f, 00.0000f, 00.0000f, 00.2630f, 00.0000f, 00.0000f, - 00.9262f, 00.0000f, 00.0000f, 00.2153f, 00.0000f, 00.0000f, - 00.9594f, 00.0205f, 00.0000f, 00.0554f, 00.0000f, 00.0025f, - 00.2173f, 00.0236f, 00.0273f, 00.0542f, 00.0004f, 00.0073f, - 00.7281f, 00.0748f, 00.0000f, 00.0408f, 00.0000f, 00.0045f, - 01.3693f, 00.0454f, 00.0000f, 00.0110f, 00.0000f, 00.0000f, - 00.4869f, 00.0866f, 00.0452f, 00.0149f, 00.0000f, 00.0112f, - 00.2978f, 00.1205f, 00.0374f, 00.0007f, 00.0114f, 00.0043f, - 00.2843f, 00.1562f, 00.0000f, 00.0000f, 00.0230f, 00.0039f, - 00.3312f, 00.1967f, 00.0053f, 00.0182f, 00.0529f, 00.0108f, - 00.2922f, 00.1684f, 00.0471f, 00.0369f, 00.0575f, 00.0199f, - 00.2502f, 00.1118f, 00.0844f, 00.0009f, 00.0358f, 00.0200f, - 00.2318f, 00.0811f, 00.1231f, 00.0000f, 00.0167f, 00.0149f, - 00.2592f, 00.0672f, 00.1409f, 00.0199f, 00.0074f, 00.0095f, - 00.2575f, 00.0607f, 00.1522f, 00.0512f, 00.0010f, 00.0020f, - 00.3074f, 00.0502f, 00.1832f, 00.0602f, 00.0023f, 00.0000f, - 00.3356f, 00.0325f, 00.1174f, 00.0607f, 00.0004f, 00.0000f, - 00.2306f, 00.0220f, 00.0745f, 00.0575f, 00.0009f, 00.0000f, - 00.1107f, 00.0299f, 00.0832f, 00.0720f, 00.0026f, 00.0000f, - 00.0000f, 00.0517f, 00.1511f, 00.0661f, 00.0070f, 00.0000f, - 00.0000f, 00.0568f, 00.1755f, 00.0837f, 00.0156f, 00.0000f, - 00.0447f, 00.0326f, 00.0909f, 00.0771f, 00.0302f, 00.0000f, - 00.1165f, 00.0061f, 00.0013f, 00.0627f, 00.0578f, 00.0000f, - 00.1699f, 00.0498f, 00.0000f, 00.0737f, 00.0959f, 00.0000f, - 00.2736f, 00.1198f, 00.0496f, 00.0285f, 00.1074f, 00.0031f - } - } - ), - new KoinaRetentionTimeQuery( - new[] - { - "LGGEEVSVAC[unimod:4]K" - }, - new[] - { - -0.6807f - } - ), - new KoinaIntensityQuery( - new[] - { - new KoinaIntensityInput("GSYNLQDLLAQAK", 0.2700f, 2) - }, - new[] - { - new[] - { - 00.2222f, 00.0000f, 00.0216f, 00.0000f, 00.0000f, 00.0000f, - 00.5488f, 00.0000f, 00.0027f, 00.0341f, 00.0000f, 00.0000f, - 00.4643f, 00.0000f, 00.0232f, 00.1653f, 00.0000f, 00.0000f, - 01.1210f, 00.0000f, 00.0000f, 00.3590f, 00.0000f, 00.0000f, - 00.5599f, 00.0000f, 00.0000f, 00.5036f, 00.0000f, 00.0000f, - 00.4345f, 00.0000f, 00.0000f, 00.1177f, 00.0000f, 00.0000f, - 01.3181f, 00.0000f, 00.0000f, 00.0715f, 00.0000f, 00.0000f, - 01.8204f, 00.0102f, 00.0000f, 00.0909f, 00.0000f, 00.0000f, - 00.8764f, 00.0263f, 00.0000f, 00.0836f, 00.0000f, 00.0000f, - 00.6053f, 00.0485f, 00.0000f, 00.0459f, 00.0000f, 00.0064f, - 00.0243f, 00.2193f, 00.0622f, 00.0340f, 00.0000f, 00.0061f, - 00.0000f, 00.0069f, 00.0051f, 00.0152f, 00.0000f, 00.0112f, - 00.0490f, 00.0543f, 00.0754f, 00.0400f, 00.0178f, 00.0210f, - 00.1673f, 00.0810f, 00.0217f, 00.0780f, 00.0346f, 00.0200f, - 00.2067f, 00.1737f, 00.0457f, 00.0269f, 00.0413f, 00.0290f, - 00.2043f, 00.1116f, 00.0755f, 00.0375f, 00.0511f, 00.0418f, - 00.1739f, 00.0911f, 00.1149f, 00.0216f, 00.0317f, 00.0423f, - 00.1691f, 00.0842f, 00.1352f, 00.0175f, 00.0103f, 00.0340f, - 00.1944f, 00.0627f, 00.1495f, 00.0497f, 00.0069f, 00.0216f, - 00.2423f, 00.0545f, 00.1611f, 00.0761f, 00.0164f, 00.0110f, - 00.2670f, 00.0438f, 00.1386f, 00.0760f, 00.0335f, 00.0091f, - 00.2238f, 00.0296f, 00.0874f, 00.0568f, 00.0331f, 00.0119f, - 00.1468f, 00.0211f, 00.0795f, 00.0205f, 00.0136f, 00.0150f, - 00.0388f, 00.0236f, 00.1051f, 00.0298f, 00.0000f, 00.0123f, - 00.0000f, 00.0271f, 00.1415f, 00.0373f, 00.0000f, 00.0032f, - 00.0000f, 00.0224f, 00.1853f, 00.0452f, 00.0129f, 00.0000f, - 00.0000f, 00.0172f, 00.1179f, 00.0478f, 00.0271f, 00.0000f, - 00.0422f, 00.0475f, 00.0781f, 00.0536f, 00.0420f, 00.0000f, - 00.1369f, 00.0929f, 00.0299f, 00.0000f, 00.0621f, 00.0000f - } - } - ), - new KoinaRetentionTimeQuery( - new[] - { - "GSYNLQDLLAQAK" - }, - new[] - { - 1.2877f - } - ), - new KoinaIntensityQuery( - new[] - { - new KoinaIntensityInput("C[unimod:4]SLPRPWALTFSYGR", 0.3200f, 2), - new KoinaIntensityInput("LGGEEVSVAC[unimod:4]K", 0.3200f, 2), - new KoinaIntensityInput("GSYNLQDLLAQAK", 0.3200f, 2), - new KoinaIntensityInput("GSYNLQDLLAQAK", 0.3200f, 2), - new KoinaIntensityInput("TGTNLM[Oxidation (M)]DFLSR", 0.3200f, 2) - }, - new[] - { - new[] - { - 00.7693f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.1020f, 00.0000f, 00.0090f, 00.4997f, 00.0000f, 00.0000f, - 00.0556f, 00.0000f, 00.0549f, 00.3378f, 00.0000f, 00.0000f, - 00.1009f, 00.0000f, 00.1008f, 00.0000f, 00.0004f, 00.0000f, - 00.0885f, 00.0000f, 00.0436f, 00.3426f, 00.0000f, 00.0000f, - 00.2034f, 00.0000f, 00.0212f, 00.0000f, 00.0000f, 00.0000f, - 00.1814f, 00.0000f, 00.0000f, 00.0821f, 00.0000f, 00.0000f, - 00.2119f, 00.0000f, 00.0000f, 00.1435f, 00.0113f, 00.0000f, - 00.0862f, 00.0000f, 00.0000f, 00.2099f, 00.0414f, 00.0000f, - 01.7147f, 00.2190f, 00.0027f, 00.1447f, 00.0236f, 00.0075f, - 00.0000f, 00.0000f, 00.0780f, 00.1778f, 00.0218f, 00.0000f, - 00.0114f, 00.4782f, 00.0535f, 00.1846f, 00.0312f, 00.0000f, - 00.0000f, 00.0937f, 00.0359f, 00.0794f, 00.0122f, 00.0000f, - 00.0000f, 00.1213f, 00.0784f, 00.1914f, 00.0000f, 00.0000f, - 00.0017f, 00.3020f, 00.1341f, 00.1483f, 00.0000f, 00.0032f, - 00.0595f, 00.3042f, 00.1278f, 00.0351f, 00.0081f, 00.0129f, - 00.0601f, 00.2680f, 00.1377f, 00.0652f, 00.0127f, 00.0134f, - 00.0723f, 00.2237f, 00.1794f, 00.0000f, 00.0274f, 00.0156f, - 00.0836f, 00.1878f, 00.1665f, 00.0000f, 00.0074f, 00.0149f, - 00.0941f, 00.2145f, 00.1571f, 00.0000f, 00.0033f, 00.0153f, - 00.1386f, 00.2001f, 00.1420f, 00.0359f, 00.0137f, 00.0142f, - 00.1511f, 00.1840f, 00.1707f, 00.0134f, 00.0249f, 00.0049f, - 00.1372f, 00.1294f, 00.0953f, 00.0548f, 00.0014f, 00.0000f, - 00.3145f, 00.1097f, 00.0365f, 00.1139f, 00.0026f, 00.0000f, - 00.1599f, 00.1147f, 00.0707f, 00.1238f, 00.0035f, 00.0000f, - 00.1871f, 00.0748f, 00.1060f, 00.0688f, 00.0026f, 00.0000f, - 00.1763f, 00.0352f, 00.1424f, 00.1103f, 00.0051f, 00.0000f, - 00.1365f, 00.0398f, 00.1800f, 00.1396f, 00.0198f, 00.0000f, - 00.3545f, 00.0992f, 00.1789f, 00.0327f, 00.0613f, 00.0315f - }, - new[] - { - 00.1742f, 00.0000f, 00.0022f, 00.0000f, 00.0000f, 00.0017f, - 00.7137f, 00.0000f, 00.0000f, 00.6339f, 00.0000f, 00.0000f, - 00.8939f, 00.0000f, 00.0000f, 00.3521f, 00.0000f, 00.0000f, - 00.3327f, 00.0000f, 00.0000f, 00.2713f, 00.0036f, 00.0000f, - 01.4494f, 00.0000f, 00.0000f, 00.1542f, 00.0012f, 00.0000f, - 00.8251f, 00.0000f, 00.0000f, 00.0875f, 00.0007f, 00.0025f, - 00.8254f, 00.0036f, 00.0000f, 00.0245f, 00.0000f, 00.0034f, - 00.1811f, 00.0046f, 00.0053f, 00.0163f, 00.0011f, 00.0080f, - 00.5881f, 00.0000f, 00.0000f, 00.0091f, 00.0000f, 00.0072f, - 01.3841f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.4738f, 00.0000f, 00.0536f, 00.0000f, 00.0000f, 00.0138f, - 00.2712f, 00.0026f, 00.0532f, 00.0000f, 00.0107f, 00.0000f, - 00.2341f, 00.0322f, 00.0000f, 00.0000f, 00.0256f, 00.0000f, - 00.2938f, 00.0736f, 00.0000f, 00.0094f, 00.0593f, 00.0073f, - 00.2993f, 00.1078f, 00.0492f, 00.0237f, 00.0707f, 00.0125f, - 00.2788f, 00.1034f, 00.0769f, 00.0000f, 00.0530f, 00.0120f, - 00.2424f, 00.0774f, 00.0907f, 00.0000f, 00.0242f, 00.0061f, - 00.2278f, 00.0511f, 00.0946f, 00.0053f, 00.0073f, 00.0000f, - 00.2539f, 00.0474f, 00.0972f, 00.0409f, 00.0003f, 00.0000f, - 00.2961f, 00.0472f, 00.0949f, 00.0628f, 00.0000f, 00.0000f, - 00.3059f, 00.0293f, 00.0546f, 00.0779f, 00.0000f, 00.0000f, - 00.2242f, 00.0165f, 00.0473f, 00.0808f, 00.0000f, 00.0000f, - 00.1659f, 00.0235f, 00.0649f, 00.0889f, 00.0018f, 00.0000f, - 00.0740f, 00.0400f, 00.1185f, 00.0768f, 00.0093f, 00.0000f, - 00.0578f, 00.0270f, 00.1062f, 00.0837f, 00.0190f, 00.0000f, - 00.0885f, 00.0141f, 00.0279f, 00.0654f, 00.0285f, 00.0000f, - 00.1623f, 00.0210f, 00.0000f, 00.0625f, 00.0417f, 00.0000f, - 00.2765f, 00.0664f, 00.0000f, 00.0751f, 00.0613f, 00.0000f, - 00.2680f, 00.1137f, 00.0901f, 00.0218f, 00.0685f, 00.0181f - }, - new[] - { - 00.2843f, 00.0000f, 00.0172f, 00.0000f, 00.0000f, 00.0000f, - 00.6344f, 00.0000f, 00.0000f, 00.0870f, 00.0000f, 00.0000f, - 00.5449f, 00.0000f, 00.0000f, 00.1720f, 00.0000f, 00.0000f, - 01.3518f, 00.0000f, 00.0000f, 00.3277f, 00.0018f, 00.0000f, - 00.6832f, 00.0000f, 00.0000f, 00.2992f, 00.0000f, 00.0000f, - 00.5292f, 00.0000f, 00.0000f, 00.0542f, 00.0000f, 00.0004f, - 01.2025f, 00.0000f, 00.0000f, 00.0366f, 00.0000f, 00.0000f, - 01.3791f, 00.0005f, 00.0000f, 00.0388f, 00.0009f, 00.0000f, - 00.7098f, 00.0018f, 00.0000f, 00.0208f, 00.0000f, 00.0009f, - 00.4708f, 00.0000f, 00.0000f, 00.0057f, 00.0000f, 00.0085f, - 00.0162f, 00.0087f, 00.0172f, 00.0000f, 00.0000f, 00.0084f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0100f, - 00.0513f, 00.0063f, 00.0436f, 00.0131f, 00.0113f, 00.0116f, - 00.1722f, 00.0289f, 00.0119f, 00.0564f, 00.0342f, 00.0151f, - 00.1688f, 00.1169f, 00.0458f, 00.0238f, 00.0460f, 00.0289f, - 00.1801f, 00.0847f, 00.0770f, 00.0244f, 00.0520f, 00.0346f, - 00.1643f, 00.0952f, 00.1254f, 00.0000f, 00.0358f, 00.0356f, - 00.1528f, 00.0780f, 00.1413f, 00.0000f, 00.0180f, 00.0246f, - 00.1774f, 00.0661f, 00.1542f, 00.0270f, 00.0108f, 00.0130f, - 00.2090f, 00.0574f, 00.1479f, 00.0259f, 00.0159f, 00.0065f, - 00.2128f, 00.0534f, 00.0986f, 00.0482f, 00.0238f, 00.0007f, - 00.2017f, 00.0311f, 00.0415f, 00.0413f, 00.0195f, 00.0000f, - 00.1650f, 00.0209f, 00.0329f, 00.0554f, 00.0102f, 00.0000f, - 00.0751f, 00.0146f, 00.0495f, 00.0551f, 00.0052f, 00.0000f, - 00.0000f, 00.0126f, 00.0822f, 00.0759f, 00.0110f, 00.0000f, - 00.0043f, 00.0160f, 00.0353f, 00.0721f, 00.0196f, 00.0000f, - 00.0472f, 00.0087f, 00.0000f, 00.0561f, 00.0270f, 00.0000f, - 00.1578f, 00.0208f, 00.0000f, 00.0493f, 00.0273f, 00.0000f, - 00.2125f, 00.1077f, 00.0414f, 00.0028f, 00.0503f, 00.0000f - }, - new[] - { - 00.2843f, 00.0000f, 00.0172f, 00.0000f, 00.0000f, 00.0000f, - 00.6344f, 00.0000f, 00.0000f, 00.0870f, 00.0000f, 00.0000f, - 00.5449f, 00.0000f, 00.0000f, 00.1720f, 00.0000f, 00.0000f, - 01.3518f, 00.0000f, 00.0000f, 00.3277f, 00.0018f, 00.0000f, - 00.6832f, 00.0000f, 00.0000f, 00.2992f, 00.0000f, 00.0000f, - 00.5292f, 00.0000f, 00.0000f, 00.0542f, 00.0000f, 00.0004f, - 01.2025f, 00.0000f, 00.0000f, 00.0366f, 00.0000f, 00.0000f, - 01.3791f, 00.0005f, 00.0000f, 00.0388f, 00.0009f, 00.0000f, - 00.7098f, 00.0018f, 00.0000f, 00.0208f, 00.0000f, 00.0009f, - 00.4708f, 00.0000f, 00.0000f, 00.0057f, 00.0000f, 00.0085f, - 00.0162f, 00.0087f, 00.0172f, 00.0000f, 00.0000f, 00.0084f, - 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0100f, - 00.0513f, 00.0063f, 00.0436f, 00.0131f, 00.0113f, 00.0116f, - 00.1722f, 00.0289f, 00.0119f, 00.0564f, 00.0342f, 00.0151f, - 00.1688f, 00.1169f, 00.0458f, 00.0238f, 00.0460f, 00.0289f, - 00.1801f, 00.0847f, 00.0770f, 00.0244f, 00.0520f, 00.0346f, - 00.1643f, 00.0952f, 00.1254f, 00.0000f, 00.0358f, 00.0356f, - 00.1528f, 00.0780f, 00.1413f, 00.0000f, 00.0180f, 00.0246f, - 00.1774f, 00.0661f, 00.1542f, 00.0270f, 00.0108f, 00.0130f, - 00.2090f, 00.0574f, 00.1479f, 00.0259f, 00.0159f, 00.0065f, - 00.2128f, 00.0534f, 00.0986f, 00.0482f, 00.0238f, 00.0007f, - 00.2017f, 00.0311f, 00.0415f, 00.0413f, 00.0195f, 00.0000f, - 00.1650f, 00.0209f, 00.0329f, 00.0554f, 00.0102f, 00.0000f, - 00.0751f, 00.0146f, 00.0495f, 00.0551f, 00.0052f, 00.0000f, - 00.0000f, 00.0126f, 00.0822f, 00.0759f, 00.0110f, 00.0000f, - 00.0043f, 00.0160f, 00.0353f, 00.0721f, 00.0196f, 00.0000f, - 00.0472f, 00.0087f, 00.0000f, 00.0561f, 00.0270f, 00.0000f, - 00.1578f, 00.0208f, 00.0000f, 00.0493f, 00.0273f, 00.0000f, - 00.2125f, 00.1077f, 00.0414f, 00.0028f, 00.0503f, 00.0000f - }, - new[] - { - 00.2941f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, 00.0000f, - 00.6894f, 00.0000f, 00.0000f, 00.5591f, 00.0000f, 00.0000f, - 00.5015f, 00.0000f, 00.0000f, 00.3191f, 00.0000f, 00.0000f, - 00.8361f, 00.0000f, 00.0000f, 00.1807f, 00.0022f, 00.0000f, - 01.2666f, 00.0000f, 00.0000f, 00.1699f, 00.0000f, 00.0000f, - 01.5276f, 00.0495f, 00.0000f, 00.0344f, 00.0000f, 00.0000f, - 00.7162f, 00.1543f, 00.0000f, 00.0229f, 00.0000f, 00.0002f, - 00.5583f, 00.0676f, 00.0000f, 00.0098f, 00.0000f, 00.0058f, - 00.1080f, 00.0759f, 00.0165f, 00.0103f, 00.0000f, 00.0057f, - 00.0598f, 00.0207f, 00.0000f, 00.0000f, 00.0000f, 00.0058f, - 00.0744f, 00.0388f, 00.0441f, 00.0000f, 00.0000f, 00.0065f, - 00.1349f, 00.0675f, 00.0147f, 00.0194f, 00.0105f, 00.0083f, - 00.1424f, 00.0960f, 00.0179f, 00.0135f, 00.0280f, 00.0172f, - 00.1726f, 00.1174f, 00.0500f, 00.0211f, 00.0390f, 00.0169f, - 00.1614f, 00.1175f, 00.0950f, 00.0052f, 00.0352f, 00.0126f, - 00.1659f, 00.0997f, 00.1315f, 00.0000f, 00.0224f, 00.0108f, - 00.1840f, 00.0782f, 00.1345f, 00.0028f, 00.0098f, 00.0075f, - 00.2074f, 00.0662f, 00.1272f, 00.0279f, 00.0041f, 00.0072f, - 00.2192f, 00.0609f, 00.1265f, 00.0462f, 00.0006f, 00.0055f, - 00.2184f, 00.0531f, 00.1293f, 00.0463f, 00.0000f, 00.0041f, - 00.1732f, 00.0311f, 00.1561f, 00.0535f, 00.0000f, 00.0033f, - 00.0000f, 00.0353f, 00.2349f, 00.0776f, 00.0000f, 00.0014f, - 00.0000f, 00.0564f, 00.2690f, 00.0821f, 00.0093f, 00.0000f, - 00.0000f, 00.0556f, 00.2677f, 00.0934f, 00.0276f, 00.0000f, - 00.0213f, 00.0662f, 00.1226f, 00.0820f, 00.0284f, 00.0000f, - 00.2070f, 00.0667f, 00.0000f, 00.0531f, 00.0339f, 00.0000f, - 00.2482f, 00.0879f, 00.0000f, 00.0399f, 00.0337f, 00.0000f, - 00.3183f, 00.1215f, 00.0000f, 00.0430f, 00.0312f, 00.0000f, - 00.2822f, 00.2028f, 00.0408f, 00.0179f, 00.0527f, 00.0000f - } - } - ), - new KoinaRetentionTimeQuery( - new[] - { - "C[unimod:4]SLPRPWALTFSYGR", - "LGGEEVSVAC[unimod:4]K", - "GSYNLQDLLAQAK", - "TGTNLM[Oxidation (M)]DFLSR" - }, - new[] - { - 1.2758f, - -0.6807f, - 1.2877f, - 0.7566f - } - ), - }); + private string ExpectedQueriesJsonFilepath => TestContext.GetProjectDirectory("TestFunctional/KoinaSkylineIntegrationTest2.data/koinaQueries.json"); [TestMethod] public void TestKoinaSkylineIntegration() @@ -1403,25 +83,20 @@ protected override void DoTest() Settings.Default.ShowCharge3 = true; KoinaConstants.CACHE_PREV_PREDICTION = false; - using (new FakeKoina(RecordData ? null : QUERIES)) + using (new FakeKoina(RecordData, ExpectedQueriesJsonFilepath)) { - if (RecordData) - Console.WriteLine(@"private static List QUERIES = new List(new KoinaQuery[] {"); - TestKoinaOptions(); TestKoinaSinglePrecursorPredictions(); TestLiveKoinaMirrorPlots(); Settings.Default.Koina = false; // Disable Koina to avoid that last query after building the library TestKoinaLibraryBuild(false); TestInvalidPepSequences(); // Do this at the end, otherwise it messes with the order of nodes - var expected = RecordData ? 0 : QUERIES.Count; - Assert.AreEqual(expected, ((FakeKoinaPredictionClient)KoinaPredictionClient.Current).QueryIndex); + //var expected = RecordData ? 0 : QUERIES.Count; + //Assert.AreEqual(expected, ((FakeKoinaPredictionClient)KoinaPredictionClient.Current).QueryIndex); TestKoinaLibraryBuild(true); } KoinaConstants.CACHE_PREV_PREDICTION = true; - if (RecordData) - Console.WriteLine(@"});"); } public void TestInvalidPepSequences() @@ -1623,16 +298,17 @@ public void TestKoinaLibraryBuild(bool newDocument) } Assert.AreEqual(notSupportedCount, noMatchCount); - if (RecordData) return; + // Get queries and make sure they match the actual spectra - var intensityQuery = QUERIES.ElementAt(client.QueryIndex - 2) as KoinaIntensityQuery; - Assert.IsNotNull(intensityQuery); + Assert.IsTrue(KoinaQuery.TryGetQuery(client.ExpectedQueries, doc.Settings, peptidesRepeat, buildLibrary.NCE, out var intensityQuery)); intensityQuery.AssertMatchesSpectra(peptidesRepeat, spectrumDisplayInfos); - var rtQuery = QUERIES.ElementAt(client.QueryIndex - 1) as KoinaRetentionTimeQuery; - Assert.IsNotNull(rtQuery); + + Assert.IsTrue(KoinaQuery.TryGetQuery(client.ExpectedQueries, doc.Settings, + peptidesRepeat.Select(p => new KoinaRetentionTimeModel.PeptideDocNodeWrapper(p.NodePep)).ToArray(), + out var rtQuery)); rtQuery.AssertMatchesSpectra(spectrumDisplayInfos); } @@ -1738,6 +414,8 @@ public void TestKoinaSinglePrecursorPredictions(FakeKoinaPredictionClient client public void AssertIntensityAndIRTSpectrumCorrect(KoinaIntensityModel.PeptidePrecursorNCE peptidePrecursorNCE, int index) { + var client = (FakeKoinaPredictionClient) KoinaPredictionClient.Current; + // We are interested in the queries just processed index -= 2; @@ -1746,15 +424,16 @@ public void AssertIntensityAndIRTSpectrumCorrect(KoinaIntensityModel.PeptidePrec Assert.IsNotNull(spectrumDisplayInfo); // There need to be at least two queries (ms2, irt) - AssertEx.IsGreaterThanOrEqual(QUERIES.Count - index, 2); + AssertEx.IsGreaterThanOrEqual(client.ExpectedQueries.Count - index, 2); - // Get queries and make sure they match the actual spectra - var intensityQuery = QUERIES.ElementAt(index) as KoinaIntensityQuery; - Assert.IsNotNull(intensityQuery); + Assert.IsTrue(KoinaQuery.TryGetQuery(client.ExpectedQueries, SkylineWindow.Document.Settings, + new[] { peptidePrecursorNCE }, Settings.Default.KoinaNCE, + out var intensityQuery)); intensityQuery.AssertMatchesSpectrum(peptidePrecursorNCE, spectrumDisplayInfo); - var rtQuery = QUERIES.ElementAt(index + 1) as KoinaRetentionTimeQuery; - Assert.IsNotNull(rtQuery); + Assert.IsTrue(KoinaQuery.TryGetQuery(client.ExpectedQueries, SkylineWindow.Document.Settings, + new[] { new KoinaRetentionTimeModel.PeptideDocNodeWrapper(peptidePrecursorNCE.NodePep) }, + out var rtQuery)); rtQuery.AssertMatchesSpectrum(spectrumDisplayInfo); } @@ -1797,479 +476,4 @@ public void TestLiveKoinaMirrorPlots() } } - public interface IRecordable - { - string ToCode(); - } - - public abstract class KoinaQuery : IRecordable - { - public abstract string Model { get; } - public abstract ModelInferResponse Response { get; } - - public abstract void AssertMatchesQuery(ModelInferRequest pr); - public abstract bool MatchesQuery(ModelInferRequest pr); - public abstract string ToCode(); - } - - public class KoinaIntensityInput : IRecordable - { - public KoinaIntensityInput(string modifiedSequence, float normalizedCollisionEnergy, int precursorCharge) - { - ModifiedSequence = modifiedSequence; - NormalizedCollisionEnergy = normalizedCollisionEnergy; - PrecursorCharge = precursorCharge; - } - - public string ModifiedSequence { get; private set; } - public float NormalizedCollisionEnergy { get; private set; } - public int PrecursorCharge { get; private set; } - - public string ToCode() - { - return string.Format("new KoinaIntensityInput(\"{0}\", {1:0.0000}f, {2})", ModifiedSequence, NormalizedCollisionEnergy, - PrecursorCharge); - } - } - - public class KoinaIntensityQuery : KoinaQuery - { - private KoinaIntensityInput[] _inputs; - private float[][] _spectra; - - public KoinaIntensityQuery(KoinaIntensityInput[] inputs, float[][] spectra) - { - _inputs = inputs; - _spectra = spectra; - Assert.AreEqual(_inputs.Length, _spectra.Length); - } - - public static KoinaIntensityQuery FromTensors(ModelInferRequest request, ModelInferResponse response) - { - // Sequences - var seqs = request.Inputs.Single(t => t.Name.Equals(KoinaIntensityModel.KoinaIntensityInput.PEPTIDES_KEY, StringComparison.InvariantCultureIgnoreCase)); - Assert.AreEqual(seqs.Shape.Count, 2); - Assert.AreEqual(seqs.Shape[1], KoinaConstants.PEPTIDE_SEQ_LEN); - var decodedSeqs = KoinaHelpers.DecodeSequences(seqs); - - // CEs - var ces = request.Inputs.Single(t => t.Name.Equals(KoinaIntensityModel.KoinaIntensityInput.COLLISION_ENERGY_KEY, StringComparison.InvariantCultureIgnoreCase)); - Assert.AreEqual(ces.Shape.Count, 2); - Assert.AreEqual(ces.Shape[1], 1); - var decodedCes = ces.Contents.Fp32Contents.ToArray(); - - // Charges - var charges = request.Inputs.Single(t => t.Name.Equals(KoinaIntensityModel.KoinaIntensityInput.PRECURSOR_CHARGE_KEY, StringComparison.InvariantCultureIgnoreCase)); - Assert.AreEqual(charges.Shape.Count, 2); - Assert.AreEqual(charges.Shape[1], KoinaConstants.PRECURSOR_CHARGES); - var decodedCharges = KoinaHelpers.DecodeCharges(charges); - - var inputs = Enumerable.Range(0, decodedSeqs.Length) - .Select(i => new KoinaIntensityInput(decodedSeqs[i], decodedCes[i], decodedCharges[i])).ToArray(); - - var outputsTensor = response.Outputs.Single(t => t.Name.Equals(KoinaIntensityModel.KoinaIntensityOutput.OUTPUT_KEYS[1], StringComparison.InvariantCultureIgnoreCase)); - var outputsFlattened = KoinaHelpers.ReLU(outputsTensor.Contents.Fp32Contents.ToArray()); - - // Reshape and copy - var outputs = new float[inputs.Length][]; - var batch = (KoinaConstants.PEPTIDE_SEQ_LEN - 1) * KoinaConstants.IONS_PER_RESIDUE; - for (int i = 0; i < inputs.Length; ++i) - { - outputs[i] = new float[batch]; - Array.Copy(outputsFlattened, i * batch, outputs[i], 0, batch); - } - - return new KoinaIntensityQuery(inputs, outputs); - } - - public override string ToCode() - { - var inputsCodeArr = _inputs.Select(i => " " + i.ToCode()); - var inputsCode = string.Format("new[] {{\r\n{0}\r\n }}", - string.Join(",\r\n", inputsCodeArr)); - - var spectraCodeArr = _spectra.Select(f => - { - var code = new StringBuilder(); - code.AppendLine(" new[] {"); - for (int i = 0; i < KoinaConstants.PEPTIDE_SEQ_LEN - 1; ++i) - code.AppendLine(" " + string.Join(", ", - f.Skip(i * KoinaConstants.IONS_PER_RESIDUE).Take(KoinaConstants.IONS_PER_RESIDUE) - .Select(fl => string.Format("{0:00.0000}f", fl))) + ","); - code.Remove(code.Length - 3, 3); - code.AppendLine(); - code.Append(" }"); - return code.ToString(); - }); - - var spectraCode = new StringBuilder(); - spectraCode.AppendLine("new[] {"); - spectraCode.Append(string.Join(", ", spectraCodeArr)); - spectraCode.AppendLine(); - spectraCode.Append(" }"); - - return string.Format("new KoinaIntensityQuery(\r\n {0},\r\n {1}\r\n),", inputsCode, spectraCode); - } - - public override ModelInferResponse Response - { - get - { - var pr = new ModelInferResponse(); - pr.ModelName = Model; - - // Construct Tensor - var tp = new ModelInferResponse.Types.InferOutputTensor { Datatype = "BYTES" }; - tp.Name = KoinaIntensityModel.KoinaIntensityOutput.OUTPUT_KEYS[0]; - tp.Shape.Add(_spectra.Length); - tp.Shape.Add((KoinaConstants.PEPTIDE_SEQ_LEN - 1) * KoinaConstants.IONS_PER_RESIDUE); - pr.Outputs.Add(tp); - - tp = new ModelInferResponse.Types.InferOutputTensor { Datatype = "FP32" }; - tp.Name = KoinaIntensityModel.KoinaIntensityOutput.OUTPUT_KEYS[1]; - tp.Shape.Add(_spectra.Length); - tp.Shape.Add((KoinaConstants.PEPTIDE_SEQ_LEN - 1) * KoinaConstants.IONS_PER_RESIDUE) ; - pr.Outputs.Add(tp); - - using var annotationStream = new MemoryStream(); - using var annotationWriter = new BinaryWriter(annotationStream); - foreach (var input in _inputs) - { - int sequenceLength = new ModifiedSequence(input.ModifiedSequence, MassType.Monoisotopic).GetUnmodifiedSequence().Length; - foreach (var ionType in new[] { 'y', 'b' }) - for (int i = 1; i < KoinaConstants.PEPTIDE_SEQ_LEN; ++i) - { - for (int z = 1; z <= KoinaConstants.IONS_PER_RESIDUE / 2; ++z) - { - string annotation = string.Format("{0}{1}+{2}", ionType, i, z); - annotationWriter.Write(annotation.Length); - annotationWriter.Write(annotation.ToCharArray()); - } - } - } - - var spectraFlatten = _spectra.SelectMany(f => f).ToArray(); - - annotationStream.Seek(0, SeekOrigin.Begin); - pr.RawOutputContents.Add(ByteString.FromStream(annotationStream)); - pr.RawOutputContents.Add(ByteString.CopyFrom(PrimitiveArrays.ToBytes(spectraFlatten))); - - return pr; - } - } - - public override string Model => KoinaIntensityModel.Models.First(); - - public override bool MatchesQuery(ModelInferRequest pr) - { - var keys = pr.Inputs.Select(t => t.Name).OrderBy(s => s).ToArray(); - if (Model != pr.ModelName || - pr.Inputs.Count != 3 || - keys[0] != KoinaIntensityModel.KoinaIntensityInput.COLLISION_ENERGY_KEY || - keys[1] != KoinaIntensityModel.KoinaIntensityInput.PEPTIDES_KEY || - keys[2] != KoinaIntensityModel.KoinaIntensityInput.PRECURSOR_CHARGE_KEY) - return false; - - var seqs = pr.Inputs.Single(t => t.Name.Equals(KoinaIntensityModel.KoinaIntensityInput.PEPTIDES_KEY, StringComparison.InvariantCultureIgnoreCase)); - var ces = pr.Inputs.Single(t => t.Name.Equals(KoinaIntensityModel.KoinaIntensityInput.COLLISION_ENERGY_KEY, StringComparison.InvariantCultureIgnoreCase)); - var charges = pr.Inputs.Single(t => t.Name.Equals(KoinaIntensityModel.KoinaIntensityInput.PRECURSOR_CHARGE_KEY, StringComparison.InvariantCultureIgnoreCase)); - return // Sequences - seqs.Shape.Count == 2 && - seqs.Shape[0] == _inputs.Length && - seqs.Shape[1] == 1 && - ArrayUtil.EqualsDeep(_inputs.Select(i => new ModifiedSequence(i.ModifiedSequence, MassType.Monoisotopic)).ToArray(), - KoinaHelpers.DecodeSequences2(seqs)) && - - // CEs - ces.Shape.Count == 2 && - ces.Shape[0] == _inputs.Length && - ces.Shape[1] == 1 && - - // Charges - charges.Shape.Count == 2 && - charges.Shape[0] == _inputs.Length && - charges.Shape[1] == 1; - } - - public override void AssertMatchesQuery(ModelInferRequest pr) - { - Assert.AreEqual(Model, pr.ModelName); - - Assert.AreEqual(pr.Inputs.Count, 3); - var keys = pr.Inputs.Select(t => t.Name).OrderBy(s => s).ToArray(); - Assert.AreEqual(keys[0], KoinaIntensityModel.KoinaIntensityInput.COLLISION_ENERGY_KEY); - Assert.AreEqual(keys[1], KoinaIntensityModel.KoinaIntensityInput.PEPTIDES_KEY); - Assert.AreEqual(keys[2], KoinaIntensityModel.KoinaIntensityInput.PRECURSOR_CHARGE_KEY); - - // Sequences - var seqs = pr.Inputs.Single(t => t.Name.Equals(KoinaIntensityModel.KoinaIntensityInput.PEPTIDES_KEY, StringComparison.InvariantCultureIgnoreCase)); - Assert.AreEqual(seqs.Shape.Count, 2); - Assert.AreEqual(seqs.Shape[0], _inputs.Length); - Assert.AreEqual(seqs.Shape[1], 1); - AssertEx.AreEqualDeep(_inputs.Select(i => new ModifiedSequence(i.ModifiedSequence, MassType.Monoisotopic)).ToArray(), - KoinaHelpers.DecodeSequences2(seqs)); - - // CEs - var ces = pr.Inputs.Single(t => t.Name.Equals(KoinaIntensityModel.KoinaIntensityInput.COLLISION_ENERGY_KEY, StringComparison.InvariantCultureIgnoreCase)); - Assert.AreEqual(ces.Shape.Count, 2); - Assert.AreEqual(ces.Shape[0], _inputs.Length); - Assert.AreEqual(ces.Shape[1], 1); - - // Charges - var charges = pr.Inputs.Single(t => t.Name.Equals(KoinaIntensityModel.KoinaIntensityInput.PRECURSOR_CHARGE_KEY, StringComparison.InvariantCultureIgnoreCase)); - Assert.AreEqual(charges.Shape.Count, 2); - Assert.AreEqual(charges.Shape[0], _inputs.Length); - Assert.AreEqual(charges.Shape[1], 1); - } - - public void AssertMatchesSpectra(KoinaIntensityModel.PeptidePrecursorNCE[] peptidePrecursorNCEs, SpectrumDisplayInfo[] spectrumDisplayInfos) - { - for (int i = 0; i < _inputs.Length; ++i) - if (spectrumDisplayInfos[i] != null) - AssertMatchesSpectrum(peptidePrecursorNCEs[i], _inputs[i], _spectra[i], spectrumDisplayInfos[i]); - } - - public void AssertMatchesSpectrum(KoinaIntensityModel.PeptidePrecursorNCE peptidePrecursorNCE, SpectrumDisplayInfo spectrumDisplayInfo) - { - AssertMatchesSpectrum(peptidePrecursorNCE, _inputs[0], _spectra[0], spectrumDisplayInfo); - } - - public static void AssertMatchesSpectrum(KoinaIntensityModel.PeptidePrecursorNCE peptidePrecursorNCE, KoinaIntensityInput input, float[] spectrum, SpectrumDisplayInfo spectrumDisplayInfo) - { - Assert.IsNotNull(spectrumDisplayInfo); - Assert.AreEqual(spectrumDisplayInfo.Name, "Koina"); - - // Calculate expected number of peaks. 1 peak per residue times the number of possible charges - var residues = FastaSequence.StripModifications(input.ModifiedSequence).Length - 1; - var charges = Math.Min(input.PrecursorCharge, 3); - var ionCount = 2 * residues * charges; - - //Assert.AreEqual(spectrumDisplayInfo.SpectrumPeaksInfo.Peaks.Length, ionCount); - - // Construct a koina output object so that we can construct a spectrum for comparison. - // There really is no easier way to do this without rewriting a lot of code for parsing the - // flattened intensities and adding lots of extra test code inside of Skyline code. - var response = new ModelInferResponse(); - var tensor = new ModelInferResponse.Types.InferOutputTensor(); - tensor.Shape.Add(1); - tensor.Shape.Add(spectrum.Length); - tensor.Contents = new InferTensorContents(); - tensor.Contents.Fp32Contents.AddRange(spectrum); - tensor.Name = KoinaIntensityModel.KoinaIntensityOutput.OUTPUT_KEYS[1]; - response.Outputs.Add(tensor); - - using var annotationStream = new MemoryStream(); - using var annotationWriter = new BinaryWriter(annotationStream); - foreach (var ionType in new[] { 'y', 'b' }) - for (int i = 1; i < KoinaConstants.PEPTIDE_SEQ_LEN; ++i) - { - for (int z = 1; z <= KoinaConstants.IONS_PER_RESIDUE / 2; ++z) - { - string annotation = string.Format("{0}{1}+{2}", ionType, i, z); - annotationWriter.Write(annotation.Length); - annotationWriter.Write(annotation.ToCharArray()); - } - } - annotationStream.Seek(0, SeekOrigin.Begin); - response.RawOutputContents.Add(ByteString.FromStream(annotationStream)); - response.RawOutputContents.Add(ByteString.CopyFrom(PrimitiveArrays.ToBytes(spectrum))); - - var fakeKoinaOutput = new KoinaIntensityModel.KoinaIntensityOutput(response); - var ms2Spectrum = new KoinaMS2Spectrum(Program.MainWindow.Document.Settings, - peptidePrecursorNCE.WithNCE((int) (input.NormalizedCollisionEnergy * 100.0f)), 0, fakeKoinaOutput); - - // Compare the spectra - AssertEx.AreEqualDeep(ms2Spectrum.SpectrumPeaks.Peaks, spectrumDisplayInfo.SpectrumPeaksInfo.Peaks); - } - } - - public class KoinaRetentionTimeQuery : KoinaQuery - { - private string[] _modifiedSequences; - private float[] _iRTs; - - public KoinaRetentionTimeQuery(string[] modifiedSequences, float[] iRTs) - { - _modifiedSequences = modifiedSequences; - _iRTs = iRTs; - } - - public static KoinaRetentionTimeQuery FromTensors(ModelInferRequest request, ModelInferResponse response) - { - // Sequences - var seqs = request.Inputs.Single(t => t.Name.Equals(KoinaRetentionTimeModel.KoinaRTInput.PEPTIDES_KEY, StringComparison.InvariantCultureIgnoreCase)); - Assert.AreEqual(seqs.Shape.Count, 2); - Assert.AreEqual(seqs.Shape[1], KoinaConstants.PEPTIDE_SEQ_LEN); - var decodedSeqs = KoinaHelpers.DecodeSequences(seqs); - - var outputs = response.Outputs.Single(t => t.Name.Equals(KoinaRetentionTimeModel.KoinaRTOutput.OUTPUT_KEY)); - - return new KoinaRetentionTimeQuery(decodedSeqs, outputs.Contents.Fp32Contents.ToArray()); - } - - public override string ToCode() - { - var seqsCode = string.Format("new[] {{\r\n{0}\r\n }}", - string.Join(",\r\n", _modifiedSequences.Select(m => string.Format(" \"{0}\"", m)))); - - var iRTCode = string.Format("new[] {{\r\n{0}\r\n }}", - string.Join(",\r\n", _iRTs.Select(irt => string.Format(" {0:0.0000}f", irt)))); - - return string.Format("new KoinaRetentionTimeQuery(\r\n {0},\r\n {1}\r\n),", seqsCode, iRTCode); - } - - public override bool MatchesQuery(ModelInferRequest pr) - { - if (Model != pr.ModelName || - pr.Inputs.Count != 1 && - pr.Inputs.First().Name != KoinaRetentionTimeModel.KoinaRTInput.PEPTIDES_KEY) - return false; - - var tensor = pr.Inputs.Single(t => t.Name.Equals(KoinaRetentionTimeModel.KoinaRTInput.PEPTIDES_KEY, StringComparison.InvariantCultureIgnoreCase)); - return tensor.Shape.Count == 2 && - tensor.Shape[0] == _modifiedSequences.Length && - tensor.Shape[1] == 1 && - ArrayUtil.EqualsDeep(_modifiedSequences.Select(i => new ModifiedSequence(i, MassType.Monoisotopic)).ToArray(), - KoinaHelpers.DecodeSequences2(pr.Inputs.Single(t => - t.Name.Equals(KoinaRetentionTimeModel.KoinaRTInput.PEPTIDES_KEY)))); - } - - public override void AssertMatchesQuery(ModelInferRequest pr) - { - Assert.AreEqual(Model, pr.ModelName); - Assert.AreEqual(pr.Inputs.Count, 1); - Assert.AreEqual(pr.Inputs.First().Name, KoinaRetentionTimeModel.KoinaRTInput.PEPTIDES_KEY); - var tensor = pr.Inputs.Single(t => t.Name.Equals(KoinaRetentionTimeModel.KoinaRTInput.PEPTIDES_KEY, StringComparison.InvariantCultureIgnoreCase)); - Assert.AreEqual(tensor.Shape.Count, 2); - Assert.AreEqual(tensor.Shape[0], _modifiedSequences.Length); - Assert.AreEqual(tensor.Shape[1], 1); - AssertEx.AreEqualDeep(_modifiedSequences.Select(i => new ModifiedSequence(i, MassType.Monoisotopic)).ToArray(), - KoinaHelpers.DecodeSequences2(pr.Inputs.Single(t => t.Name.Equals(KoinaRetentionTimeModel.KoinaRTInput.PEPTIDES_KEY)))); - } - - public void AssertMatchesSpectra(SpectrumDisplayInfo[] spectrumDisplayInfos) - { - var iRTIndex = 0; - foreach (var info in spectrumDisplayInfos.Where(i => i != null)) - { - if (Equals(info.Precursor.LabelType, IsotopeLabelType.heavy)) - --iRTIndex; // Reuse previous iRT, since we only made a single iRT prediction for heavy and light - - AssertMatchesSpectrum(_iRTs[iRTIndex++], info); - } - } - - public void AssertMatchesSpectrum(SpectrumDisplayInfo spectrumDisplayInfo) - { - AssertMatchesSpectrum(_iRTs[0], spectrumDisplayInfo); - } - - public static void AssertMatchesSpectrum(float iRT, SpectrumDisplayInfo spectrumDisplayInfo) - { - var expected = iRT; - - Assert.AreEqual(expected, spectrumDisplayInfo.RetentionTime); - } - - public override string Model => KoinaRetentionTimeModel.Models.First(); - - public override ModelInferResponse Response - { - get - { - var pr = new ModelInferResponse(); - pr.ModelName = Model; - - // Construct Tensor - var tp = new ModelInferResponse.Types.InferOutputTensor { Datatype = "FP32" }; - tp.Name = KoinaRetentionTimeModel.KoinaRTOutput.OUTPUT_KEY; - //tp.Contents = new InferTensorContents(); - - // Populate with data - //tp.Contents.Fp32Contents.AddRange(_iRTs); - tp.Shape.Add(_iRTs.Length); - pr.Outputs.Add(tp); - - pr.RawOutputContents.Add(ByteString.CopyFrom(PrimitiveArrays.ToBytes(_iRTs))); - - return pr; - } - } - } - - internal class FakeKoina : IDisposable - { - private Channel _channel; - private FakeKoinaPredictionClient _fakeClient; - public FakeKoina(IList expectedQueries) - { - _channel = KoinaConfig.GetKoinaConfig().CreateChannel(); - _fakeClient = new FakeKoinaPredictionClient(_channel, expectedQueries); - Assert.IsNull(KoinaPredictionClient.FakeClient); - KoinaPredictionClient.FakeClient = _fakeClient; - } - - public void Dispose() - { - Assert.AreSame(_fakeClient, KoinaPredictionClient.FakeClient); - KoinaPredictionClient.FakeClient = null; - _channel.ShutdownAsync().Wait(); - } - } - - /// - /// A fake prediction client for logging predictions and returning cached - /// predictions. For logging, it needs to be constructed with a server address. - /// For returning cached predictions, a queue of expected queries should be passed in. - /// - public class FakeKoinaPredictionClient : KoinaPredictionClient - { - private IList _expectedQueries; - - public FakeKoinaPredictionClient(Channel channel, IList expectedQueries) : - base(channel, KoinaConfig.GetKoinaConfig().Server) - { - _expectedQueries = expectedQueries; - } - - public int QueryIndex { get; private set; } - - public override ModelInferResponse ModelInfer(ModelInferRequest request, CallOptions options) - { - // If this is a ping ms2 request, silently return and don't log - if (KoinaSkylineIntegrationTest.PING_QUERY_MS2.MatchesQuery(request)) - return KoinaSkylineIntegrationTest.PING_QUERY_MS2.Response; - - // If this is a ping irt request, silently return and don't log - if (KoinaSkylineIntegrationTest.PING_QUERY_IRT.MatchesQuery(request)) - return KoinaSkylineIntegrationTest.PING_QUERY_IRT.Response; - - // Logging mode - if (_expectedQueries == null) - { - var response = base.ModelInfer(request, options); - LogQuery(request, response); - return response; - } - - // Caching mode - if (QueryIndex == _expectedQueries.Count) - Assert.Fail("Unexpected call to Predict (No more queries). Model: {0}", request.ModelName); - - var nextQuery = _expectedQueries[QueryIndex++]; - nextQuery.AssertMatchesQuery(request); - return nextQuery.Response; - } - - private void LogQuery(ModelInferRequest request, ModelInferResponse response) - { - if (request.ModelName.StartsWith(KoinaIntensityModel.Models.First())) - Console.WriteLine(@" " + KoinaIntensityQuery.FromTensors(request, response).ToCode().Replace("\n", "\n ")); - else if (request.ModelName.StartsWith(KoinaRetentionTimeModel.Models.First())) - Console.WriteLine(@" " + - KoinaRetentionTimeQuery.FromTensors(request, response).ToCode().Replace("\n", "\n ")); - else - Assert.Fail("Unknown model \"{0}\"", request.ModelName); - } - } } \ No newline at end of file diff --git a/pwiz_tools/Skyline/TestFunctional/KoinaSkylineIntegrationTest2.data/koinaQueries.json b/pwiz_tools/Skyline/TestFunctional/KoinaSkylineIntegrationTest2.data/koinaQueries.json new file mode 100644 index 0000000000..566f481bfa --- /dev/null +++ b/pwiz_tools/Skyline/TestFunctional/KoinaSkylineIntegrationTest2.data/koinaQueries.json @@ -0,0 +1,313 @@ +[ + { + "$type": "pwiz.SkylineTestUtil.KoinaIntensityQuery, TestUtil", + "_inputs": [ + { + "ModifiedSequence": "C[+57.021464]SLPRPWALTFSYGR", + "NormalizedCollisionEnergy": 28.0, + "PrecursorCharge": 2 + } + ], + "_ionTables": [ + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,5,5,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.215256453,0.0,0.228158757,0.0,0.2918713,0.0,0.0513633937,0.0,0.06838336,0.0,0.125192776,0.0147417542,0.07126048,0.013154733,0.111307271,0.0159050636,0.155826926,0.0283549726,0.0538907051,0.0134563325,0.192219883,0.0,0.0,0.0565147437,0.0,0.0636906549,0.009271443,0.365992129,-1.0,-1.0,1.0,0.08215531,0.00442880858,0.0,0.09927845,0.0,0.0863859355,0.0,0.108325109,0.0,0.02809785,0.0,0.049986966,0.0,0.00257928,0.0,0.03965876,0.0,0.5330977,0.0]} + } + ] + }, + { + "$type": "pwiz.SkylineTestUtil.KoinaRetentionTimeQuery, TestUtil", + "_modifiedSequences": [ + "C[+57.021464]SLPRPWALTFSYGR" + ], + "_iRTs": [ + 111.71402 + ] + }, + { + "$type": "pwiz.SkylineTestUtil.KoinaIntensityQuery, TestUtil", + "_inputs": [ + { + "ModifiedSequence": "C[+57.021464]SLPRPWALTFSYGR", + "NormalizedCollisionEnergy": 25.0, + "PrecursorCharge": 2 + } + ], + "_ionTables": [ + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,5,5,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.158725679,0.0,0.272878051,0.0,0.3877659,0.0,0.0507703722,0.0,0.04578482,0.0,0.11866685,0.00302397716,0.0466658957,0.00414896,0.104725577,0.00999533851,0.162938118,0.0280251969,0.05030898,0.0134162158,0.249152139,0.0,0.0,0.02833939,0.0,0.060316883,0.0372855477,0.436727583,-1.0,-1.0,1.0,0.03458098,-1.0,-1.0,0.09497928,0.0,0.06880937,0.0,0.109944314,0.0,0.0190362483,0.0,0.08027296,0.0,0.0111330524,0.0,0.0240650773,0.0,0.6483629,0.0]} + } + ] + }, + { + "$type": "pwiz.SkylineTestUtil.KoinaIntensityQuery, TestUtil", + "_inputs": [ + { + "ModifiedSequence": "C[+57.021464]SLPRPWALTFSYGR", + "NormalizedCollisionEnergy": 26.0, + "PrecursorCharge": 2 + } + ], + "_ionTables": [ + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,5,5,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.181100354,0.0,0.258090824,0.0,0.356770784,0.0,0.05071154,0.0,0.05464182,0.0,0.121483162,0.007695691,0.05603465,0.008124748,0.108149558,0.0131173376,0.161625341,0.028801119,0.053524036,0.0139232548,0.2296091,0.0,0.0,0.04046728,0.0,0.06254136,0.025419116,0.413156867,-1.0,-1.0,1.0,0.050476674,-1.0,-1.0,0.09519815,0.0,0.07597466,0.0,0.109216079,0.0,0.0214618724,0.0,0.06455084,0.0,0.00232661469,0.0,0.0284037683,0.0,0.611169636,0.0]} + } + ] + }, + { + "$type": "pwiz.SkylineTestUtil.KoinaIntensityQuery, TestUtil", + "_inputs": [ + { + "ModifiedSequence": "LGGEEVSVAC[+57.021464]K", + "NormalizedCollisionEnergy": 26.0, + "PrecursorCharge": 2 + } + ], + "_ionTables": [ + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.383013755,0.0,0.180849165,0.0,0.25053978,0.0,0.19295159,0.0,0.169004023,0.0,0.0425877981,0.0,0.04530781,0.0,0.03328227,0.0,0.01036379,0.0,0.8667896,0.04736099,0.478008449,0.06758534,0.1430512,0.01680662,0.6348346,0.0139370514,0.616738737,0.0,1.0,0.0,0.187517151,0.0,0.430806965,0.0,0.264375538,0.0,0.08441117,0.0]} + } + ] + }, + { + "$type": "pwiz.SkylineTestUtil.KoinaRetentionTimeQuery, TestUtil", + "_modifiedSequences": [ + "LGGEEVSVAC[+57.021464]K" + ], + "_iRTs": [ + 26.8161163 + ] + }, + { + "$type": "pwiz.SkylineTestUtil.KoinaIntensityQuery, TestUtil", + "_inputs": [ + { + "ModifiedSequence": "LGGEEVSVAC[+57.021464]K", + "NormalizedCollisionEnergy": 27.0, + "PrecursorCharge": 2 + } + ], + "_ionTables": [ + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.3941545,0.0,0.191335425,0.0,0.240662575,0.000423360383,0.176205456,0.0,0.144220144,0.0,0.03710783,0.0,0.0362775847,0.000295383681,0.0273597389,0.0,0.007337593,0.0,0.9172671,0.03037936,0.48771444,0.0500939824,0.145585775,0.0158120766,0.642646849,0.0137347644,0.620424,0.0,1.0,0.0,0.188464969,0.0,0.437456369,0.0,0.280720234,0.0,0.08419626,0.0]} + } + ] + }, + { + "$type": "pwiz.SkylineTestUtil.KoinaIntensityQuery, TestUtil", + "_inputs": [ + { + "ModifiedSequence": "GSYNLQDLLAQAK", + "NormalizedCollisionEnergy": 27.0, + "PrecursorCharge": 2 + } + ], + "_ionTables": [ + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.0187147036,0.0,0.09081021,0.0,0.1972153,0.0,0.276615053,0.0,0.064653635,0.0,0.0392639,0.0,0.0499412157,0.0,0.04590991,0.0,0.0252229832,0.0,0.0186878387,0.0,0.00833421,0.0,0.0,0.00378655549,0.01336927,0.120463073,0.332506239,0.0266432185,0.4814444,0.0144235045,1.0,0.005579977,0.724087954,0.0,0.238704845,0.0,0.30757007,0.0,0.615787148,0.0,0.255061,0.0,0.301460981,0.0,0.122072473,0.0]} + } + ] + }, + { + "$type": "pwiz.SkylineTestUtil.KoinaRetentionTimeQuery, TestUtil", + "_modifiedSequences": [ + "GSYNLQDLLAQAK" + ], + "_iRTs": [ + 112.233292 + ] + }, + { + "$type": "pwiz.SkylineTestUtil.KoinaIntensityQuery, TestUtil", + "_inputs": [ + { + "ModifiedSequence": "GSYNLQDLLAQAK", + "NormalizedCollisionEnergy": 28.0, + "PrecursorCharge": 2 + } + ], + "_ionTables": [ + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.0236353688,0.0,0.09275073,0.0,0.200062066,0.0,0.258168757,0.0,0.05657554,0.0,0.0355029441,0.0,0.0442189574,0.0,0.0363504067,0.0,0.01910699,0.0,0.0136134354,0.0,0.00480635371,0.0,-1.0,-1.0,0.0134206144,0.08772455,0.339812875,0.0176298935,0.4903436,0.0120783662,1.0,0.00497500552,0.7402849,0.0,0.254257053,0.0,0.321981281,0.0,0.634588063,0.0,0.2597494,0.0,0.305125535,0.0,0.123290859,0.0]} + } + ] + }, + { + "$type": "pwiz.SkylineTestUtil.KoinaIntensityQuery, TestUtil", + "_inputs": [ + { + "ModifiedSequence": "TGTNLM[+15.994915]DFLSR", + "NormalizedCollisionEnergy": 28.0, + "PrecursorCharge": 2 + } + ], + "_ionTables": [ + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.232522458,0.0,0.1971048,0.0,0.139753535,0.0005421659,0.1769669,0.0,0.0479926467,0.0,0.0313915461,0.0,0.0243062265,0.0,0.0284426119,0.0,0.008043839,0.0,0.043068774,0.06384528,0.08712151,0.234169111,0.41962254,0.115411662,0.4945997,0.128365532,1.0,0.0254204813,0.662417352,0.0,0.318243355,0.0,0.2765373,0.0,0.411587059,0.0,0.122147225,0.0]} + } + ] + }, + { + "$type": "pwiz.SkylineTestUtil.KoinaRetentionTimeQuery, TestUtil", + "_modifiedSequences": [ + "TGTNLM[+15.994915]DFLSR" + ], + "_iRTs": [ + 89.1878 + ] + }, + { + "$type": "pwiz.SkylineTestUtil.KoinaIntensityQuery, TestUtil", + "_inputs": [ + { + "ModifiedSequence": "TGTNLM[+15.994915]DFLSR", + "NormalizedCollisionEnergy": 29.0, + "PrecursorCharge": 2 + } + ], + "_ionTables": [ + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.248680159,0.0,0.189799771,0.0,0.12713328,0.00075694616,0.150691867,0.0,0.03767928,0.0,0.0247840676,0.0,0.0174023565,0.0,0.020270437,0.0,0.00296617555,0.0,0.03973318,0.0463353246,0.0831858441,0.166428149,0.415956616,0.09253505,0.497862279,0.122726567,1.0,0.0273193549,0.68335855,0.0,0.34639,0.0,0.273891658,0.0,0.394615918,0.0,0.136112854,0.0]} + } + ] + }, + { + "$type": "pwiz.SkylineTestUtil.KoinaIntensityQuery, TestUtil", + "_inputs": [ + { + "ModifiedSequence": "GSYNLQDLLAQAK", + "NormalizedCollisionEnergy": 29.0, + "PrecursorCharge": 2 + } + ], + "_ionTables": [ + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.0283231735,0.0,0.0915209949,0.0,0.19286488,0.000553948747,0.2257574,0.0,0.0463602357,0.0,0.0294235125,0.0,0.03589452,0.0,0.026611926,0.0,0.0119959144,0.0,0.006386526,0.0,-1.0,-1.0,0.00782846753,0.055204168,0.344470829,0.008781086,0.5007326,0.008517957,1.0,0.00318444637,0.761984169,0.0,0.275128424,0.0,0.3414068,0.0,0.668009043,0.0,0.269059032,0.0,0.311149359,0.0,0.137060612,0.0]} + } + ] + }, + { + "$type": "pwiz.SkylineTestUtil.KoinaIntensityQuery, TestUtil", + "_inputs": [ + { + "ModifiedSequence": "TGTNLM[+15.994915]DFLSR", + "NormalizedCollisionEnergy": 30.0, + "PrecursorCharge": 2 + } + ], + "_ionTables": [ + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.274526447,0.0,0.185096756,0.0,0.116445355,0.000970669149,0.127522,0.0,0.0285752285,0.0,0.0185625441,0.0,0.0104894741,0.0,0.0118248966,0.0,0.0377469175,0.0282325651,0.07755491,0.1025915,0.4048909,0.06691883,0.495021284,0.110657863,1.0,0.0293839686,0.71828115,0.0,0.390438527,0.0,0.278778166,0.0,0.390874028,0.0,0.150402427,0.0]} + } + ] + }, + { + "$type": "pwiz.SkylineTestUtil.KoinaIntensityQuery, TestUtil", + "_inputs": [ + { + "ModifiedSequence": "C[+57.021464]SLPRPWALTFSYGR", + "NormalizedCollisionEnergy": 32.0, + "PrecursorCharge": 2 + }, + { + "ModifiedSequence": "LGGEEVSVAC[+57.021464]K", + "NormalizedCollisionEnergy": 32.0, + "PrecursorCharge": 2 + }, + { + "ModifiedSequence": "GSYNLQDLLAQAK", + "NormalizedCollisionEnergy": 32.0, + "PrecursorCharge": 2 + }, + { + "ModifiedSequence": "GSYNLQDLLAQAK", + "NormalizedCollisionEnergy": 32.0, + "PrecursorCharge": 2 + }, + { + "ModifiedSequence": "TGTNLM[+15.994915]DFLSR", + "NormalizedCollisionEnergy": 32.0, + "PrecursorCharge": 2 + } + ], + "_ionTables": [ + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,4,4,5,5,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.2914158,0.0,0.197009861,0.0,0.0,0.000211505117,0.1998333,0.0,0.0478611551,0.0,0.08367839,0.006581832,0.122433245,0.0241309647,0.0844038948,0.0137833133,0.103708453,0.0127045168,0.107674748,0.0182138868,0.0463075079,0.00713799149,0.111616857,0.0,0.0,0.07072025,0.0,0.05464838,0.00663968548,0.278915,-1.0,-1.0,1.0,0.1277028,0.05028305,0.0,0.12357261,0.0,0.105821475,0.0,0.11861641,0.0,0.0516363643,0.0,0.0588322356,0.0,0.0324334651,0.0,0.05948222,0.0,0.4486702,0.0]} + }, + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.437330663,0.0,0.242915466,0.0,0.1871793,0.00248383265,0.106408671,0.0008403032,0.06035451,0.000464452023,0.0169211552,0.0,0.0112484107,0.0007553957,0.00624577561,0.0,0.954906,0.0,0.405768931,0.0,0.124924,0.00318797957,0.569460154,0.00245189853,0.569283366,0.0,1.0,0.0,0.229568824,0.0,0.6167259,0.0,0.4923912,0.0,0.120156981,0.0]} + }, + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.06311367,0.0,0.124723509,0.0,0.237647712,0.00128902891,0.21697776,0.0,0.03927949,0.0,0.026544882,0.0,0.02815728,0.0006707667,0.0150692174,0.0,0.00414846651,0.0,-1.0,-1.0,0.0117263729,0.00628453,0.341375828,0.0,0.5146462,0.00133342983,1.0,0.00038562293,0.8719397,0.0,0.383686841,0.0,0.495410085,0.0,0.9802123,0.0,0.395137876,0.0,0.460006028,0.0,0.206154361,0.0]} + }, + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.06311367,0.0,0.124723509,0.0,0.237647712,0.00128902891,0.21697776,0.0,0.03927949,0.0,0.026544882,0.0,0.02815728,0.0006707667,0.0150692174,0.0,0.00414846651,0.0,-1.0,-1.0,0.0117263729,0.00628453,0.341375828,0.0,0.5146462,0.00133342983,1.0,0.00038562293,0.8719397,0.0,0.383686841,0.0,0.495410085,0.0,0.9802123,0.0,0.395137876,0.0,0.460006028,0.0,0.206154361,0.0]} + }, + { + "_store":{"IonType":["b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","b","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y","y"] + ,"IonNumber":[2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1] + ,"Charge":[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2] + ,"Intensity":[0.365990132,0.0,0.208880663,0.0,0.118288368,0.00145962893,0.111206092,0.0,0.0225222763,0.0,0.0150153907,0.0,0.00641427748,0.0,0.006713259,0.0,0.0391236022,0.01356571,0.07068672,0.0497008823,0.365512371,0.04423793,0.468847126,0.101009704,1.0,0.0324323028,0.8291725,0.0,0.5473286,0.0,0.32829833,0.0,0.451295525,0.0,0.192560449,0.0]} + } + ] + }, + { + "$type": "pwiz.SkylineTestUtil.KoinaRetentionTimeQuery, TestUtil", + "_modifiedSequences": [ + "C[+57.021464]SLPRPWALTFSYGR", + "LGGEEVSVAC[+57.021464]K", + "GSYNLQDLLAQAK", + "TGTNLM[+15.994915]DFLSR" + ], + "_iRTs": [ + 111.71402, + 26.8161163, + 112.233292, + 89.18727 + ] + } +] \ No newline at end of file diff --git a/pwiz_tools/Skyline/TestFunctional/PanoramaClientPublishTest.cs b/pwiz_tools/Skyline/TestFunctional/PanoramaClientPublishTest.cs index bac096344b..c23f050e2b 100644 --- a/pwiz_tools/Skyline/TestFunctional/PanoramaClientPublishTest.cs +++ b/pwiz_tools/Skyline/TestFunctional/PanoramaClientPublishTest.cs @@ -26,7 +26,7 @@ public class PanoramaClientPublishTest : AbstractFunctionalTest [TestMethod] public void TestPublishToPanorama() { - using (new FakeKoina(null)) + using (new FakeKoina(true, null)) { RunFunctionalTest(); } diff --git a/pwiz_tools/Skyline/TestFunctional/TestFunctional.csproj b/pwiz_tools/Skyline/TestFunctional/TestFunctional.csproj index 7cdadb254b..a7655a1e01 100644 --- a/pwiz_tools/Skyline/TestFunctional/TestFunctional.csproj +++ b/pwiz_tools/Skyline/TestFunctional/TestFunctional.csproj @@ -109,15 +109,7 @@ False ..\..\Shared\Lib\DotNetZip\DotNetZip.dll - - False - ..\..\Shared\Lib\Google.Protobuf.dll - - - False - ..\..\Shared\Lib\Grpc.Core.dll - - + False ..\..\Shared\Lib\Grpc.Core.Api.dll @@ -163,6 +155,7 @@ + @@ -199,6 +192,7 @@ + @@ -528,6 +522,7 @@ + @@ -604,6 +599,7 @@ + diff --git a/pwiz_tools/Skyline/TestPerf/DdaTutorialTest.cs b/pwiz_tools/Skyline/TestPerf/DdaTutorialTest.cs index 2df781f98c..699b1de304 100644 --- a/pwiz_tools/Skyline/TestPerf/DdaTutorialTest.cs +++ b/pwiz_tools/Skyline/TestPerf/DdaTutorialTest.cs @@ -99,7 +99,7 @@ protected override void DoTest() protected override Bitmap ProcessCoverShot(Bitmap bmp) { - var graph = Graphics.FromImage(bmp); + var graph = Graphics.FromImage(base.ProcessCoverShot(bmp)); graph.DrawImageUnscaled(_searchLogImage, bmp.Width - _searchLogImage.Width - 10, bmp.Height - _searchLogImage.Height - 30); return bmp; } @@ -237,6 +237,19 @@ private void TestMsFraggerSearch() PauseForScreenShot("Import Peptide Search - DDA Search Settings page"); // Run the search + if (IsCoverShotMode) + { + // Filter time related messages + RunUI(() => importPeptideSearchDlg.SearchControl.ProgressLock = new FilterTimeMessageLock()); + // Resize the form before running or the output will not appear scrolled to the end + RunUI(() => importPeptideSearchDlg.Size = new Size(404, 578)); // minimum height + } + else if (IsPauseForScreenShots) + { + // Stop progress at a specific line number + RunUI(() => importPeptideSearchDlg.SearchControl.ProgressLock = new FixedLineCountLock(31)); + } + SkylineWindow.BeginInvoke(new Action(() => Assert.IsTrue(importPeptideSearchDlg.ClickNextButton()))); // Handle download dialogs if necessary @@ -265,10 +278,14 @@ private void TestMsFraggerSearch() try { - WaitForConditionUI(() => importPeptideSearchDlg.CurrentPage == ImportPeptideSearchDlg.Pages.dda_search_page); - WaitForConditionUI(() => importPeptideSearchDlg.SearchControl.PercentComplete > 25); - PauseForScreenShot("Import Peptide Search - DDA Search Progress page"); + if (IsPauseForScreenShots) + { + WaitForConditionUI(() => importPeptideSearchDlg.SearchControl.IsProgressLocked); + PauseForScreenShot("Import Peptide Search - DDA Search Progress page", null, + bmp => bmp.CleanupBorder().FillProgressBar(importPeptideSearchDlg.SearchControl.ProgressBar)); + RunUI(() => importPeptideSearchDlg.SearchControl.ProgressLock = null); // Unfreeze progress + } // Wait for search to finish WaitForConditionUI(60000 * 60, () => searchSucceeded.HasValue); @@ -281,7 +298,8 @@ private void TestMsFraggerSearch() if (IsCoverShotMode) { - RunUI(() => importPeptideSearchDlg.Width = 404); + // Screenshot at 100% means no animation in the progress bar + ScreenshotManager.ActivateScreenshotForm(importPeptideSearchDlg); _searchLogImage = ScreenshotManager.TakeShot(importPeptideSearchDlg); Assert.IsNotNull(_searchLogImage); } @@ -433,5 +451,28 @@ private void PrepareDocument(string documentFile) doc => doc.ChangeSettings(SrmSettingsList.GetDefault()))); RunUI(() => SkylineWindow.SaveDocument(GetTestPath(documentFile))); } + + internal class FilterTimeMessageLock : SearchControl.IProgressLock + { + public int? LockLineCount => null; + public string FilterMessage(string message) + { + return !message.Contains("time") ? message : null; + } + } + + internal class FixedLineCountLock : SearchControl.IProgressLock + { + public FixedLineCountLock(int lockLineCount) + { + LockLineCount = lockLineCount; + } + + public int? LockLineCount { get; } + public string FilterMessage(string message) + { + return message; + } + } } } diff --git a/pwiz_tools/Skyline/TestPerf/DiaSearchTutorialTest.cs b/pwiz_tools/Skyline/TestPerf/DiaSearchTutorialTest.cs index 5a15394c1c..a5c4efdcb0 100644 --- a/pwiz_tools/Skyline/TestPerf/DiaSearchTutorialTest.cs +++ b/pwiz_tools/Skyline/TestPerf/DiaSearchTutorialTest.cs @@ -206,7 +206,7 @@ protected override void DoTest() protected override Bitmap ProcessCoverShot(Bitmap bmp) { - var graph = Graphics.FromImage(bmp); + var graph = Graphics.FromImage(base.ProcessCoverShot(bmp)); graph.DrawImageUnscaled(_searchLogImage, bmp.Width - _searchLogImage.Width - 10, bmp.Height - _searchLogImage.Height - 30); return bmp; } @@ -413,6 +413,12 @@ private void TestMsFraggerSearch() WaitForConditionUI(() => _analysisValues.FragmentMzTolerance.Unit == importPeptideSearchDlg.SearchSettingsControl.FragmentTolerance.Unit); // Run the search + if (IsCoverShotMode) + { + // Resize the form before running or the output will not appear scrolled to the end + RunUI(() => importPeptideSearchDlg.Size = new Size(404, 578)); // minimum height + } + SkylineWindow.BeginInvoke(new Action(() => Assert.IsTrue(importPeptideSearchDlg.ClickNextButton()))); // SearchEngine changed to MSFragger automatically due to changing to DIA workflow: handle download dialogs if necessary @@ -454,7 +460,6 @@ private void TestMsFraggerSearch() if (IsCoverShotMode) { - RunUI(() => importPeptideSearchDlg.Width = 404); _searchLogImage = ScreenshotManager.TakeShot(importPeptideSearchDlg); Assert.IsNotNull(_searchLogImage); } diff --git a/pwiz_tools/Skyline/TestPerf/DiaSwathQEViews.data/cover.view b/pwiz_tools/Skyline/TestPerf/DiaSwathQEViews.data/cover.view new file mode 100644 index 0000000000..39ab86f541 --- /dev/null +++ b/pwiz_tools/Skyline/TestPerf/DiaSwathQEViews.data/cover.view @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pwiz_tools/Skyline/TestPerf/DiaSwathTutorialTest.cs b/pwiz_tools/Skyline/TestPerf/DiaSwathTutorialTest.cs index 74c2b9afc7..e04ed64acc 100644 --- a/pwiz_tools/Skyline/TestPerf/DiaSwathTutorialTest.cs +++ b/pwiz_tools/Skyline/TestPerf/DiaSwathTutorialTest.cs @@ -479,8 +479,7 @@ public void TestDiaTtofFullSearchTutorialExtra() public void TestDiaQeTutorial() { _testInfo.TestQeData(false); - if (!IsCoverShotMode) - RunTest(); + RunTest(); } [TestMethod, NoParallelTesting(TestExclusionReason.RESOURCE_INTENSIVE)] // Times out on slower VMs @@ -501,8 +500,7 @@ public void TestDiaPasefTutorial() return; _testInfo.TestPasefData(false); - if (!IsCoverShotMode) - RunTest(); + RunTest(); } [TestMethod, @@ -1255,6 +1253,20 @@ protected override void DoTest() changeGroupComparisonSettings = ShowDialog(fcGrid.ShowChangeSettings); RunUI(() => changeGroupComparisonSettings.RadioScopePerPeptide.Checked = true); OkDialog(changeGroupComparisonSettings, changeGroupComparisonSettings.Close); + WaitForConditionUI(() => fcGrid.IsComplete); + WaitForGraphs(); + volcanoPlot = WaitForOpenForm(); // May have changed with RestoreCoverViewOnScreen + WaitForConditionUI(() => !volcanoPlot.UpdatePending); + RunUI(() => + { + var pane = volcanoPlot.GraphControl.GraphPane; + var xScale = pane.XAxis.Scale; + xScale.MaxAuto = xScale.MinAuto = false; + xScale.Min = -4; + xScale.Max = 4; + pane.AxisChange(); + volcanoPlot.GraphControl.Invalidate(); + }); RunUI(() => { @@ -1263,16 +1275,20 @@ protected override void DoTest() fcFloatingWindow.Top = SkylineWindow.Bottom - fcFloatingWindow.Height - 8; }); - if (IsPasef) + if (!IsPasef) + { + FocusDocument(); + TakeCoverShot(); + } + else { ClickChromatogram(SkylineWindow.Document.MeasuredResults.Chromatograms[0].Name, 1.2642E+01, 1.0521E+04); RunUI(() => SkylineWindow.ShowChromatogramLegends(false)); RunUI(() => SkylineWindow.GraphFullScan.SetZoom(true)); WaitForGraphs(); + TakeCoverShot(FindOpenForm()); } - - TakeCoverShot(); } } } diff --git a/pwiz_tools/Skyline/TestPerf/DiaUmpireTutorialTest.cs b/pwiz_tools/Skyline/TestPerf/DiaUmpireTutorialTest.cs index 4f18eff90d..b2c30a115a 100644 --- a/pwiz_tools/Skyline/TestPerf/DiaUmpireTutorialTest.cs +++ b/pwiz_tools/Skyline/TestPerf/DiaUmpireTutorialTest.cs @@ -116,6 +116,15 @@ private string InstrumentTypeName } private string RootName { get; set; } + private Image _searchLogImage; + + protected override Bitmap ProcessCoverShot(Bitmap bmp) + { + var graph = Graphics.FromImage(base.ProcessCoverShot(bmp)); + graph.DrawImageUnscaled(_searchLogImage, bmp.Width - _searchLogImage.Width - 10, bmp.Height - _searchLogImage.Height - 30); + return bmp; + } + [TestMethod, NoParallelTesting(TestExclusionReason.RESOURCE_INTENSIVE), NoUnicodeTesting(TestExclusionReason.MZ5_UNICODE_ISSUES)] public void TestDiaTtofDiaUmpireTutorial() { @@ -585,6 +594,12 @@ protected override void DoTest() }); } + if (IsCoverShotMode) + { + // Resize the form before running or the output will not appear scrolled to the end + RunUI(() => importPeptideSearchDlg.Size = new Size(404, 578)); // minimum height + } + RunUI(() => { // Run the search @@ -608,6 +623,13 @@ protected override void DoTest() File.WriteAllText("SearchControlLog.txt", importPeptideSearchDlg.SearchControl.LogText); } + if (IsCoverShotMode) + { + ScreenshotManager.ActivateScreenshotForm(importPeptideSearchDlg); + _searchLogImage = ScreenshotManager.TakeShot(importPeptideSearchDlg); + Assert.IsNotNull(_searchLogImage); + } + var addIrtDlg = ShowDialog(() => importPeptideSearchDlg.ClickNextButton(), 30 * 60000);//peptidesPerProteinDlg.OkDialog()); RunUI(() => { @@ -834,8 +856,13 @@ protected override void DoTest() }); RestoreCoverViewOnScreen(); - /*fcGrid = WaitForOpenForm(); - fcGridControlFinal = fcGrid.DataboundGridControl; + + // No fold-change with only 2 runs + // CONSIDER: Could remove the fold-change floating window from the cover.view + var fcGrid = WaitForOpenForm(); + RunUI(FindFloatingWindow(fcGrid).Close); + + /* fcGridControlFinal = fcGrid.DataboundGridControl; FilterIrtProtein(fcGridControlFinal); changeGroupComparisonSettings = ShowDialog(fcGrid.ShowChangeSettings); RunUI(() => changeGroupComparisonSettings.RadioScopePerPeptide.Checked = true); diff --git a/pwiz_tools/Skyline/TestPerf/DriftTimePredictorTutorialTest.cs b/pwiz_tools/Skyline/TestPerf/DriftTimePredictorTutorialTest.cs index 8732535872..9cb2fe87be 100644 --- a/pwiz_tools/Skyline/TestPerf/DriftTimePredictorTutorialTest.cs +++ b/pwiz_tools/Skyline/TestPerf/DriftTimePredictorTutorialTest.cs @@ -249,6 +249,8 @@ protected override void DoTest() if (IsCoverShotMode) { + Settings.Default.PeakAreaDotpDisplay = DotProductDisplayOption.none.ToString(); + RunUI(() => { Settings.Default.ChromatogramFontSize = 14; @@ -258,14 +260,20 @@ protected override void DoTest() RestoreCoverViewOnScreen(); - ClickChromatogram(clickTime2, 5.8E+4, PaneKey.PRODUCTS); - var manageResultsDlg = ShowDialog(SkylineWindow.ManageResults); RenameReplicate(manageResultsDlg, 0, "BSA"); RenameReplicate(manageResultsDlg, 1, "Yeast_BSA"); OkDialog(manageResultsDlg, manageResultsDlg.OkDialog); - RunUI(SkylineWindow.FocusDocument); + ClickChromatogram(clickTime2, 5.8E+4, PaneKey.PRODUCTS); + + fullScanGraph = FindOpenForm(); + RunUI(() => + { + var frame = fullScanGraph.Parent.Parent; + frame.Location = new Point(SkylineWindow.Left + 10, SkylineWindow.Bottom - frame.Height - 10); + }); + FocusDocument(); TakeCoverShot(); return; diff --git a/pwiz_tools/Skyline/TestPerf/HiResMetabolomicsTutorial.cs b/pwiz_tools/Skyline/TestPerf/HiResMetabolomicsTutorial.cs index 3b53ee0a4c..29f5fd9353 100644 --- a/pwiz_tools/Skyline/TestPerf/HiResMetabolomicsTutorial.cs +++ b/pwiz_tools/Skyline/TestPerf/HiResMetabolomicsTutorial.cs @@ -40,6 +40,7 @@ using System.Windows.Forms; using pwiz.Skyline.Alerts; using pwiz.Skyline.Controls.Graphs.Calibration; +using pwiz.Skyline.Controls.Graphs; namespace TestPerf // This would be in TestTutorials if it didn't involve a 2GB download { @@ -281,6 +282,7 @@ protected override void DoTest() { RunUI(() => { + Settings.Default.PeakAreaDotpDisplay = DotProductDisplayOption.label.ToString(); Settings.Default.ChromatogramFontSize = 14; Settings.Default.AreaFontSize = 14; SkylineWindow.ChangeTextSize(TreeViewMS.LRG_TEXT_FACTOR); @@ -301,6 +303,7 @@ protected override void DoTest() WaitForGraphs(); RunUI(() => SkylineWindow.SequenceTree.SelectedNode = SkylineWindow.SelectedNode.NextNode); WaitForGraphs(); + FocusDocument(); TakeCoverShot(); return; diff --git a/pwiz_tools/Skyline/TestPerf/SmallMolLibrariesTutorialTest.cs b/pwiz_tools/Skyline/TestPerf/SmallMolLibrariesTutorialTest.cs index f4d702796d..6fd52970f3 100644 --- a/pwiz_tools/Skyline/TestPerf/SmallMolLibrariesTutorialTest.cs +++ b/pwiz_tools/Skyline/TestPerf/SmallMolLibrariesTutorialTest.cs @@ -450,10 +450,18 @@ protected override void DoTest() if (IsCoverShotMode) { + Settings.Default.PeakAreaDotpDisplay = DotProductDisplayOption.none.ToString(); + RestoreCoverViewOnScreen(); // Need to click again to get the full-scan graph populated after restoring view ClickChromatogram(F_A_018, 14.807, 152.0E3, PaneKey.PRECURSORS); - TakeCoverShot(); + var fullScanForm = FindOpenForm(); + RunUI(() => + { + var frame = fullScanForm.Parent.Parent; + frame.Location = new Point(SkylineWindow.Left + 10, SkylineWindow.Bottom - frame.Height - 10); + }); + TakeCoverShot(fullScanForm); return; } diff --git a/pwiz_tools/Skyline/TestRunner/Program.cs b/pwiz_tools/Skyline/TestRunner/Program.cs index 05768625e7..5a1ecd45e7 100644 --- a/pwiz_tools/Skyline/TestRunner/Program.cs +++ b/pwiz_tools/Skyline/TestRunner/Program.cs @@ -1388,6 +1388,12 @@ private static bool RunTestPasses( bool asNightly = offscreen && qualityMode; // While it is possible to run quality off screen from the Quality tab, this is what we use to distinguish for treatment of perf tests bool coverage = commandLineArgs.ArgAsBool("coverage"); + // If pausing for screenshots, make sure this process is allowed to fully activate its forms + if (pauseSeconds != 0) + { + Process.GetCurrentProcess().AllowSetForegroundWindow(); + } + // If running Nightly tests, remove any flagged for exclusion by the NoNightlyTesting custom attribute if (asNightly) { diff --git a/pwiz_tools/Skyline/TestRunnerLib/PInvoke/DwmapiTest.cs b/pwiz_tools/Skyline/TestRunnerLib/PInvoke/DwmapiTest.cs index 62debd5ca5..52d029f655 100644 --- a/pwiz_tools/Skyline/TestRunnerLib/PInvoke/DwmapiTest.cs +++ b/pwiz_tools/Skyline/TestRunnerLib/PInvoke/DwmapiTest.cs @@ -48,18 +48,18 @@ public struct THUMBNAIL_PROPERTIES // ReSharper disable once StringLiteralTypo [DllImport("dwmapi.dll")] - public static extern int RegisterThumbnail(IntPtr dest, IntPtr src, out IntPtr thumb); + public static extern int DwmRegisterThumbnail(IntPtr dest, IntPtr src, out IntPtr thumb); // ReSharper disable once StringLiteralTypo [DllImport("dwmapi.dll")] - public static extern int UnregisterThumbnail(IntPtr thumb); + public static extern int DwmUnregisterThumbnail(IntPtr thumb); // ReSharper disable once StringLiteralTypo [DllImport("dwmapi.dll")] - public static extern int QueryThumbnailSourceSize(IntPtr thumb, out PInvokeCommon.SIZE size); + public static extern int DwmQueryThumbnailSourceSize(IntPtr thumb, out PInvokeCommon.SIZE size); // ReSharper disable once StringLiteralTypo [DllImport("dwmapi.dll")] - public static extern int UpdateThumbnailProperties(IntPtr hThumb, ref THUMBNAIL_PROPERTIES props); + public static extern int DwmUpdateThumbnailProperties(IntPtr hThumb, ref THUMBNAIL_PROPERTIES props); } } \ No newline at end of file diff --git a/pwiz_tools/Skyline/TestRunnerLib/PInvoke/User32Test.cs b/pwiz_tools/Skyline/TestRunnerLib/PInvoke/User32Test.cs index 55c8b36867..4e818ec9b5 100644 --- a/pwiz_tools/Skyline/TestRunnerLib/PInvoke/User32Test.cs +++ b/pwiz_tools/Skyline/TestRunnerLib/PInvoke/User32Test.cs @@ -53,6 +53,9 @@ public enum HandleType [DllImport("user32.dll")] public static extern bool SetForegroundWindow(IntPtr hWnd); + [DllImport("user32.dll")] + public static extern bool AllowSetForegroundWindow(uint dwProcessId); + [DllImport("user32.dll")] public static extern bool SetKeyboardState(byte[] lpKeyState); diff --git a/pwiz_tools/Skyline/TestRunnerLib/PInvoke/User32TestExtensions.cs b/pwiz_tools/Skyline/TestRunnerLib/PInvoke/User32TestExtensions.cs index eef040c0f5..d488d8d26d 100644 --- a/pwiz_tools/Skyline/TestRunnerLib/PInvoke/User32TestExtensions.cs +++ b/pwiz_tools/Skyline/TestRunnerLib/PInvoke/User32TestExtensions.cs @@ -40,5 +40,10 @@ public static void SetForegroundWindow(this Control control) { User32Test.SetForegroundWindow(control.Handle); } + + public static void AllowSetForegroundWindow(this Process process) + { + User32Test.AllowSetForegroundWindow((uint) process.Id); + } } } \ No newline at end of file diff --git a/pwiz_tools/Skyline/TestTutorial/AbsoluteQuantTutorialTest.cs b/pwiz_tools/Skyline/TestTutorial/AbsoluteQuantTutorialTest.cs index eecaa5b9c0..8cd829e81c 100644 --- a/pwiz_tools/Skyline/TestTutorial/AbsoluteQuantTutorialTest.cs +++ b/pwiz_tools/Skyline/TestTutorial/AbsoluteQuantTutorialTest.cs @@ -345,6 +345,7 @@ protected override void DoTest() calibrationFloatingWindow.Left = SkylineWindow.Left + 15; }); + FocusDocument(); TakeCoverShot(); return; } diff --git a/pwiz_tools/Skyline/TestTutorial/AuditLogTutorialTest.cs b/pwiz_tools/Skyline/TestTutorial/AuditLogTutorialTest.cs index 7b7f8521bd..a05cbc5ff9 100644 --- a/pwiz_tools/Skyline/TestTutorial/AuditLogTutorialTest.cs +++ b/pwiz_tools/Skyline/TestTutorial/AuditLogTutorialTest.cs @@ -439,7 +439,7 @@ protected override void DoTest() SkylineWindow.AuditLogForm.DataGridView.AutoResizeColumn(reasonIndex); SkylineWindow.AuditLogForm.DataGridView.AutoResizeColumn(reasonIndex - 1); }); - TakeCoverShot(); + TakeCoverShot(floatingLogWindow); } var customizeDialog = ShowDialog(SkylineWindow.AuditLogForm.NavBar.CustomizeView); diff --git a/pwiz_tools/Skyline/TestTutorial/CustomReportsTutorialTest.cs b/pwiz_tools/Skyline/TestTutorial/CustomReportsTutorialTest.cs index a3dce9fb6d..6a14dd5cb8 100644 --- a/pwiz_tools/Skyline/TestTutorial/CustomReportsTutorialTest.cs +++ b/pwiz_tools/Skyline/TestTutorial/CustomReportsTutorialTest.cs @@ -403,7 +403,7 @@ protected bool DoQualityControlSummaryReports() Assert.IsTrue(viewEditorCover.ChooseColumnsTab.TrySelect(id), "Unable to select {0}", id); } }); - TakeCoverShot(); + TakeCoverShot(viewEditorCover); OkDialog(viewEditorCover, viewEditorCover.CancelButton.PerformClick); return false; diff --git a/pwiz_tools/Skyline/TestTutorial/DiaTutorialTest.cs b/pwiz_tools/Skyline/TestTutorial/DiaTutorialTest.cs index 10cf6f1422..f06d52aa02 100644 --- a/pwiz_tools/Skyline/TestTutorial/DiaTutorialTest.cs +++ b/pwiz_tools/Skyline/TestTutorial/DiaTutorialTest.cs @@ -319,7 +319,6 @@ protected override void DoTest() SkylineWindow.ShowChromatogramLegends(false); SkylineWindow.ShowPeakAreaReplicateComparison(); SkylineWindow.ArrangeGraphs(DisplayGraphsType.Row); - // TODO: Need to explain this in the tutorial // CONSIDER: SkylineWindow should probably have a function for this Settings.Default.PeakAreaDotpDisplay = DotProductDisplayOption.label.ToString(); SkylineWindow.Width = 1250; @@ -452,7 +451,7 @@ protected override void DoTest() isolationSchemeGraph.Left = SkylineWindow.Left; isolationSchemeGraph.Width = 480; }); - TakeCoverShot(); + TakeCoverShot(isolationSchemeGraph); OkDialog(isolationSchemeGraph, isolationSchemeGraph.CloseButton); OkDialog(isolationSchemeForm, isolationSchemeForm.OkDialog); OkDialog(transitionSettingsUI, transitionSettingsUI.OkDialog); diff --git a/pwiz_tools/Skyline/TestTutorial/ExistingExperimentsTutorialTest.cs b/pwiz_tools/Skyline/TestTutorial/ExistingExperimentsTutorialTest.cs index ec4cd392ec..7ddecc5548 100644 --- a/pwiz_tools/Skyline/TestTutorial/ExistingExperimentsTutorialTest.cs +++ b/pwiz_tools/Skyline/TestTutorial/ExistingExperimentsTutorialTest.cs @@ -76,7 +76,7 @@ public void TestExistingExperimentsTutorial() protected override Bitmap ProcessCoverShot(Bitmap bmp) { var excelBmp = new Bitmap(TestContext.GetProjectDirectory(@"TestTutorial\ExistingQuant_excel.png")); - var graph = Graphics.FromImage(bmp); + var graph = Graphics.FromImage(base.ProcessCoverShot(bmp)); graph.DrawImageUnscaled(excelBmp, bmp.Width - excelBmp.Width, bmp.Height - excelBmp.Height); return bmp; } @@ -510,7 +510,6 @@ private void DoStudy7Test() FindNode("SSDLVALSGGHTFGK"); // Not L10N RunUI(NormalizeGraphToHeavy); PauseForPeakAreaGraphScreenShot("Peak Areas graph metafile"); - Settings.Default.PeakAreaDotpDisplay = DotProductDisplayOption.none.ToString(); FindNode((564.7746).ToString(LocalizationHelper.CurrentCulture) + "++"); // ESDTSYVSLK - Not L10N WaitForGraphs(); PauseForPeakAreaGraphScreenShot("Peak Areas graph metafile"); @@ -642,6 +641,11 @@ private void DoStudy7Test() RunUI(() => SkylineWindow.SequenceTree.SelectedNode = SkylineWindow.SelectedNode.Parent); WaitForGraphs(); RunUI(() => SkylineWindow.SequenceTree.SelectedNode = SkylineWindow.SelectedNode.Nodes[0]); + RunUI(() => + { + SkylineWindow.SelectedResultsIndex += 1; + SkylineWindow.SelectedResultsIndex -= 1; + }); RunUI(SkylineWindow.FocusDocument); TakeCoverShot(); return; diff --git a/pwiz_tools/Skyline/TestTutorial/IrtTutorialTest.cs b/pwiz_tools/Skyline/TestTutorial/IrtTutorialTest.cs index 394f5fc0f1..797dd8dac0 100644 --- a/pwiz_tools/Skyline/TestTutorial/IrtTutorialTest.cs +++ b/pwiz_tools/Skyline/TestTutorial/IrtTutorialTest.cs @@ -595,6 +595,8 @@ protected override void DoTest() { RunUI(() => { + SkylineWindow.ShowPlotType(PlotTypeRT.correlation); + Settings.Default.ChromatogramFontSize = 14; Settings.Default.AreaFontSize = 14; SkylineWindow.ChangeTextSize(TreeViewMS.LRG_TEXT_FACTOR); @@ -620,7 +622,7 @@ protected override void DoTest() irtEditor.Top = SkylineWindow.Bottom - irtEditor.Height - SkylineWindow.StatusBarHeight - 5; irtEditor.Left = SkylineWindow.Right - irtEditor.Width - 5; }); - TakeCoverShot(); + TakeCoverShot(irtEditor); OkDialog(irtEditor, irtEditor.CancelDialog); OkDialog(peptideSettingsUI, peptideSettingsUI.CancelDialog); return; diff --git a/pwiz_tools/Skyline/TestTutorial/IrtViews.data/cover.view b/pwiz_tools/Skyline/TestTutorial/IrtViews.data/cover.view new file mode 100644 index 0000000000..42bb2a0b04 --- /dev/null +++ b/pwiz_tools/Skyline/TestTutorial/IrtViews.data/cover.view @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pwiz_tools/Skyline/TestTutorial/IrtViews.data/p05.view b/pwiz_tools/Skyline/TestTutorial/IrtViews.data/p05.view new file mode 100644 index 0000000000..c0ebe1d21d Binary files /dev/null and b/pwiz_tools/Skyline/TestTutorial/IrtViews.data/p05.view differ diff --git a/pwiz_tools/Skyline/TestTutorial/IrtViews.data/p09.view b/pwiz_tools/Skyline/TestTutorial/IrtViews.data/p09.view new file mode 100644 index 0000000000..1d566a279e Binary files /dev/null and b/pwiz_tools/Skyline/TestTutorial/IrtViews.data/p09.view differ diff --git a/pwiz_tools/Skyline/TestTutorial/IrtViews.data/p10.view b/pwiz_tools/Skyline/TestTutorial/IrtViews.data/p10.view new file mode 100644 index 0000000000..a915ee3c25 Binary files /dev/null and b/pwiz_tools/Skyline/TestTutorial/IrtViews.data/p10.view differ diff --git a/pwiz_tools/Skyline/TestTutorial/IrtViews.data/p15.view b/pwiz_tools/Skyline/TestTutorial/IrtViews.data/p15.view new file mode 100644 index 0000000000..f5cce2160f Binary files /dev/null and b/pwiz_tools/Skyline/TestTutorial/IrtViews.data/p15.view differ diff --git a/pwiz_tools/Skyline/TestTutorial/IrtViews.zip b/pwiz_tools/Skyline/TestTutorial/IrtViews.zip deleted file mode 100644 index a5d0989b62..0000000000 Binary files a/pwiz_tools/Skyline/TestTutorial/IrtViews.zip and /dev/null differ diff --git a/pwiz_tools/Skyline/TestTutorial/LibraryExplorerTutorialTest.cs b/pwiz_tools/Skyline/TestTutorial/LibraryExplorerTutorialTest.cs index 890d072534..8761fd1886 100644 --- a/pwiz_tools/Skyline/TestTutorial/LibraryExplorerTutorialTest.cs +++ b/pwiz_tools/Skyline/TestTutorial/LibraryExplorerTutorialTest.cs @@ -195,7 +195,7 @@ protected override void DoTest() { viewLibraryDlg.SetBounds(SkylineWindow.Left, SkylineWindow.Top, SkylineWindow.Width, SkylineWindow.Height); }); - TakeCoverShot(); + TakeCoverShot(viewLibraryDlg); OkDialog(viewLibraryDlg, viewLibraryDlg.CancelDialog); return; diff --git a/pwiz_tools/Skyline/TestTutorial/Ms1FullScanFilteringTutorial.cs b/pwiz_tools/Skyline/TestTutorial/Ms1FullScanFilteringTutorial.cs index b65f421100..de03af87ab 100644 --- a/pwiz_tools/Skyline/TestTutorial/Ms1FullScanFilteringTutorial.cs +++ b/pwiz_tools/Skyline/TestTutorial/Ms1FullScanFilteringTutorial.cs @@ -512,6 +512,7 @@ protected override void DoTest() RunUI(() => SkylineWindow.SequenceTree.SelectedNode = SkylineWindow.SequenceTree.Nodes[0]); WaitForGraphs(); RunUI(() => SkylineWindow.SequenceTree.SelectedNode = selectedNode); + FocusDocument(); TakeCoverShot(); return; } diff --git a/pwiz_tools/Skyline/TestTutorial/PeakPickingTutorialTest.cs b/pwiz_tools/Skyline/TestTutorial/PeakPickingTutorialTest.cs index d6106e81f7..8295d66e89 100644 --- a/pwiz_tools/Skyline/TestTutorial/PeakPickingTutorialTest.cs +++ b/pwiz_tools/Skyline/TestTutorial/PeakPickingTutorialTest.cs @@ -282,6 +282,7 @@ protected override void DoTest() if (IsCoverShotMode) { RestoreCoverViewOnScreen(); + JiggleSelection(); var reintegrateDlgCover = ShowDialog(SkylineWindow.ShowReintegrateDialog); var editModelCover = ShowDialog(reintegrateDlgCover.AddPeakScoringModel); RunUI(() => @@ -291,7 +292,7 @@ protected override void DoTest() editModelCover.PeakScoringModelName = "SRMCourse"; editModelCover.TrainModelClick(); }); - TakeCoverShot(); + TakeCoverShot(editModelCover); OkDialog(editModelCover, editModelCover.CancelDialog); OkDialog(reintegrateDlgCover, reintegrateDlgCover.CancelDialog); diff --git a/pwiz_tools/Skyline/TestTutorial/SmallMolMethodDevCEOptTutorial.cs b/pwiz_tools/Skyline/TestTutorial/SmallMolMethodDevCEOptTutorial.cs index 976a7a9f83..88c20d4476 100644 --- a/pwiz_tools/Skyline/TestTutorial/SmallMolMethodDevCEOptTutorial.cs +++ b/pwiz_tools/Skyline/TestTutorial/SmallMolMethodDevCEOptTutorial.cs @@ -499,6 +499,7 @@ protected override void DoTest() }); RestoreCoverViewOnScreen(); + FocusDocument(); TakeCoverShot(); return; } diff --git a/pwiz_tools/Skyline/TestTutorial/SmallMoleculesQuantificationTutorial.cs b/pwiz_tools/Skyline/TestTutorial/SmallMoleculesQuantificationTutorial.cs index 641f0bcefd..05059bf683 100644 --- a/pwiz_tools/Skyline/TestTutorial/SmallMoleculesQuantificationTutorial.cs +++ b/pwiz_tools/Skyline/TestTutorial/SmallMoleculesQuantificationTutorial.cs @@ -394,7 +394,13 @@ protected override void DoTest() resultsDlg.RemoveReplicates(); resultsDlg.OkDialog(); }); - + var calCurveForm = FindOpenForm(); + RunUI(() => + { + var frame = calCurveForm.Parent.Parent; + frame.Location = new Point(SkylineWindow.Right - frame.Width - 10, + SkylineWindow.Bottom - frame.Height - 10); + }); RunUI(SkylineWindow.FocusDocument); TakeCoverShot(); return; diff --git a/pwiz_tools/Skyline/TestTutorial/SmallMoleculesTutorial.cs b/pwiz_tools/Skyline/TestTutorial/SmallMoleculesTutorial.cs index db04a64920..b64c88d0a1 100644 --- a/pwiz_tools/Skyline/TestTutorial/SmallMoleculesTutorial.cs +++ b/pwiz_tools/Skyline/TestTutorial/SmallMoleculesTutorial.cs @@ -47,7 +47,7 @@ protected override bool UseRawFiles protected override bool ShowStartPage { - get { return !IsPauseForScreenShots; } // So we can point out the UI mode control + get { return !IsRecordingScreenShots; } // So we can point out the UI mode control } [TestMethod, NoParallelTesting(TestExclusionReason.SHARED_DIRECTORY_WRITE)] @@ -87,7 +87,7 @@ private string GetTestPath(string relativePath = null) protected override void DoTest() { - if (IsPauseForScreenShots) + if (!ShowStartPage) RunUI(() => SkylineWindow.SetUIMode(SrmDocument.DOCUMENT_TYPE.small_molecules)); else // old way of doing things { @@ -214,8 +214,13 @@ protected override void DoTest() var importDialog = ShowDialog(SkylineWindow.ShowPasteTransitionListDlg); string impliedLabeled2 = GetCsvFileText(GetTestPath("SMTutorial_TransitionList.csv")); var colDlg = ShowDialog(() => importDialog.TransitionListText = impliedLabeled2); + RunUI(() => + { + colDlg.Height -= 55; + colDlg.Location = new Point(SkylineWindow.Left + 10, SkylineWindow.Bottom - colDlg.Height - 10); + }); - TakeCoverShot(); + TakeCoverShot(colDlg); OkDialog(colDlg, colDlg.CancelDialog); } diff --git a/pwiz_tools/Skyline/TestTutorial/TargetedMSMSTutorialTest.cs b/pwiz_tools/Skyline/TestTutorial/TargetedMSMSTutorialTest.cs index bfe5d0f3f6..fae9cb626e 100644 --- a/pwiz_tools/Skyline/TestTutorial/TargetedMSMSTutorialTest.cs +++ b/pwiz_tools/Skyline/TestTutorial/TargetedMSMSTutorialTest.cs @@ -479,7 +479,7 @@ private void LowResTest() // TODO: figure out why these assertions fail when taking screenshots. During screenshots, the expected / actual values: // expected20TransitionCount = 88. Actual = 87 // expected80TransitionCount = 87. Actual = 86 - if (!IsPauseForScreenShots) + if (!IsRecordingScreenShots) { AssertResult.IsDocumentResultsState(SkylineWindow.Document, shortLowRes20FileName, expectedMoleculeCount, expectedTransitionGroupCount, 0, expected20TransitionCount, 0); diff --git a/pwiz_tools/Skyline/TestTutorial/TargetedMSMSViews.data/cover.view b/pwiz_tools/Skyline/TestTutorial/TargetedMSMSViews.data/cover.view index bce1b999ec..0551ec467e 100644 --- a/pwiz_tools/Skyline/TestTutorial/TargetedMSMSViews.data/cover.view +++ b/pwiz_tools/Skyline/TestTutorial/TargetedMSMSViews.data/cover.view @@ -5,8 +5,8 @@ - - + + diff --git a/pwiz_tools/Skyline/TestUtil/KoinaTestUtil.cs b/pwiz_tools/Skyline/TestUtil/KoinaTestUtil.cs new file mode 100644 index 0000000000..244b65f5f1 --- /dev/null +++ b/pwiz_tools/Skyline/TestUtil/KoinaTestUtil.cs @@ -0,0 +1,930 @@ +/* + * Original author: Matt Chambers , + * MacCoss Lab, Department of Genome Sciences, UW + * + * Copyright 2025 University of Washington - Seattle, WA + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Google.Protobuf; +using Grpc.Core; +using Inference; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Newtonsoft.Json; +using pwiz.Common.Collections; +using pwiz.Skyline.Controls.Graphs; +using pwiz.Skyline.Model.Koina; +using pwiz.Skyline.Model; +using pwiz.Skyline; +using pwiz.Skyline.Model.DocSettings; +using pwiz.Skyline.Model.Koina.Communication; +using pwiz.Skyline.Model.Koina.Config; +using pwiz.Skyline.Model.Koina.Models; +using pwiz.Skyline.Util; +using Newtonsoft.Json.Serialization; +using System.Reflection; +using Newtonsoft.Json.Converters; + +namespace pwiz.SkylineTestUtil +{ + + /// + /// A fake prediction client for logging predictions and returning cached + /// predictions. For logging, it needs to be constructed with a server address. + /// For returning cached predictions, a queue of expected queries should be passed in. + /// + public class FakeKoinaPredictionClient : KoinaPredictionClient + { + public readonly HashSet ExpectedQueries; + private bool _recordData; + + public FakeKoinaPredictionClient(Channel channel, HashSet expectedQueries) : + base(channel, KoinaConfig.GetKoinaConfig().Server) + { + _recordData = expectedQueries == null; + if (!_recordData) + { + ExpectedQueries = expectedQueries; + } + else + { + ExpectedQueries = new HashSet(new InputsEqualityComparer()); + } + } + + public int QueryIndex { get; private set; } + + public override ModelInferResponse ModelInfer(ModelInferRequest request, CallOptions options) + { + // If this is a ping ms2 request, silently return and don't log + if (PING_QUERY_MS2.MatchesQuery(request)) + return PING_QUERY_MS2.Response; + + // If this is a ping irt request, silently return and don't log + if (PING_QUERY_IRT.MatchesQuery(request)) + return PING_QUERY_IRT.Response; + + // Logging mode + if (_recordData) + { + var response = base.ModelInfer(request, options); + LogQuery(request, response); + return response; + } + + // Caching mode + if (!KoinaQuery.TryGetQuery(ExpectedQueries, request, out var nextQuery)) + Assert.Fail("No matching reference query for request: " + request); + nextQuery.AssertMatchesQuery(request); + return nextQuery.Response; + } + + private void LogQuery(ModelInferRequest request, ModelInferResponse response) + { + if (request.ModelName.StartsWith(KoinaIntensityModel.Models.First())) + ExpectedQueries.Add(KoinaIntensityQuery.FromTensors(request, response)); + else if (request.ModelName.StartsWith(KoinaRetentionTimeModel.Models.First())) + ExpectedQueries.Add(KoinaRetentionTimeQuery.FromTensors(request, response)); + else + Assert.Fail("Unknown model \"{0}\"", request.ModelName); + } + + static KoinaQuery PING_QUERY_MS2 = new KoinaIntensityQuery( + new[] + { + new KoinaIntensityInput("PING", 0.3200f, 1) + }, + new[] + { + new IonTable(IonType.z, 4) + } + ); + + static KoinaQuery PING_QUERY_IRT = new KoinaRetentionTimeQuery( + new[] + { + "PING" + }, + new[] { 0.0f }); + + } + + public class FakeKoina : IDisposable + { + private readonly bool _recordData; + private readonly string _expectedQueriesJsonFilepath; + private Channel _channel; + private FakeKoinaPredictionClient _fakeClient; + private int _maxThreads; + + private JsonSerializerSettings JsonSettings = new JsonSerializerSettings + { + Formatting = Formatting.Indented, + TypeNameHandling = TypeNameHandling.Auto, + ContractResolver = new IonTableContractResolver() + }; + + public FakeKoina(bool recordData, string expectedQueriesJsonFilepath) + { + _recordData = recordData; + _expectedQueriesJsonFilepath = expectedQueriesJsonFilepath; + HashSet expectedQueries = null; + + if (!recordData && _expectedQueriesJsonFilepath != null) + { + using var streamReader = new StreamReader(expectedQueriesJsonFilepath); + using var jsonTextReader = new JsonTextReader(streamReader); + expectedQueries = JsonSerializer.Create(JsonSettings).Deserialize>(jsonTextReader); + expectedQueries = new HashSet(expectedQueries, new InputsEqualityComparer()); + } + + _channel = KoinaConfig.GetKoinaConfig().CreateChannel(); + _fakeClient = new FakeKoinaPredictionClient(_channel, expectedQueries); + Assert.IsNull(KoinaPredictionClient.FakeClient); + KoinaPredictionClient.FakeClient = _fakeClient; + + // set Koina to single threaded when using FakeKoina + _maxThreads = KoinaConstants.MAX_THREADS; + KoinaConstants.MAX_THREADS = 1; + } + + public void Dispose() + { + if (_recordData && _expectedQueriesJsonFilepath != null) + { + using var streamWriter = new StreamWriter(_expectedQueriesJsonFilepath); + using var jsonTextWriter = new JsonTextWriter(streamWriter); + JsonSerializer.Create(JsonSettings).Serialize(jsonTextWriter, _fakeClient.ExpectedQueries); + } + Assert.AreSame(_fakeClient, KoinaPredictionClient.FakeClient); + KoinaPredictionClient.FakeClient = null; + _channel.ShutdownAsync().Wait(); + KoinaConstants.MAX_THREADS = _maxThreads; + } + } + + [JsonObject(MemberSerialization.OptIn)] + public abstract class KoinaQuery + { + [JsonProperty] + public abstract string Model { get; } + public abstract ModelInferResponse Response { get; } + + public abstract void AssertMatchesQuery(ModelInferRequest pr); + public abstract bool MatchesQuery(ModelInferRequest pr); + + public static bool TryGetQuery(HashSet cachedQueries, ModelInferRequest request, out KoinaQuery cachedQuery) + { + if (KoinaIntensityQuery.IsQueryType(request)) + { + return cachedQueries.TryGetValue(KoinaIntensityQuery.FromTensors(request), out cachedQuery); + } + else if (KoinaRetentionTimeQuery.IsQueryType(request)) + { + return cachedQueries.TryGetValue(KoinaRetentionTimeQuery.FromTensors(request), out cachedQuery); + } + + throw new ArgumentException("unhandled Koina query type"); + } + + public static bool TryGetQuery(HashSet cachedQueries, SrmSettings settings, IList request, int NCE, out KoinaIntensityQuery cachedQuery) + { + var model = KoinaIntensityModel.Instance; + var queriesPassingFilters = request.Where(i => model.CreateKoinaInputRow(settings, i.WithNCE(NCE), out var ex) != null && ex == null); + var intensityInputs = queriesPassingFilters.Select(i => new KoinaIntensityInput(i.NodePep.ModifiedSequence, NCE, i.PrecursorCharge)); + var intensityInputQuery = new KoinaIntensityQuery(intensityInputs.ToArray(), null); + + var tryGetValue = cachedQueries.TryGetValue(intensityInputQuery, out var intensityQuery); + if (!tryGetValue) + { + cachedQuery = null; + return false; + } + cachedQuery = (KoinaIntensityQuery) intensityQuery; + return true; + } + + public static bool TryGetQuery(HashSet cachedQueries, SrmSettings settings, IList sequencesForRtQuery, out KoinaRetentionTimeQuery cachedQuery) + { + var model = KoinaRetentionTimeModel.Instance; + var queriesPassingFilters = sequencesForRtQuery.Where(i => model.CreateKoinaInputRow(settings, i, out var ex) != null && ex == null); + var rtInputQuery = new KoinaRetentionTimeQuery(queriesPassingFilters.Select(i => i.Node.ModifiedSequence).Distinct().ToArray(), null); + + var tryGetValue = cachedQueries.TryGetValue(rtInputQuery, out var rtQuery); + if (!tryGetValue) + { + cachedQuery = null; + return false; + } + cachedQuery = (KoinaRetentionTimeQuery) rtQuery; + return true; + } + } + + public class InputsEqualityComparer : EqualityComparer + { + public override bool Equals(KoinaQuery x, KoinaQuery y) + { + if (ReferenceEquals(x, y)) return true; + if (ReferenceEquals(null, x)) return false; + if (ReferenceEquals(null, y)) return false; + if (x.GetType() != y.GetType()) return false; + + if (x is KoinaIntensityQuery x2 && y is KoinaIntensityQuery y2) + { + return x2.InputsEquals(y2); + } + else if (x is KoinaRetentionTimeQuery x3 && y is KoinaRetentionTimeQuery y3) + { + return x3.InputsEquals(y3); + } + + throw new ArgumentException("unhandled Koina query type"); + } + + public override int GetHashCode(KoinaQuery x) + { + if (x is KoinaIntensityQuery x2) + { + return x2.GetInputsHashCode(); + } + else if (x is KoinaRetentionTimeQuery x3) + { + return x3.GetInputsHashCode(); + } + throw new ArgumentException("unhandled Koina query type"); + } + } + + [JsonObject] + public class KoinaIntensityInput + { + public KoinaIntensityInput(string modifiedSequence, float normalizedCollisionEnergy, int precursorCharge) + { + ModifiedSequence = modifiedSequence; + NormalizedCollisionEnergy = normalizedCollisionEnergy; + PrecursorCharge = precursorCharge; + } + + public string ModifiedSequence { get; private set; } + public float NormalizedCollisionEnergy { get; private set; } + public int PrecursorCharge { get; private set; } + + public bool Equals(KoinaIntensityInput other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return ModifiedSequence == other.ModifiedSequence && + NormalizedCollisionEnergy.Equals(other.NormalizedCollisionEnergy) && + PrecursorCharge == other.PrecursorCharge; + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((KoinaIntensityInput)obj); + } + + public override int GetHashCode() + { + unchecked + { + var hashCode = (ModifiedSequence != null ? ModifiedSequence.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ NormalizedCollisionEnergy.GetHashCode(); + hashCode = (hashCode * 397) ^ PrecursorCharge; + return hashCode; + } + } + } + + [JsonObject(MemberSerialization.Fields)] + public class KoinaIntensityQuery : KoinaQuery + { + private KoinaIntensityInput[] _inputs; + private IonTable[] _ionTables; + + public KoinaIntensityQuery(KoinaIntensityInput[] inputs, IonTable[] actualIntensities) + { + _inputs = inputs; + _ionTables = actualIntensities; + if (actualIntensities != null) + Assert.AreEqual(_inputs.Length, _ionTables.Length); + } + + public bool InputsEquals(KoinaIntensityQuery y) + { + if (ReferenceEquals(this, y)) return true; + if (ReferenceEquals(null, y)) return false; + + return _inputs.SequenceEqual(y._inputs); + } + + public int GetInputsHashCode() + { + return ((IStructuralEquatable)_inputs).GetHashCode(EqualityComparer.Default); + } + + public static KoinaIntensityQuery FromTensors(ModelInferRequest request, ModelInferResponse response = null) + { + // Sequences + var seqs = request.Inputs.Single(t => t.Name.Equals(KoinaIntensityModel.KoinaIntensityInput.PEPTIDES_KEY, StringComparison.InvariantCultureIgnoreCase)); + Assert.AreEqual(seqs.Shape.Count, 2); + //Assert.AreEqual(seqs.Shape[1], KoinaConstants.PEPTIDE_SEQ_LEN); + var decodedSeqs = KoinaHelpers.DecodeSequences(seqs); + + // CEs + var ces = request.Inputs.Single(t => t.Name.Equals(KoinaIntensityModel.KoinaIntensityInput.COLLISION_ENERGY_KEY, StringComparison.InvariantCultureIgnoreCase)); + Assert.AreEqual(ces.Shape.Count, 2); + Assert.AreEqual(ces.Shape[1], 1); + var decodedCes = ces.Contents.Fp32Contents.ToArray(); + + // Charges + var charges = request.Inputs.Single(t => t.Name.Equals(KoinaIntensityModel.KoinaIntensityInput.PRECURSOR_CHARGE_KEY, StringComparison.InvariantCultureIgnoreCase)); + Assert.AreEqual(charges.Shape.Count, 2); + //Assert.AreEqual(charges.Shape[1], KoinaConstants.PRECURSOR_CHARGES); + var decodedCharges = KoinaHelpers.DecodeCharges(charges); + + var inputs = Enumerable.Range(0, decodedSeqs.Length) + .Select(i => new KoinaIntensityInput(decodedSeqs[i], decodedCes[i], decodedCharges[i])).ToArray(); + + if (response == null) + return new KoinaIntensityQuery(inputs, null); + + var koinaOutput = new KoinaIntensityModel.KoinaIntensityOutput(response); + + var outputs = new IonTable[inputs.Length]; + for (int i = 0; i < inputs.Length; ++i) + { + outputs[i] = koinaOutput.OutputRows[i].Intensities; + } + + return new KoinaIntensityQuery(inputs, outputs); + } + + public override ModelInferResponse Response + { + get + { + var pr = new ModelInferResponse(); + pr.ModelName = Model; + + // Construct Tensor + var tp = new ModelInferResponse.Types.InferOutputTensor { Datatype = "BYTES" }; + tp.Name = KoinaIntensityModel.KoinaIntensityOutput.OUTPUT_KEYS[0]; + tp.Shape.Add(_ionTables.Length); + tp.Shape.Add(1); + pr.Outputs.Add(tp); + + tp = new ModelInferResponse.Types.InferOutputTensor { Datatype = "FP32" }; + tp.Name = KoinaIntensityModel.KoinaIntensityOutput.OUTPUT_KEYS[1]; + tp.Shape.Add(_ionTables.Length); + tp.Shape.Add(1); + pr.Outputs.Add(tp); + + using var annotationStream = new MemoryStream(); + using var annotationWriter = new BinaryWriter(annotationStream); + var intensitiesFlat = new List(); + int maxIonNumber = _ionTables.Max(t => t.GetLength(1)); + int maxCharge = _ionTables.Max(t => + { + var entries = IonTableEntry.EnumerateIonTable(t).ToArray(); + return entries.Any() ? entries.Max(e => e.chargeState) : 0; + }); + var allIonTypes = _ionTables.SelectMany(t => Helpers.GetEnumValues().Where(t.ContainsIonType)).Distinct().ToList(); + for (var i = 0; i < _inputs.Length; i++) + { + var ionTable = _ionTables[i]; + foreach(var ionType in allIonTypes) + { + for (int ionNumber = 1; ionNumber <= maxIonNumber; ++ionNumber) + { + float[] intensities = null; + + if (ionNumber < ionTable.GetLength(1)) + intensities = ionTable.GetIonValue(ionType, ionNumber); + + if (intensities == null) + { + for (int charge = 0; charge < maxCharge; ++charge) + { + annotationWriter.Write(0); + intensitiesFlat.Add(-1); + } + continue; + } + + for (int charge = 0; charge < maxCharge; ++charge) + { + string annotation = string.Format("{0}{1}+{2}", ionType, ionNumber, charge + 1); + annotationWriter.Write(annotation.Length); + annotationWriter.Write(annotation.ToCharArray()); + intensitiesFlat.Add(intensities[charge]); + } + } + } + } + + annotationStream.Seek(0, SeekOrigin.Begin); + pr.RawOutputContents.Add(ByteString.FromStream(annotationStream)); + pr.RawOutputContents.Add(ByteString.CopyFrom(PrimitiveArrays.ToBytes(intensitiesFlat.ToArray()))); + + return pr; + } + } + + public override string Model => KoinaIntensityModel.Models.First(); + + public static bool IsQueryType(ModelInferRequest pr) + { + var keys = pr.Inputs.Select(t => t.Name).OrderBy(s => s).ToArray(); + return pr.Inputs.Count == 3 && + keys[0] == KoinaIntensityModel.KoinaIntensityInput.COLLISION_ENERGY_KEY && + keys[1] == KoinaIntensityModel.KoinaIntensityInput.PEPTIDES_KEY && + keys[2] == KoinaIntensityModel.KoinaIntensityInput.PRECURSOR_CHARGE_KEY; + } + + public override bool MatchesQuery(ModelInferRequest pr) + { + var keys = pr.Inputs.Select(t => t.Name).OrderBy(s => s).ToArray(); + if (Model != pr.ModelName || + pr.Inputs.Count != 3 || + keys[0] != KoinaIntensityModel.KoinaIntensityInput.COLLISION_ENERGY_KEY || + keys[1] != KoinaIntensityModel.KoinaIntensityInput.PEPTIDES_KEY || + keys[2] != KoinaIntensityModel.KoinaIntensityInput.PRECURSOR_CHARGE_KEY) + return false; + + var seqs = pr.Inputs.Single(t => t.Name.Equals(KoinaIntensityModel.KoinaIntensityInput.PEPTIDES_KEY, StringComparison.InvariantCultureIgnoreCase)); + var ces = pr.Inputs.Single(t => t.Name.Equals(KoinaIntensityModel.KoinaIntensityInput.COLLISION_ENERGY_KEY, StringComparison.InvariantCultureIgnoreCase)); + var charges = pr.Inputs.Single(t => t.Name.Equals(KoinaIntensityModel.KoinaIntensityInput.PRECURSOR_CHARGE_KEY, StringComparison.InvariantCultureIgnoreCase)); + return // Sequences + seqs.Shape.Count == 2 && + seqs.Shape[0] == _inputs.Length && + seqs.Shape[1] == 1 && + ArrayUtil.EqualsDeep(_inputs.Select(i => new ModifiedSequence(i.ModifiedSequence, MassType.Monoisotopic)).ToArray(), + KoinaHelpers.DecodeSequences2(seqs)) && + + // CEs + ces.Shape.Count == 2 && + ces.Shape[0] == _inputs.Length && + ces.Shape[1] == 1 && + + // Charges + charges.Shape.Count == 2 && + charges.Shape[0] == _inputs.Length && + charges.Shape[1] == 1; + } + + public override void AssertMatchesQuery(ModelInferRequest pr) + { + Assert.AreEqual(Model, pr.ModelName); + + Assert.AreEqual(pr.Inputs.Count, 3); + var keys = pr.Inputs.Select(t => t.Name).OrderBy(s => s).ToArray(); + Assert.AreEqual(keys[0], KoinaIntensityModel.KoinaIntensityInput.COLLISION_ENERGY_KEY); + Assert.AreEqual(keys[1], KoinaIntensityModel.KoinaIntensityInput.PEPTIDES_KEY); + Assert.AreEqual(keys[2], KoinaIntensityModel.KoinaIntensityInput.PRECURSOR_CHARGE_KEY); + + // Sequences + var seqs = pr.Inputs.Single(t => t.Name.Equals(KoinaIntensityModel.KoinaIntensityInput.PEPTIDES_KEY, StringComparison.InvariantCultureIgnoreCase)); + Assert.AreEqual(seqs.Shape.Count, 2); + Assert.AreEqual(seqs.Shape[0], _inputs.Length); + Assert.AreEqual(seqs.Shape[1], 1); + AssertEx.AreEqualDeep(_inputs.Select(i => new ModifiedSequence(i.ModifiedSequence, MassType.Monoisotopic)).ToArray(), + KoinaHelpers.DecodeSequences2(seqs).Select(i => new ModifiedSequence(i.MonoisotopicMasses, MassType.Monoisotopic)).ToArray()); + + // CEs + var ces = pr.Inputs.Single(t => t.Name.Equals(KoinaIntensityModel.KoinaIntensityInput.COLLISION_ENERGY_KEY, StringComparison.InvariantCultureIgnoreCase)); + Assert.AreEqual(ces.Shape.Count, 2); + Assert.AreEqual(ces.Shape[0], _inputs.Length); + Assert.AreEqual(ces.Shape[1], 1); + + // Charges + var charges = pr.Inputs.Single(t => t.Name.Equals(KoinaIntensityModel.KoinaIntensityInput.PRECURSOR_CHARGE_KEY, StringComparison.InvariantCultureIgnoreCase)); + Assert.AreEqual(charges.Shape.Count, 2); + Assert.AreEqual(charges.Shape[0], _inputs.Length); + Assert.AreEqual(charges.Shape[1], 1); + } + + public void AssertMatchesSpectra(KoinaIntensityModel.PeptidePrecursorNCE[] peptidePrecursorNCEs, SpectrumDisplayInfo[] spectrumDisplayInfos) + { + for (int i = 0; i < _inputs.Length; ++i) + if (spectrumDisplayInfos[i] != null) + AssertMatchesSpectrum(peptidePrecursorNCEs[i], _inputs[i], _ionTables[i], spectrumDisplayInfos[i]); + } + + public void AssertMatchesSpectrum(KoinaIntensityModel.PeptidePrecursorNCE peptidePrecursorNCE, SpectrumDisplayInfo spectrumDisplayInfo) + { + AssertMatchesSpectrum(peptidePrecursorNCE, _inputs[0], _ionTables[0], spectrumDisplayInfo); + } + + public static void AssertMatchesSpectrum(KoinaIntensityModel.PeptidePrecursorNCE peptidePrecursorNCE, KoinaIntensityInput input, IonTable spectrum, SpectrumDisplayInfo spectrumDisplayInfo) + { + Assert.IsNotNull(spectrumDisplayInfo); + Assert.AreEqual(spectrumDisplayInfo.Name, "Koina"); + + // Calculate expected number of peaks. 1 peak per residue times the number of possible charges + var residues = FastaSequence.StripModifications(input.ModifiedSequence).Length - 1; + var charges = Math.Min(input.PrecursorCharge, 3); + var ionCount = 2 * residues * charges; + + //Assert.AreEqual(spectrumDisplayInfo.SpectrumPeaksInfo.Peaks.Length, ionCount); + + // Construct a koina output object so that we can construct a spectrum for comparison. + // There really is no easier way to do this without rewriting a lot of code for parsing the + // flattened intensities and adding lots of extra test code inside of Skyline code. + var response = new ModelInferResponse(); + var tensor = new ModelInferResponse.Types.InferOutputTensor(); + tensor.Shape.Add(1); + tensor.Shape.Add(spectrum.GetLength(1)); + tensor.Name = KoinaIntensityModel.KoinaIntensityOutput.OUTPUT_KEYS[1]; + response.Outputs.Add(tensor); + + using var annotationStream = new MemoryStream(); + using var annotationWriter = new BinaryWriter(annotationStream); + using var intensityStream = new MemoryStream(); + using var intensityWriter = new BinaryWriter(intensityStream); + foreach (var ionType in new[] { IonType.y, IonType.b }) + for (int i = 1; i <= spectrum.GetLength(1); ++i) + { + var intensities = spectrum.GetIonValue(ionType, i); + if (intensities == null) + continue; + + for (int z = 1; z <= intensities.Length; ++z) + { + string annotation = string.Format("{0}{1}+{2}", ionType, i, z); + annotationWriter.Write(annotation.Length); + annotationWriter.Write(annotation.ToCharArray()); + intensityWriter.Write(intensities[z - 1]); + } + } + annotationStream.Seek(0, SeekOrigin.Begin); + intensityStream.Seek(0, SeekOrigin.Begin); + response.RawOutputContents.Add(ByteString.FromStream(annotationStream)); + response.RawOutputContents.Add(ByteString.FromStream(intensityStream)); + + var fakeKoinaOutput = new KoinaIntensityModel.KoinaIntensityOutput(response); + var ms2Spectrum = new KoinaMS2Spectrum(Program.MainWindow.Document.Settings, + peptidePrecursorNCE.WithNCE((int)(input.NormalizedCollisionEnergy * 100.0f)), 0, fakeKoinaOutput); + + // Compare the spectra + AssertEx.AreEqualDeep(ms2Spectrum.SpectrumPeaks.Peaks, spectrumDisplayInfo.SpectrumPeaksInfo.Peaks); + } + } + + [JsonObject(MemberSerialization.Fields)] + public class KoinaRetentionTimeQuery : KoinaQuery + { + private string[] _modifiedSequences; + private float[] _iRTs; + + public KoinaRetentionTimeQuery(string[] modifiedSequences, float[] iRTs) + { + _modifiedSequences = modifiedSequences; + _iRTs = iRTs; + } + + public bool InputsEquals(KoinaRetentionTimeQuery y) + { + if (ReferenceEquals(this, y)) return true; + if (ReferenceEquals(null, y)) return false; + + return _modifiedSequences.SequenceEqual(y._modifiedSequences); + } + + public int GetInputsHashCode() + { + return ((IStructuralEquatable)_modifiedSequences).GetHashCode(EqualityComparer.Default); + } + + public static KoinaRetentionTimeQuery FromTensors(ModelInferRequest request, ModelInferResponse response = null) + { + // Sequences + var seqs = request.Inputs.Single(t => t.Name.Equals(KoinaRetentionTimeModel.KoinaRTInput.PEPTIDES_KEY, StringComparison.InvariantCultureIgnoreCase)); + Assert.AreEqual(seqs.Shape.Count, 2); + //Assert.AreEqual(seqs.Shape[1], KoinaConstants.PEPTIDE_SEQ_LEN); + var decodedSeqs = KoinaHelpers.DecodeSequences(seqs); + + if (response == null) + return new KoinaRetentionTimeQuery(decodedSeqs, null); + + var outputs = new KoinaRetentionTimeModel.KoinaRTOutput(response); + return new KoinaRetentionTimeQuery(decodedSeqs, outputs.OutputRows.Select(o => (float) o.iRT).ToArray()); + } + + public static bool IsQueryType(ModelInferRequest pr) + { + return pr.Inputs.Count == 1 && + pr.Inputs.First().Name == KoinaRetentionTimeModel.KoinaRTInput.PEPTIDES_KEY; + } + + private string[] DecodedSequences(ModelInferRequest pr) + { + return KoinaHelpers.DecodeSequences2(pr.Inputs.Single(t => + t.Name.Equals(KoinaRetentionTimeModel.KoinaRTInput.PEPTIDES_KEY))).Select(i => i.MonoisotopicMasses).ToArray(); + } + + public override bool MatchesQuery(ModelInferRequest pr) + { + if (Model != pr.ModelName || + pr.Inputs.Count != 1 && + pr.Inputs.First().Name != KoinaRetentionTimeModel.KoinaRTInput.PEPTIDES_KEY) + return false; + + var tensor = pr.Inputs.Single(t => t.Name.Equals(KoinaRetentionTimeModel.KoinaRTInput.PEPTIDES_KEY, StringComparison.InvariantCultureIgnoreCase)); + return tensor.Shape.Count == 2 && + tensor.Shape[0] == _modifiedSequences.Length && + tensor.Shape[1] == 1 && + ArrayUtil.EqualsDeep(_modifiedSequences.Select(i => new ModifiedSequence(i, MassType.Monoisotopic).MonoisotopicMasses).ToArray(), + DecodedSequences(pr)); + } + + public override void AssertMatchesQuery(ModelInferRequest pr) + { + Assert.AreEqual(Model, pr.ModelName); + Assert.AreEqual(pr.Inputs.Count, 1); + Assert.AreEqual(pr.Inputs.First().Name, KoinaRetentionTimeModel.KoinaRTInput.PEPTIDES_KEY); + var tensor = pr.Inputs.Single(t => t.Name.Equals(KoinaRetentionTimeModel.KoinaRTInput.PEPTIDES_KEY, StringComparison.InvariantCultureIgnoreCase)); + Assert.AreEqual(tensor.Shape.Count, 2); + Assert.AreEqual(tensor.Shape[0], _modifiedSequences.Length); + Assert.AreEqual(tensor.Shape[1], 1); + AssertEx.AreEqualDeep(_modifiedSequences.Select(i => new ModifiedSequence(i, MassType.Monoisotopic).MonoisotopicMasses).ToArray(), + DecodedSequences(pr)); + } + + public void AssertMatchesSpectra(SpectrumDisplayInfo[] spectrumDisplayInfos) + { + var iRTIndex = 0; + foreach (var info in spectrumDisplayInfos.Where(i => i != null)) + { + if (Equals(info.Precursor.LabelType, IsotopeLabelType.heavy)) + --iRTIndex; // Reuse previous iRT, since we only made a single iRT prediction for heavy and light + + AssertMatchesSpectrum(_iRTs[iRTIndex++], info); + } + } + + public void AssertMatchesSpectrum(SpectrumDisplayInfo spectrumDisplayInfo) + { + AssertMatchesSpectrum(_iRTs[0], spectrumDisplayInfo); + } + + public static void AssertMatchesSpectrum(float iRT, SpectrumDisplayInfo spectrumDisplayInfo) + { + var expected = iRT; + + Assert.AreEqual(expected, spectrumDisplayInfo.RetentionTime); + } + + public override string Model => KoinaRetentionTimeModel.Models.First(); + + public override ModelInferResponse Response + { + get + { + var pr = new ModelInferResponse(); + pr.ModelName = Model; + + // Construct Tensor + var tp = new ModelInferResponse.Types.InferOutputTensor { Datatype = "FP32" }; + tp.Name = KoinaRetentionTimeModel.KoinaRTOutput.OUTPUT_KEY; + //tp.Contents = new InferTensorContents(); + + // Populate with data + //tp.Contents.Fp32Contents.AddRange(_iRTs); + tp.Shape.Add(_iRTs.Length); + pr.Outputs.Add(tp); + + pr.RawOutputContents.Add(ByteString.CopyFrom(PrimitiveArrays.ToBytes(_iRTs))); + + return pr; + } + } + } + + public struct IonTableEntry + { + public IonType ionType; + public int ionNumber; + public int chargeState; + public float intensity; + + public IonTableEntry(IonType ionType, int ionNumber, int chargeState, float intensity) + { + this.ionType = ionType; + this.ionNumber = ionNumber; + this.chargeState = chargeState; + this.intensity = intensity; + } + + public static IEnumerable EnumerateIonTable(IonTable ionTable) + { + for (int i = 1; i < ionTable.GetLength(0); ++i) + { + var ionType = (IonType)(i - 1); + for (int j = 1; j <= ionTable.GetLength(1); ++j) + { + var intensities = ionTable.GetIonValue(ionType, j); + if (intensities == null) + continue; + + for (int charge = 0; charge < intensities.Length; ++charge) + { + if (intensities[charge] != 0) + yield return new IonTableEntry(ionType, j, charge + 1, intensities[charge]); + } + } + } + } + } + + public class IonTableContractResolver : DefaultContractResolver + { + private readonly JsonConverter _converter; + + public IonTableContractResolver() + { + _converter = new SparseIonTableConverter(); + } + + protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization) + { + var property = base.CreateProperty(member, memberSerialization); + + if (member.Name == "_store" && member.DeclaringType == typeof(IonTable)) + { + property.Converter = _converter; + property.Readable = true; + property.Writable = true; + } + + return property; + } + + protected override IList CreateProperties(Type type, MemberSerialization memberSerialization) + { + var properties = base.CreateProperties(type, memberSerialization); + + if (memberSerialization == MemberSerialization.Fields) + return properties; + + // Add _store field manually + var privateFields = type.GetFields(BindingFlags.NonPublic | BindingFlags.Instance); + + foreach (var field in privateFields) + { + if (field.Name == "_store") + properties.Add(CreateProperty(field, memberSerialization)); + } + + return properties; + } + } + + public class SparseIonTableConverter : JsonConverter + { + public override void WriteJson(JsonWriter writer, float[,][] value, JsonSerializer serializer) + { + var table = value; + var ionTypes = new List(); + var ionNumbers = new List(); + var charges = new List(); + var intensities = new List(); + + int maxCharge = 0; + for (int i = 0; i < table.GetLength(0); ++i) + for (int j = 0; j < table.GetLength(1); ++j) + maxCharge = Math.Max(maxCharge, table[i, j]?.Length ?? 0); + + for (int row = 0; row < table.GetLength(0); row++) + { + for (int col = 0; col < table.GetLength(1); col++) + { + var intensityByCharge = table[row, col]; + if (intensityByCharge == null && row + 1 < table.GetLength(0)) + continue; + + for (int charge = 0; charge < maxCharge; charge++) + { + //if (intensityByCharge[charge] <= 0) + // continue; // Only serialize non-default values + + IonType ionType = (IonType) row - 1; + int ionNumber = ionType.IsNTerminal() ? col + 1 : table.GetLength(1) - col; + + ionTypes.Add(ionType); + ionNumbers.Add(ionNumber); + charges.Add(charge + 1); + intensities.Add(intensityByCharge?[charge] ?? -1); + } + } + } + + var sparseRepresentation = new SparseRepresentation + { + IonType = ionTypes, + IonNumber = ionNumbers, + Charge = charges, + Intensity = intensities + }; + + var formatting = serializer.Formatting; + writer.Formatting = Formatting.None; + string newlineAndIndent = "\n" + new string(' ', 17); + + // Manually write each array in order to write them compactly (on one line) but put newlines between arrays + writer.WriteStartObject(); + writer.WritePropertyName("IonType"); + writer.WriteStartArray(); + foreach (var ionType in sparseRepresentation.IonType) + serializer.Serialize(writer, ionType.ToString()); + writer.WriteEndArray(); + writer.WriteWhitespace(newlineAndIndent); + + writer.WritePropertyName("IonNumber"); + writer.WriteStartArray(); + foreach (var ionNumber in sparseRepresentation.IonNumber) + serializer.Serialize(writer, ionNumber); + writer.WriteEndArray(); + writer.WriteWhitespace(newlineAndIndent); + + writer.WritePropertyName("Charge"); + writer.WriteStartArray(); + foreach (var charge in sparseRepresentation.Charge) + serializer.Serialize(writer, charge); + writer.WriteEndArray(); + writer.WriteWhitespace(newlineAndIndent); + + writer.WritePropertyName("Intensity"); + writer.WriteStartArray(); + foreach (var intensity in sparseRepresentation.Intensity) + serializer.Serialize(writer, intensity); + writer.WriteEndArray(); + writer.WriteEndObject(); + + writer.Formatting = formatting; + } + + public override float[,][] ReadJson(JsonReader reader, Type objectType, float[,][] existingValue, bool hasExistingValue, JsonSerializer serializer) + { + var sparseRepresentation = serializer.Deserialize(reader); + if (sparseRepresentation == null) + return null; + + // Determine dimensions + int maxIonType = 0, maxIonNumber = 0, maxCharge = 0; + for (int i = 0; i < sparseRepresentation.IonType.Count; i++) + { + if ((int) sparseRepresentation.IonType[i] + 1 > maxIonType) maxIonType = (int) sparseRepresentation.IonType[i] + 1; + if (sparseRepresentation.IonNumber[i] > maxIonNumber) maxIonNumber = sparseRepresentation.IonNumber[i] + 1; + if (sparseRepresentation.Charge[i] > maxCharge) maxCharge = sparseRepresentation.Charge[i]; + } + + var result = new float[maxIonType + 1, maxIonNumber + 1][]; + + // Populate the result array + for (int i = 0; i < sparseRepresentation.IonType.Count; i++) + { + IonType ionType = sparseRepresentation.IonType[i]; + int ionNumber = sparseRepresentation.IonNumber[i]; + + int row = (int) ionType + 1; + int col = ionType.IsNTerminal() ? ionNumber - 1 : maxIonNumber - ionNumber + 1; + int charge = sparseRepresentation.Charge[i] - 1; + float intensity = sparseRepresentation.Intensity[i]; + + if (result[row, col] == null) + result[row, col] = new float[maxCharge]; + result[row, col][charge] = intensity; + } + + return result; + } + + private class SparseRepresentation + { + [JsonProperty(ItemConverterType = typeof(StringEnumConverter))] + public List IonType { get; set; } + public List IonNumber { get; set; } + public List Charge { get; set; } + public List Intensity { get; set; } + } + } +} \ No newline at end of file diff --git a/pwiz_tools/Skyline/TestUtil/ScreenshotProcessingExtensions.cs b/pwiz_tools/Skyline/TestUtil/ScreenshotProcessingExtensions.cs index 3c9a211f0c..9c39dcd99c 100644 --- a/pwiz_tools/Skyline/TestUtil/ScreenshotProcessingExtensions.cs +++ b/pwiz_tools/Skyline/TestUtil/ScreenshotProcessingExtensions.cs @@ -23,7 +23,10 @@ using System.Drawing.Drawing2D; using System.Linq; using System.Windows.Forms; +using pwiz.Common.Controls; +using pwiz.Common.SystemUtil.PInvoke; using pwiz.Skyline.Controls.Databinding; +using pwiz.Skyline.Util; namespace pwiz.SkylineTestUtil { @@ -493,5 +496,82 @@ private static int GetGridViewYOffset(DocumentGridForm documentGridForm) // compute top-left corner of data grid's cells, 4px offset puts shapes in the correct place return documentGridForm.NavBar.Height + documentGridForm.DataGridView.ColumnHeadersHeight - 4; } + + /// + /// Draws the state of a ProgressBar on the ProgressBar to cover up + /// any animation that Windows may have drawn on the completed progress + /// + public static Bitmap FillProgressBar(this Bitmap bmp, ProgressBar progressBar) + { + var bitmapForm = FormEx.GetParentForm(progressBar); + var formRect = ScreenshotManager.GetFramedWindowBounds(bitmapForm); + var progressControlRect = progressBar.RectangleToScreen(progressBar.ClientRectangle); + progressControlRect.Offset(-formRect.Left, -formRect.Top); // Into bitmap coordinates + var progressRect = progressControlRect; // Copy values for percent complete bar + progressRect.Inflate(-1, -1); // Exclude the border + + // Do the necessary drawing + return bmp.RenderAsControl(progressBar, g => + { + using var brushControl = new SolidBrush(Color.FromArgb(230, 230, 230)); // Slightly darker than Control + g.FillRectangle(brushControl, progressRect); + + progressRect.Width = (int)Math.Round(progressRect.Width * progressBar.Value / 100.0); + using var brush = new SolidBrush(Color.FromArgb(6, 176, 37)); // The color that gets used + g.FillRectangle(brush, progressRect); + + if (progressBar is CustomTextProgressBar customProgressBar) + { + customProgressBar.DrawText(g, progressControlRect); + } + + using var pen = new Pen(Color.FromArgb(188, 188, 188)); + progressControlRect.Width -= 1; // Pens draw to the right + progressControlRect.Height -= 1; // Pens draw below + g.DrawRectangle(pen, progressControlRect); + }); + } + + /// + /// Creates a MemoryDC based on a control and renders with it using the + /// rendering function argument. + /// + /// The Bitmap to draw on + /// The control to match as closely as possible + /// The function that does the actual drawing + private static Bitmap RenderAsControl(this Bitmap bmp, Control control, Action render) + { + var hdc = User32.GetDC(control.Handle); + try + { + var memDc = Gdi32.CreateCompatibleDC(hdc); + try + { + var hBmp = bmp.GetHbitmap(); + var oldBmp = Gdi32.SelectObject(memDc, hBmp); + + using (var g = Graphics.FromHdc(memDc)) + { + render(g); + } + + Gdi32.SelectObject(memDc, oldBmp); + + var result = Image.FromHbitmap(hBmp); + + Gdi32.DeleteObject(hBmp); + + return result; + } + finally + { + Gdi32.DeleteDC(memDc); + } + } + finally + { + User32.ReleaseDC(control.Handle, hdc); + } + } } } diff --git a/pwiz_tools/Skyline/TestUtil/TestFunctional.cs b/pwiz_tools/Skyline/TestUtil/TestFunctional.cs index 6d88057fe9..3614a4cdca 100644 --- a/pwiz_tools/Skyline/TestUtil/TestFunctional.cs +++ b/pwiz_tools/Skyline/TestUtil/TestFunctional.cs @@ -1269,7 +1269,7 @@ public static void PauseTestUI(string description = null) MessageBoxIcon.Information); } - private static bool IsRecordingScreenShots => IsPauseForScreenShots || IsCoverShotMode; + protected static bool IsRecordingScreenShots => IsPauseForScreenShots || IsCoverShotMode; /// /// If true, calls to PauseForScreenShot used in the tutorial tests will pause @@ -1307,7 +1307,8 @@ public static bool IsAutoScreenShotMode } } - public static bool IsTranslationRequired => IsAutoScreenShotMode && !Equals("en", GetFolderNameForLanguage(CultureInfo.CurrentCulture)); + public static bool IsTranslationRequired => (IsAutoScreenShotMode || IsCoverShotMode) && + !Equals("en", GetFolderNameForLanguage(CultureInfo.CurrentCulture)); private static bool _isCoverShotMode; @@ -1326,18 +1327,17 @@ public static bool IsCoverShotMode public string CoverShotName { get; set; } - private string GetCoverShotPath(string folderPath = null, string suffix = null) + private string GetCoverShotPath() { - if (CoverShotName == null) - { - return null; - } + Assume.IsNotNull(CoverShotName); + return Path.Combine(TutorialPath, "cover.png"); + } - if (folderPath == null) - folderPath = Path.Combine(PathEx.GetDownloadsPath(), "covershots"); - if (suffix == null) - suffix = string.Format("-{0}_{1}", Install.MajorVersion, Install.MinorVersion); - string cultureSuffix = CultureInfo.CurrentCulture.Name; + private string GetCoverShotPath([NotNull] string folderPath, [NotNull] string suffix) + { + Assume.IsNotNull(CoverShotName); + + string cultureSuffix = GetFolderNameForLanguage(CultureInfo.CurrentCulture); if (Equals(cultureSuffix, "en")) cultureSuffix = string.Empty; else @@ -1873,19 +1873,22 @@ private void PauseForScreenShotInternal(string description, Type formType = null protected virtual Bitmap ProcessCoverShot(Bitmap bmp) { // Override to modify the cover shot before it is saved or put on the clipboard - return bmp; + return bmp.CleanupBorder(); } - public void TakeCoverShot() + public void TakeCoverShot(Control activateControl = null) { Thread.Sleep(1000); // Give windows time to repaint RunUI(() => { + AssertEx.AreEqual(1.0, (new Size(1, 1) * ScreenshotManager.GetScalingFactor()).Width, + "Cover shots must be taken at a scale factor of 100% (96DPI)"); var screenRect = Screen.FromControl(SkylineWindow).Bounds; - AssertEx.IsTrue(screenRect.Width == 1920 && screenRect.Height == 1080, - "Cover shots must be taken at screen resolution 1920x1080 at scale factor 100% (96DPI)"); + AssertEx.IsTrue(screenRect.Width >= 1920 && screenRect.Height >= 1080, + "Cover shots must be taken at screen resolution of at least 1920x1080"); }); var coverSavePath = GetCoverShotPath(); + ScreenshotManager.ActivateScreenshotForm(activateControl ?? SkylineWindow); _shotManager.TakeShot(SkylineWindow, false, coverSavePath, ProcessCoverShot); string coverSavePath2 = null; if (coverSavePath != null) diff --git a/pwiz_tools/Skyline/TestUtil/TestUtil.csproj b/pwiz_tools/Skyline/TestUtil/TestUtil.csproj index 6658eeffb0..b9a2dacd74 100644 --- a/pwiz_tools/Skyline/TestUtil/TestUtil.csproj +++ b/pwiz_tools/Skyline/TestUtil/TestUtil.csproj @@ -103,6 +103,18 @@ False ..\..\Shared\Lib\DotNetZip\DotNetZip.dll + + False + ..\..\Shared\Lib\Google.Protobuf.dll + + + False + ..\..\Shared\Lib\Grpc.Core.dll + + + False + ..\bin\x64\Release\Grpc.Core.Api.dll + False ..\..\Shared\Lib\JetBrains.Annotations.dll @@ -116,6 +128,10 @@ ..\..\Shared\Lib\Microsoft.Diagnostics.Runtime\lib\net40\Microsoft.Diagnostics.Runtime.dll + + False + ..\..\Shared\Lib\Newtonsoft.Json.dll + 3.5 @@ -154,6 +170,7 @@ + True diff --git a/pwiz_tools/commandline/idcat.cpp b/pwiz_tools/commandline/idcat.cpp index 9a061eaeba..1808430c1c 100644 --- a/pwiz_tools/commandline/idcat.cpp +++ b/pwiz_tools/commandline/idcat.cpp @@ -365,7 +365,7 @@ void dumpFile(const string& filename, const string& outputFile, catch (exception& e) { cerr << "Error writing analysis " << (i+1) - << " in " << fs::path(filename).leaf() << ":\n" + << " in " << fs::path(filename).filename() << ":\n" << e.what() << endl; } } diff --git a/pwiz_tools/commandline/idconvert.cpp b/pwiz_tools/commandline/idconvert.cpp index b2a05dacbf..1dc8d07052 100644 --- a/pwiz_tools/commandline/idconvert.cpp +++ b/pwiz_tools/commandline/idconvert.cpp @@ -464,7 +464,7 @@ void processFile(const string& filename, const Config& config, const ReaderList& } catch (exception& e) { - cerr << "Error writing analysis " << (i+1) << " in " << bfs::path(filename).leaf() << ":\n" << e.what() << endl; + cerr << "Error writing analysis " << (i+1) << " in " << bfs::path(filename).filename() << ":\n" << e.what() << endl; } } cout << endl; diff --git a/pwiz_tools/commandline/msconvert.cpp b/pwiz_tools/commandline/msconvert.cpp index 351f6ae843..b7e5778510 100644 --- a/pwiz_tools/commandline/msconvert.cpp +++ b/pwiz_tools/commandline/msconvert.cpp @@ -1055,7 +1055,7 @@ void processFile(const string& filename, const Config& config, const ReaderList& *os_ << endl; if (failedRuns > 0) - throw runtime_error("Conversion failed for " + toString(failedRuns) + " runs in " + bfs::path(filename).leaf().string() + "."); + throw runtime_error("Conversion failed for " + toString(failedRuns) + " runs in " + bfs::path(filename).filename().string() + "."); } diff --git a/pwiz_tools/commandline/msdir.cpp b/pwiz_tools/commandline/msdir.cpp index 8bf2b7076b..86bd8bf926 100644 --- a/pwiz_tools/commandline/msdir.cpp +++ b/pwiz_tools/commandline/msdir.cpp @@ -272,7 +272,7 @@ bool processPath(const bfs::path& path, const Config& config, const ReaderList& % pathType % abbreviate_byte_size(pathSize) % pathCreationTime - % path.leaf() + % path.filename() ).str() << flush; break; @@ -296,7 +296,7 @@ bool processPath(const bfs::path& path, const Config& config, const ReaderList& % spectraCount % instrumentModel.name() % source.run.id - % path.leaf() + % path.filename() ).str() << flush; } } @@ -310,7 +310,7 @@ bool processPath(const bfs::path& path, const Config& config, const ReaderList& % "error" % "error" % "error" - % path.leaf() + % path.filename() ).str() << endl << e.what() << endl; } catch(...) @@ -323,7 +323,7 @@ bool processPath(const bfs::path& path, const Config& config, const ReaderList& % "error" % "error" % "error" - % path.leaf() + % path.filename() ).str() << endl << "Unknown error" << endl; } break; @@ -354,7 +354,7 @@ void go(const Config& config) int longestPath = 0; BOOST_FOREACH(const bfs::path & path, config.paths) - longestPath = max((int) path.leaf().size(), longestPath); + longestPath = max((int) path.filename().size(), longestPath); int longestInstrument = 0; for(const auto& cvid : cvids()) diff --git a/pwiz_tools/commandline/mspicture.cpp b/pwiz_tools/commandline/mspicture.cpp index f164f4d46b..b83dd4998e 100644 --- a/pwiz_tools/commandline/mspicture.cpp +++ b/pwiz_tools/commandline/mspicture.cpp @@ -382,7 +382,7 @@ int main(int argc, const char* argv[]) MSDataFile msd(config.filenames.at(0), &readers); MSDataAnalyzer::DataInfo dataInfo(msd); - dataInfo.sourceFilename = BFS_STRING(path(config.filenames.at(0)).leaf()); + dataInfo.sourceFilename = BFS_STRING(path(config.filenames.at(0)).filename()); dataInfo.outputDirectory = config.outputDirectory; if (config.verbose) dataInfo.log = &cout; diff --git a/pwiz_tools/commandline/qtofpeakpicker.cpp b/pwiz_tools/commandline/qtofpeakpicker.cpp index 40f7700ea1..b13ed89262 100644 --- a/pwiz_tools/commandline/qtofpeakpicker.cpp +++ b/pwiz_tools/commandline/qtofpeakpicker.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include "pwiz/utility/misc/Filesystem.hpp" #include #include "pwiz/analysis/findmf/qtofpeakpickerfilter.hpp" #include "pwiz/data/vendor_readers/ExtendedReaderList.hpp" diff --git a/pwiz_tools/common/MSDataAnalyzerApplication.cpp b/pwiz_tools/common/MSDataAnalyzerApplication.cpp index 7555b2899a..926b6450ed 100644 --- a/pwiz_tools/common/MSDataAnalyzerApplication.cpp +++ b/pwiz_tools/common/MSDataAnalyzerApplication.cpp @@ -182,7 +182,7 @@ PWIZ_API_DECL void MSDataAnalyzerApplication::run(MSDataAnalyzer& analyzer, ostr SpectrumListFactory::wrap(msd, filters); MSDataAnalyzer::DataInfo dataInfo(msd); - dataInfo.sourceFilename = BFS_STRING(bfs::path(filename).leaf()); + dataInfo.sourceFilename = BFS_STRING(bfs::path(filename).filename()); dataInfo.outputDirectory = outputDirectory; dataInfo.log = log; diff --git a/pwiz_tools/examples/txt2mzml.cpp b/pwiz_tools/examples/txt2mzml.cpp index 3f9568c9d5..26d40727e0 100644 --- a/pwiz_tools/examples/txt2mzml.cpp +++ b/pwiz_tools/examples/txt2mzml.cpp @@ -65,8 +65,8 @@ void txt2mzml(const char* filenameIn, const char* filenameOut) SourceFilePtr sourceFile(new SourceFile); bfs::path p(filenameIn); sourceFile->id = "text_data"; - sourceFile->name = BFS_STRING(p.leaf()); - sourceFile->location = string("file://") + BFS_COMPLETE(p.branch_path()).string(); + sourceFile->name = BFS_STRING(p.filename()); + sourceFile->location = string("file://") + BFS_COMPLETE(p.parent_path()).string(); string sha1 = SHA1Calculator::hashFile(filenameIn); sourceFile->cvParams.push_back(CVParam(MS_SHA_1, sha1)); msd.fileDescription.sourceFilePtrs.push_back(sourceFile); diff --git a/scripts/misc/tc-perftests-skiplist.txt b/scripts/misc/tc-perftests-skiplist.txt index 867c1d33bc..8a7187fa3c 100644 --- a/scripts/misc/tc-perftests-skiplist.txt +++ b/scripts/misc/tc-perftests-skiplist.txt @@ -12,14 +12,14 @@ ConsoleTestDiaPasefFullDataset ConsoleTestDiaQeFullSearch ConsoleTestDiaTtofFullSearch DecoysMatchTest -TestDiaPasefFullDataset +TestDiaPasefFullDatasetExtra TestDiaTtofDiaUmpireTutorialFullFileset -TestDiaTtofFullSearchTutorial +TestDiaTtofFullSearchTutorialExtra TestDiaUmpireWiffFile -TestDiaQeDiaUmpireTutorial +TestDiaQeDiaUmpireTutorialExtra TestDiaQeDiaUmpireTutorialFullFileset -TestDiaQeFullSearchTutorial -TestDiaSearchQeTutorial +TestDiaQeFullSearchTutorialExtra +TestDiaSearchQeTutorialDraft TestEncyclopeDiaSearchTutorialFullFileset TestFeatureDetectionTutorialFuture #TestImportHundredsOfReplicates