analyzeAlignments
Estimating sequence diversity from sequence alignments
Loading...
Searching...
No Matches
extraFunctions.hpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 Anthony J. Greenberg
3 *
4 * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5 *
6 * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7 *
8 * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9 *
10 * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11 *
12 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
13 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
14 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
15 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
16 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
17 * THE POSSIBILITY OF SUCH DAMAGE.
18 */
19
21
30#pragma once
31
32#include <unordered_map>
33#include <vector>
34#include <utility> // for std::pair
35#include <string>
36#include <cstdint>
37#include <fstream>
38
39#include "fastaParser.hpp"
40
41namespace BayesicSpace {
50 void parseCL(int &argc, char **argv, std::unordered_map<std::string, std::string> &cli);
59 void extractCLinfo(const std::unordered_map<std::string, std::string> &parsedCLI, std::unordered_map<std::string, int> &intVariables, std::unordered_map<std::string, std::string> &stringVariables);
69 void saveDiversityTable(const std::vector< std::pair< size_t, std::vector<uint32_t> > > &diversityTable, std::fstream &outFile);
82 void saveUniqueSequences(const std::unordered_map<std::string, uint32_t> &uniqueSequences, const std::string &consensus, const std::string &fileType, std::fstream &outFile);
96 void saveUniqueSequences(const std::vector< std::pair<std::string, uint32_t> > &uniqueSequences, const std::string &consensus, const std::string &fileType, std::fstream &outFile);
114 void saveUniqueSequences(const std::unordered_map<std::string, uint32_t> &uniqueSequences, const std::string &consensus,
115 const AlignmentStatistics &alignStats, const std::string &query,
116 const std::string &fileType, std::fstream &outFile);
135 void saveUniqueSequences(const std::vector< std::pair<std::string, uint32_t> > &uniqueSequences, const std::string &consensus,
136 const AlignmentStatistics &alignStats, const std::string &query,
137 const std::string &fileType, std::fstream &outFile);
138}
Class definitions for FASTA alignment parsing.
Definition extraFunctions.hpp:41
void saveUniqueSequences(const std::unordered_map< std::string, uint32_t > &uniqueSequences, const std::string &consensus, const std::string &fileType, std::fstream &outFile)
Save unique sequences.
Definition extraFunctions.cpp:106
void parseCL(int &argc, char **argv, std::unordered_map< std::string, std::string > &cli)
Command line parser.
Definition extraFunctions.cpp:38
void saveDiversityTable(const std::vector< std::pair< size_t, std::vector< uint32_t > > > &diversityTable, std::fstream &outFile)
Save the diversity table.
Definition extraFunctions.cpp:97
void extractCLinfo(const std::unordered_map< std::string, std::string > &parsedCLI, std::unordered_map< std::string, int > &intVariables, std::unordered_map< std::string, std::string > &stringVariables)
Extract parameters from parsed command line interface flags.
Definition extraFunctions.cpp:62
Collection of alignment statistics.
Definition fastaParser.hpp:47