Yurttas/PL/OOL/Cplusplus/F/07/03/02/01/00/dna counts 00.cpp

From ZCubes Wiki
Jump to navigation Jump to search
 1/*
 2   Copyright(C) 2005
 3   All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
 4
 5   Permission to use, copy, modify, and distribute this
 6   software and its documentation for EDUCATIONAL purposes
 7   and without fee is hereby granted provided that this
 8   copyright notice appears in all copies.
 9
10   date   : September 1, 2005.
11   author : Salih Yurttas.
12
13   dna_counts_00.cpp
14*/
15
16
17#include "parameters.h"
18#include "f_specs.h"
19
20int main(int argc, char* argv[]) {
21
22  do {
23    string filename = get_string("dna filenames : ");
24
25    vector<string> filenames = get_data(filename);
26
27    int n = filenames.size();
28    for(int i=0; i<n; ++i) {
29      string filename = filenames.at(i);
30
31      vector<string> given = get_data(filename);
32
33      given = to_upper_sequence(given);
34
35      vector<int> counts = count(given);
36
37      multimap< string, int, less<string> > dna_counts = construct_map(given,
38                                                                       counts);
39
40      print_dna_counts_list(filename,
41                            dna_counts);
42    }
43  }
44  while((YN)(toupper(get_char("Yes|No")))=='Y');
45
46}