File: titin-test.cpp

package info (click to toggle)
isospec 2.3.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,472 kB
  • sloc: cpp: 9,530; python: 2,095; makefile: 180; ansic: 100; sh: 88
file content (35 lines) | stat: -rw-r--r-- 1,106 bytes parent folder | download | duplicates (4)
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
#include <iostream>
#include "isoSpec++.h"
#include "summator.h"

using namespace IsoSpec;

int main()
{

    Summator s;
//    unsigned int cnt_tot = 0;
//    int total_t = 10;
    double threshold = 0.01;
//    double mmin = 3815900.0;
//    double mmax = 3816000.0;
    double mmin = -100000000000.0;
    double mmax = 100000000000.0;
    const char formula[] = "C169719H270464N45688O52237S911";
//    const char formula[] = "H2O1";
//    const char formula[] = "C63H98N18O13S1"; // substance P
//    const char formula[] = "C520H817N139O147S8"; // Human insulin
    IsoThresholdGenerator* iso = new IsoThresholdGenerator(formula, threshold, false);
    size_t cnt = 0;
    std::cout << "Pre-calculation estimate of confs no:" << iso->count_confs() << std::endl;
    while(iso->advanceToNextConfiguration())
    {
        if(iso->mass() >= mmin and mmax >= iso->mass())
            cnt++;
        s.add(iso->prob());
    }
    delete iso;

    std::cout <<  "The isotopologue set above selected threshold has: " << cnt << " element(s)" << std::endl;
    std::cout << "prob: " << s.get() << std::endl;
}