ap_reorder_profile_columns

ap_reorder_profile_columns reads a sequence profile (ASN.1 file format) and shuffles profile’s columns as requested. Resulting profile is writen in text format

USAGE:
./ap_reorder_profile_columns input.asn1

Keywords:

Categories:

  • core::data::sequence::SequenceProfile

Input 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
28
29
30
31
32
33
34
35
36
#include <iostream>

#include <core/chemical/Monomer.hh>
#include <core/data/sequence/SequenceProfile.hh>
#include <utils/exit.hh>
#include <utils/io_utils.hh>

std::string program_info = R"(

ap_reorder_profile_columns reads a sequence profile (ASN.1 file format) and shuffles profile's columns as requested.
Resulting profile is writen in text format
USAGE:
    ./ap_reorder_profile_columns input.asn1

)";

// small aromatic positive negative other-polar
const std::string nice_order = "GAP"  "VILMC"  "HWFY"  "KR"  "QD"  "NQST";

/** @brief Reads a sequence profile (ASN.1 file format) and shuffles profile's columns
 *
 * CATEGORIES: core::data::sequence::SequenceProfile
 * KEYWORDS:   output file; sequence profile
 */
int main(const int argc, const char* argv[]) {

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

  using namespace core::data::io;
  using namespace core::data::sequence;

  std::string order_string = (argc>2) ? argv[2] : nice_order;
  SequenceProfile_SP profile_in = core::data::sequence::read_ASN1_checkpoint(argv[1]);
  SequenceProfile_SP profile_out = profile_in->create_reordered(order_string);
  profile_out->write_table(std::cout);
}
../_images/file_icon.png