src/lib/io.hpp
// Write sequence in ali and fasta files
Write sequence in ali and fasta files
Write sequence in ali and fasta files
void write_sequence(std::string const &output_filename, std::string const &name,
    std::string const &dna_str, bool fasta = false) {
    std::ofstream ali_file;
    ali_file.open(output_filename + ".ali", std::ios_base::app);
    ali_file << name << " " << dna_str << std::endl;
    ali_file.close();
    if (!fasta) { return; }
    std::ofstream fasta_file;
    fasta_file.open(output_filename + ".fasta", std::ios_base::app);
    fasta_file << ">" << name << std::endl << dna_str << std::endl;
    fasta_file.close();
}
void write_sequence ( std :: string const & output_filename , std :: string const & name , std :: string const & dna_str , bool fasta = false ) { std :: ofstream ali_file ; ali_file . open ( output_filename + " " , std :: ios_base :: app ) ; ali_file << name << " " << dna_str << std :: endl ; ali_file . close ( ) ; if ( ! fasta ) { return ; } std :: ofstream fasta_file ; fasta_file . open ( output_filename + " " , std :: ios_base :: app ) ; fasta_file << " " << name << std :: endl << dna_str << std :: endl ; fasta_file . close ( ) ; }
Write sequence in ali and fasta files
Write sequence in ali and fasta files
// .ali format // .fasta format