ex_DsspData

ex_DsspData reads a DSSP file and writes secondary structure in FASTA format

USAGE:
ex_DsspData 5edw.dssp

Categories:

  • core/data/io/DsspData

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
28
29
#include <iostream>
#include <core/data/io/fasta_io.hh>
#include <core/data/io/DsspData.hh>
#include <utils/exit.hh>

std::string program_info = R"(

ex_DsspData reads a DSSP file and writes secondary structure in FASTA format
USAGE:
    ex_DsspData 5edw.dssp

)";

/** @brief Reads a DSSP file and prints the sequence and the secondary structure of each chain in FASTA format.
 *
 * @see ex_dssp_to_ss2.cc converts DSSP to SS2 format
 *
 * CATEGORIES: core/data/io/DsspData
 * KEYWORDS:   DSSP input; FASTA output; Structure; secondary structure; Format convertion
 */
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::io::DsspData dssp(argv[1], true);  // --- read a DSSP file - the first command line argument of the program
  for (const auto & ss2 : dssp.create_sequences()) // --- for each protein sequence found in the DSSP data ...
    std::cout << core::data::io::create_fasta_string(ss2, 80) << "\n" // --- print the sequence as FASTA
        << core::data::io::create_fasta_secondary_string(ss2, 80) << "\n";  // --- print the secondary structure as FASTA
}
../_images/file_icon.png