// ========================================================================== // lambda // ========================================================================== // Copyright (c) 2013-2017, Hannes Hauswedell
const &);
//-
template const &,
TRedAlph const &);
//-
template const &,
TRedAlph const & /**/,
TScoreExtension const & /**/);
//-
template const &,
TRedAlph const & /**/,
TScoreExtension const & /**/);
// --------------------------------------------------------------------------
// Function main()
// --------------------------------------------------------------------------
// Program entry point.
int main(int argc, char const ** argv)
{
// Parse the command line.
seqan::ArgumentParser parser;
LambdaOptions options;
seqan::ArgumentParser::ParseResult res = parseCommandLine(options, argc, argv);
// If there was an error parsing or built-in argument parser functionality
// was triggered then we exit the program. The return code is 1 if there
// were errors and 0 if there were none.
if (res != seqan::ArgumentParser::PARSE_OK)
return res == seqan::ArgumentParser::PARSE_ERROR;
if (std::string(CMAKE_BUILD_TYPE) != "Release")
std::cerr << "WARNING: This binary is not built in release mode and will be much slower than it should be!\n";
return argConv0(options);
}
// CONVERT Run-time options to compile-time Format-Type
inline int
argConv0(LambdaOptions const & options)
{
CharString output = options.output;
if (endsWith(output, ".gz"))
output = prefix(output, length(output) - 3);
else if (endsWith(output, ".bz2"))
output = prefix(output, length(output) - 4);
if (endsWith(output, ".m0"))
return argConv1(options, BlastReport(), BlastTabularSpecSelector<:no_comments>());
else if (endsWith(output, ".m8"))
return argConv1(options, BlastTabular(), BlastTabularSpecSelector<:no_comments>());
else if (endsWith(output, ".m9"))
return argConv1(options, BlastTabular(), BlastTabularSpecSelector<:comments>());
else if (endsWith(output, ".sam") || endsWith(output, ".bam")) // handled elsewhere
return argConv1(options, BlastTabular(), BlastTabularSpecSelector<:comments>());
std::cerr << "ERROR: Cannot handle output extension.\n";
return -1;
}
template const &)
{
using Th = BlastTabularSpecSelector ;
switch (options.alphReduction)
{
case 0:
return argConv3(options, TOutFormat(), Th(), Tp(), AminoAcid());
case 2:
return argConv3(options, TOutFormat(), Th(), Tp(), ReducedAminoAcid const &,
TRedAlph const &)
{
if (options.gapOpen == 0)
#ifndef LAMBDA_LINGAPS_OPT
std::cerr << "ATTENTION: You have set the additional gap open cost to 0. If you run LAMBDA "
"in this configuration regularly, you might want to rebuild it with "
"LAMBDA_LINGAPS_OPT=1 to profit from additional optimizations.\n";
#else
return argConv4(options,
TOutFormat(),
BlastTabularSpecSelector (),
TRedAlph(),
LinearGaps());
else
#endif
return argConv4(options,
TOutFormat(),
BlastTabularSpecSelector (),
TRedAlph(),
AffineGaps());
}
template const &,
TRedAlph const & /**/,
TScoreExtension const & /**/)
{
int indexType = options.dbIndexType;
// if (indexType == -1) // autodetect
// {
// //TODO FIX THIS WITH NEW EXTENSIONS
// CharString file = options.dbFile;
// append(file, ".sa");
// struct stat buffer;
// if (stat(toCString(file), &buffer) == 0)
// {
// indexType = 0;
// } else
// {
// file = options.dbFile;
// append(file, ".sa.val"); // FM Index
// struct stat buffer;
// if (stat(toCString(file), &buffer) == 0)
// {
// indexType = 1;
// } else
// {
// std::cerr << "No Index file could be found, please make sure paths "
// << "are correct and the files are readable.\n" << std::flush;
//
// return -1;
// }
// }
// }
if (indexType == 0)
return realMain (),
TRedAlph(),
TScoreExtension());
else
return realMain (),
TRedAlph(),
TScoreExtension());
}
/// REAL MAIN
#ifdef _OPENMP
#define TID omp_get_thread_num()
#else
#define TID 0
#endif
template const &,
TRedAlph const & /**/,
TScoreExtension const & /**/)
{
using TGlobalHolder = GlobalDataHolder