Skip to content

Commit

Permalink
Merge pull request #3 from JensUweUlrich/abundance_threshold
Browse files Browse the repository at this point in the history
reporting with different abundance threshold successfully tested
  • Loading branch information
JensUweUlrich committed Mar 22, 2024
2 parents 2a789a5 + e0773a1 commit 408f558
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int main(int argc, char const **argv)

seqan3::argument_parser top_level_parser{"taxor", argc, argv, seqan3::update_notifications::off,
{"build", "search", "profile"}};
top_level_parser.info.version = "0.1.2";
top_level_parser.info.version = "0.1.3";

try
{
Expand Down
2 changes: 1 addition & 1 deletion src/main/taxor_build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ using sequence_file_t = seqan3::sequence_file_input<hixf::dna4_traits, seqan3::f

void set_up_subparser_layout(seqan3::argument_parser & parser, taxor::build::configuration & config)
{
parser.info.version = "0.1.0";
parser.info.version = "0.1.3";
parser.info.author = "Jens-Uwe Ulrich";
parser.info.email = "jens-uwe.ulrich@hpi.de";
parser.info.short_description = "Creates an HIXF index of a given set of fasta files";
Expand Down
11 changes: 8 additions & 3 deletions src/main/taxor_profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace taxor::profile

void set_up_subparser_layout(seqan3::argument_parser & parser, taxor::profile::configuration & config)
{
parser.info.version = "0.1.0";
parser.info.version = "0.1.3";
parser.info.author = "Jens-Uwe Ulrich";
parser.info.email = "jens-uwe.ulrich@hpi.de";
parser.info.short_description = "Taxonomic profiling of a sample by giving read matching results of Taxor search";
Expand Down Expand Up @@ -47,6 +47,11 @@ void set_up_subparser_layout(seqan3::argument_parser & parser, taxor::profile::c
"Identifier of the analyzed sample",
seqan3::option_spec::required);

parser.add_option(config.threshold, '\0', "min-abundance",
"Minimum abundance to report (default: 0.001)",
seqan3::option_spec::standard,
seqan3::arithmetic_range_validator{static_cast<double>(0.0), static_cast<double>(1.0)});

parser.add_option(config.threads,
'\0', "threads",
"The number of threads to use.",
Expand Down Expand Up @@ -736,7 +741,7 @@ void tax_profile(taxor::profile::configuration& config)

for (auto & t: tax_abundances)
{
if (t.second < 0.001)
if (t.second < config.threshold)
t.second = 0.0;
}
std::map<std::string, taxonomy::Profile_Output> rank_profiles = calculate_higher_rank_abundances(tax_abundances,taxpath);
Expand All @@ -752,7 +757,7 @@ void tax_profile(taxor::profile::configuration& config)

for (auto & t: tax_abundances)
{
if (t.second < 0.001)
if (t.second < config.threshold)
t.second = 0.0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/taxor_profile_configuration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct configuration
std::string report_file{};
std::string sequence_abundance_file{};
std::string sample_id{};
//double threshold{-1.0};
double threshold{0.001};
//double error_rate{0.04};
uint8_t threads{1u};
bool output_verbose_statistics{false};
Expand Down
2 changes: 1 addition & 1 deletion src/main/taxor_search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace taxor::search

void set_up_subparser_layout(seqan3::argument_parser & parser, taxor::search::configuration & config)
{
parser.info.version = "0.1.0";
parser.info.version = "0.1.3";
parser.info.author = "Jens-Uwe Ulrich";
parser.info.email = "jens-uwe.ulrich@hpi.de";
parser.info.short_description = "Queries a file of DNA sequences against an HIXF index";
Expand Down

0 comments on commit 408f558

Please sign in to comment.