ex_seq_io

ex_seq_io reads a SEQ file and prints its contents in FASTA format

USAGE:
./ex_seq_io 2gb1.seq

Keywords:

Categories:

  • core/data/io/read_seq

Input files:

Output files:

Program source:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <iostream>
#include <core/data/io/fasta_io.hh>
#include <core/data/io/seq_io.hh>
#include <utils/exit.hh>

std::string program_info = R"(

ex_seq_io reads a SEQ file and prints its contents in FASTA format
USAGE:
    ./ex_seq_io 2gb1.seq

)";

/** @brief Example reads SEQ file and prints the data stored there in FASTA format
 *
 * CATEGORIES: core/data/io/read_seq
 * KEYWORDS:   SEQ input; FASTA output; secondary structure
 */
int main(const int argc, const char* argv[]) {

  if(argc < 2) utils::exit_OK_with_message(program_info); // --- complain about missing program parameter

  core::data::sequence::SecondaryStructure_SP ss = core::data::io::read_seq(argv[1],"");
  ss->header(argv[1]);
  std::cout << core::data::io::create_fasta_string(*ss, 80)<<"\n";
  std::cout << core::data::io::create_fasta_secondary_string(*ss, 80)<<"\n";
}
../_images/file_icon.png