~ubuntu-branches/ubuntu/saucy/abyss/saucy

« back to all changes in this revision

Viewing changes to ParseAligns/ParseAligns.cpp

  • Committer: Package Import Robot
  • Author(s): Shaun Jackman
  • Date: 2011-09-11 10:00:13 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: package-import@ubuntu.com-20110911100013-oa4m5fi036mjuwc8
Tags: 1.3.0-1
* New upstream release.
* Add libboost-graph-dev to Build-Depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
#include "Estimate.h"
3
3
#include "Histogram.h"
4
4
#include "IOUtil.h"
 
5
#include "MemoryUtil.h"
5
6
#include "SAM.h"
6
7
#include "StringUtil.h" // for toSI
7
8
#include "Uncompress.h"
18
19
#include <iterator>
19
20
#include <sstream>
20
21
#include <string>
21
 
#include <unistd.h> // for sbrk
22
22
#include <vector>
23
23
 
24
24
using namespace std;
51
51
"Report bugs to <" PACKAGE_BUGREPORT ">.\n";
52
52
 
53
53
namespace opt {
54
 
        static unsigned k;
 
54
        unsigned k; // used by DistanceEst
55
55
        static unsigned c;
56
56
        static int verbose;
57
57
        static string distPath;
62
62
        static int inputFormat;
63
63
        enum { KALIGNER, SAM };
64
64
 
65
 
        int dot; // used by Estimate
 
65
        /** Output format */
 
66
        int format = ADJ; // used by Estimate
66
67
}
67
68
 
68
69
static const char shortopts[] = "d:k:f:h:c:v";
359
360
        }
360
361
}
361
362
 
362
 
/** Start of the data segment. */
363
 
static intptr_t sbrk0 = reinterpret_cast<intptr_t>(sbrk(0));
364
 
 
365
363
static void printProgress(const ReadAlignMap& map)
366
364
{
367
365
        if (opt::verbose == 0)
373
371
 
374
372
        size_t buckets = map.bucket_count();
375
373
        if (stats.alignments % 1000000 == 0 || buckets != prevBuckets) {
376
 
                ptrdiff_t bytes = reinterpret_cast<intptr_t>(sbrk(0)) - sbrk0;
377
374
                prevBuckets = buckets;
378
375
                size_t size = map.size();
379
376
                cerr << "Read " << stats.alignments << " alignments. "
380
377
                        "Hash load: " << size << " / " << buckets
381
378
                        << " = " << (float)size / buckets
382
 
                        << " using " << toSI(bytes) << "B." << endl;
 
379
                        << " using " << toSI(getMemoryUsage()) << "B." << endl;
383
380
        }
384
381
}
385
382