Commit 7fa84ee6 authored by Romain Feron's avatar Romain Feron
Browse files

Updated command line interface to match doc

parent b8effb59
......@@ -89,7 +89,21 @@ void mapping(Parameters& parameters) {
uint min_males = uint(min_frequency * n_males_total) - 1; // -1 allows comparison with > instead of >=
uint min_females = uint(min_frequency * n_females_total) - 1; // -1 allows comparison with > instead of >=
// BWA index
// Generate BWA index if it does not exist
std::ifstream bwa_index_temp;
bool indexed = true;
std::string extensions[5] = {"amb", "ann", "bwa", "pac", "sa"};
for (auto i=0; i<5; ++i) {
bwa_index_temp.open(genome_file_path + "." + extensions[i]);
if (not bwa_index_temp.is_open()) indexed = false;
}
if (not indexed) {
bwa_idx_build(genome_file_path.c_str(), genome_file_path.c_str(), 0, 10000000); // Genome file, prefix, algorithm (default 0), block size (default 10000000)
}
// Load BWA index
bwaidx_t *index; // BWA index read from indexed file
std::cout << " - Loading BWA index file ..." << std::endl;
......
......@@ -26,8 +26,8 @@ class RadSex {
// Define all analyses
// Analysis constructor: Analysis(name, description, parameters, function ref)
std::map<std::string, Analysis> analyses { {"sex_distribution",
Analysis("sex_distribution",
std::map<std::string, Analysis> analyses { {"distrib",
Analysis("distrib",
"Compute a matrix of sequences distribution between sexes",
std::vector<std::string> {"input_file_path",
"output_file_path",
......@@ -35,8 +35,8 @@ class RadSex {
"min_cov",
"output_matrix"},
sex_distribution)},
{"process_reads",
Analysis("process_reads",
{"process",
Analysis("processreads",
"Compute a matrix of coverage from a set of demultiplexed reads files",
std::vector<std::string> {"input_dir_path",
"output_file_path",
......@@ -57,15 +57,15 @@ class RadSex {
"min_individuals",
"max_individuals"},
subset)},
{"frequencies",
Analysis("frequencies",
{"freq",
Analysis("freq",
"Calculate the frequency of markers in the population",
std::vector<std::string> {"input_file_path",
"output_file_path",
"min_cov"},
frequencies)},
{"group_loci",
Analysis("group_loci",
{"loci",
Analysis("loci",
"Recreate polymorphic loci from a subset of coverage matrix",
std::vector<std::string> {"input_file_path",
"coverage_matrix_path",
......@@ -74,8 +74,8 @@ class RadSex {
"n_threads",
"min_cov"},
group_loci)},
{"significant_sequences",
Analysis("significant_sequences",
{"signif",
Analysis("signif",
"Extract sequences significantly associated with sex from the coverage matrix.",
std::vector<std::string> {"input_file_path",
"output_file_path",
......@@ -83,8 +83,8 @@ class RadSex {
"min_cov"},
significant_sequences)},
{"mapping",
Analysis("mapping",
{"map",
Analysis("map",
"Map a subset of sequences (coverage table or fasta format) to a reference genome.",
std::vector<std::string> {"input_file_path",
"output_file_path",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment