Skip to content
Snippets Groups Projects
Commit cdb85ac5 authored by Salson Mikael's avatar Salson Mikael
Browse files

Coverind: Add info on BED

parent 0348f123
No related branches found
No related tags found
No related merge requests found
......@@ -56,13 +56,13 @@ int main(int argc, char **argv) {
// Query options
query->add_option("--index,-i", index_file, "Basename of the index file (same value as the -b passed to the `index' command")->required();
CLI::Option *list = query->add_flag("--list,-l", do_list, "List the chromosomes stored in the index with their length");
CLI::Option *bed = query->add_option("--bed,-b", bed_file, "Create a bed file with the number of reads computed on the whole genome on "+std::to_string(window_size)+"-bp windows (see --range --bed-window for more customisation)");
CLI::Option *bed = query->add_option("--bed,-b", bed_file, "Create a BED file with the number of reads computed on the whole genome on "+std::to_string(window_size)+"-bp windows (see --range --bed-window for more customisation). We recall that in BED format positions start at 0, the start position is included and the end position is excluded");
query->add_option("--bed-window,-w", window_size, "Window size on which the number of reads is computed for the BED output")
->needs(bed);
CLI::Option *range_opt = query->add_option("--range,-r",
[&chr, &start_pos, &end_pos](CLI::results_t res) {
return explodeRange(res[0], chr, start_pos, end_pos);
}, "Gives the number of reads overlapping the specified range (with the format: chr:start-pos, start and pos are included). When used with --bed computes the number of reads in each window in the specified range.");
}, "Gives (in BED format) the number of reads overlapping the specified range (with the format: chr:start-pos, start and pos are included and start at 0). When used with --bed computes the number of reads in each window in the specified range.");
list->excludes(bed);
list->excludes(range_opt);
......@@ -89,7 +89,7 @@ int main(int argc, char **argv) {
size_t max = cover_chr.nb_genome_positions();
if (end_pos > max)
end_pos = max;
std::cout << chr << "\t" << start_pos << "\t" << end_pos << "\t"
std::cout << chr << "\t" << start_pos << "\t" << end_pos+1 << "\t"
<< cover_chr.count_reads_between(start_pos, end_pos)
<< std::endl;
} else if (bed_file.size() > 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment