process->add_option("-T,--threads",parameters.n_threads,"Number of threads to use",true)->check(CLI::Range(1,9999));
process->add_option("-d,--min-depth",parameters.min_depth,"Minimum depth in at least one individual to retain a marker",true)->check(CLI::Range(1,9999));
// ProcessTagged subcommand parser
CLI::App*processTagged=parser.add_subcommand("processTagged","Compute a table of marker depths from a set of demultiplexed reads files containing tags");
processTagged->add_option("-i,--input-dir",parameters.input_dir_path,"Path to a directory contains demultiplexed sequence files")->required()->check(CLI::ExistingDirectory);
processTagged->add_option("-o,--output-file",parameters.output_file_path,"Path to the output file (table of marker depths in each individual)")->required();
processTagged->add_option("-p,--popmap",parameters.popmap_file_path,"Path to a tabulated file specifying groups for all individuals (population map)")->required()->check(CLI::ExistingFile);
processTagged->add_option("-T,--threads",parameters.n_threads,"Number of threads to use",true)->check(CLI::Range(1,9999));
processTagged->add_option("-d,--min-depth",parameters.min_depth,"Minimum depth in at least one individual to retain a marker",true)->check(CLI::Range(1,9999));
// Signif subcommand parser
CLI::App*signif=parser.add_subcommand("signif","Extract markers significantly associated with phenotypic group from a marker depths table");
signif->add_option("-t,--markers-table",parameters.markers_table_path,"Path to a marker depths table generated by \"process\"")->required()->check(CLI::ExistingFile);
...
...
@@ -228,6 +238,10 @@ int main(int argc, char* argv[]) {
* RADSex is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* RADSex is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with RADSex. If not, see <https://www.gnu.org/licenses/>.
*/
/*!
* @file process.h
* @brief Defines function for the "process" command generating a markers depth table from individual reads files .
*/
#pragma once
#include <dirent.h>
#include <iostream>
#include <mutex>
#include <string>
#include <thread>
#include <unordered_map>
#include <zlib.h>
#include "kseq/kseq.h"
#include "parameters.h"
#include "utils.h"
#include "popmap.h"
conststd::vector<std::string>fextensions{".fq.gz",".fq",".fastq.gz",".fastq",".fasta.gz",".fasta",".fa.gz",".fa",".fna.gz",".fna"};///< List of extensions for currently supported file types
/*!
* \brief InputFile struct
*
* Store information about an input reads file.
*/
structtaggedInputFile{
std::stringindividual_name;///< Name of the individual, inferred from the file name
std::stringtag;// a tag associated with this sample
uintmaxTagLength;// this info will help to get seq. of the same size between individuals with different tag size
std::stringpath;///< File path
std::stringextension;///< File extension (supported extensions are defined in \link extensions \endlink
boolprocessed=false;///< If true, the file has already been processed
};
/*!
* \brief Get input files
*
* Detect all input files in the input directory based on extensions and store file information in a InputFile vector.
*
* \param input_dir_path Path to the input directory
*
* \return A vector of InputFile objects, each containing information about an input file