Skip to content

Commit

Permalink
Fix bug when the total number of regions is too low
Browse files Browse the repository at this point in the history
  • Loading branch information
morispi committed Sep 8, 2021
1 parent 1cc1c42 commit ee19cef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/subcommands/help.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ void subcommandHelp(std::string subcommand) {
printf("ARGS:\n");
printf("\t-b, --bam\t BAM file to retrieve stats from\n");
printf("\t-r, --regions\t Number of regions to consider to define stats (optional, default: 1000)\n");
printf("\t-s, --size\t Size of the regions to consider (optional, default: 10000) \n");
printf("\t-s, --size\t Size of the regions to consider (optional, default: 1000) \n");
printf("\t-o, --output\t File where to output the extracted reads (optional, default: stdout)\n");
printf("\t-t, --threads\t Number of threads to use when comparing a list of contigs (optional, default: 1)\n");
}
Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/stats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void subcommandStats(int argc, char* argv[]) {

reader.Close();

pair<vector<unsigned>, vector<unsigned>> res = extractBarcodesAndCommonBarcodesCounts(bamFile, regionsList, numberOfRegions, nbThreads);
pair<vector<unsigned>, vector<unsigned>> res = extractBarcodesAndCommonBarcodesCounts(bamFile, regionsList, min(numberOfRegions, (unsigned) regionsList.size()), nbThreads);
vector<unsigned> barcodesPerRegion = res.first;
vector<unsigned> commonBarcodes = res.second;

Expand Down

0 comments on commit ee19cef

Please sign in to comment.