Skip to content

Commit

Permalink
Merge branch 'replace-deprecated-headers' of https://github.com/detro…
Browse files Browse the repository at this point in the history
…ut/spp into dev
  • Loading branch information
pkharchenko committed Aug 22, 2017
2 parents 878a2a0 + c2780c4 commit 5aaeaad
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 50 deletions.
5 changes: 2 additions & 3 deletions src/Makevars.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
PKG_LIBS=@LIBS@ -lz
PKG_CFLAGS=-I./ -D_FASTMAP -DMAQ_LONGREADS @HAVE_LIBBZ2@
PKG_CXXFLAGS=-I./ -D_FASTMAP -DMAQ_LONGREADS @HAVE_LIBBZ2@ @BOOST_CPPFLAGS@

PKG_CFLAGS=-I./ -D_FASTMAP -DMAQ_LONGREADS -std=c++11 @HAVE_LIBBZ2@
PKG_CXXFLAGS=-I./ -D_FASTMAP -DMAQ_LONGREADS -std=c++11 @HAVE_LIBBZ2@ @BOOST_CPPFLAGS@
54 changes: 26 additions & 28 deletions src/bed2vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <iostream>
#include <fstream>
#include <sstream>
#include <strstream>
#include <algorithm>
#include <string>
#include <functional>
Expand All @@ -31,7 +30,6 @@ ssize_t getline_local(char **lineptr, size_t *n, FILE *stream);
}

using namespace std;
using namespace __gnu_cxx;


class lessAbsoluteValue {
Expand Down Expand Up @@ -115,7 +113,7 @@ SEXP read_bed_ends(SEXP filename) {
vector< vector<int> > pos;

// chromosome map
hash_map<string, int, hash<string>,equal_to<string> > cind_map;
unordered_map<string, int, hash<string>,equal_to<string> > cind_map;
vector<string> cnames;

typedef boost::tokenizer<boost::char_separator<char> > tokType;
Expand Down Expand Up @@ -160,7 +158,7 @@ SEXP read_bed_ends(SEXP filename) {
}

// determine the chromosome index
hash_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
unordered_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
int cind=-1;
if(li==cind_map.end()) {
// register new chromosome
Expand Down Expand Up @@ -251,7 +249,7 @@ SEXP read_meland_old(SEXP filename) {
vector< vector<int> > poslen; // length

// chromosome map
hash_map<string, int, hash<string>,equal_to<string> > cind_map;
unordered_map<string, int, hash<string>,equal_to<string> > cind_map;
vector<string> cnames;


Expand Down Expand Up @@ -293,7 +291,7 @@ SEXP read_meland_old(SEXP filename) {
int fpos=atoi(str_pos.c_str());

// determine the chromosome index
hash_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
unordered_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
int cind=-1;
if(li==cind_map.end()) {
// register new chromosome
Expand Down Expand Up @@ -429,7 +427,7 @@ SEXP read_meland_old(SEXP filename) {
vector< vector<string> > tagnames;

// chromosome map
hash_map<string, int, hash<string>,equal_to<string> > cind_map;
unordered_map<string, int, hash<string>,equal_to<string> > cind_map;
vector<string> cnames;


Expand Down Expand Up @@ -473,7 +471,7 @@ SEXP read_meland_old(SEXP filename) {
int fpos=atoi(str_pos.c_str());

// determine the chromosome index
hash_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
unordered_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
int cind=-1;
if(li==cind_map.end()) {
// register new chromosome
Expand Down Expand Up @@ -621,7 +619,7 @@ SEXP read_eland_mismatches(SEXP filename) {
vector< vector<int> > mm2; // position of the second mismatch

// chromosome map
hash_map<string, int, hash<string>,equal_to<string> > cind_map;
unordered_map<string, int, hash<string>,equal_to<string> > cind_map;
vector<string> cnames;


Expand Down Expand Up @@ -689,7 +687,7 @@ SEXP read_eland_mismatches(SEXP filename) {
}

// determine the chromosome index
hash_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
unordered_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
int cind=-1;
if(li==cind_map.end()) {
// register new chromosome
Expand Down Expand Up @@ -814,7 +812,7 @@ SEXP read_eland_mismatches(SEXP filename) {
vector< vector<string> > tagnames;

// chromosome map
hash_map<string, int, hash<string>,equal_to<string> > cind_map;
unordered_map<string, int, hash<string>,equal_to<string> > cind_map;
vector<string> cnames;


Expand Down Expand Up @@ -865,7 +863,7 @@ SEXP read_eland_mismatches(SEXP filename) {
}

// determine the chromosome index
hash_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
unordered_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
int cind=-1;
if(li==cind_map.end()) {
// register new chromosome
Expand Down Expand Up @@ -1001,7 +999,7 @@ SEXP read_eland_mismatches(SEXP filename) {
vector< vector<string> > tagnames;

// chromosome map
hash_map<string, int, hash<string>,equal_to<string> > cind_map;
unordered_map<string, int, hash<string>,equal_to<string> > cind_map;
vector<string> cnames;


Expand Down Expand Up @@ -1075,7 +1073,7 @@ SEXP read_eland_mismatches(SEXP filename) {
}

// determine the chromosome index
hash_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
unordered_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
int cind=-1;
if(li==cind_map.end()) {
// register new chromosome
Expand Down Expand Up @@ -1210,7 +1208,7 @@ SEXP read_eland_multi(SEXP filename,SEXP read_tag_names_R,SEXP eland_tag_length_
vector< vector<string> > tagnames;

// chromosome map
hash_map<string, int, hash<string>,equal_to<string> > cind_map;
unordered_map<string, int, hash<string>,equal_to<string> > cind_map;
vector<string> cnames;


Expand Down Expand Up @@ -1363,7 +1361,7 @@ SEXP read_eland_multi(SEXP filename,SEXP read_tag_names_R,SEXP eland_tag_length_
}

// determine the chromosome index
hash_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
unordered_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
int cind=-1;
if(li==cind_map.end()) {
// register new chromosome
Expand Down Expand Up @@ -1497,7 +1495,7 @@ SEXP read_eland_multi(SEXP filename,SEXP read_tag_names_R,SEXP eland_tag_length_
vector< vector<string> > tagnames;

// chromosome map
hash_map<string, int, hash<string>,equal_to<string> > cind_map;
unordered_map<string, int, hash<string>,equal_to<string> > cind_map;
vector<string> cnames;


Expand Down Expand Up @@ -1572,7 +1570,7 @@ SEXP read_eland_multi(SEXP filename,SEXP read_tag_names_R,SEXP eland_tag_length_


// determine the chromosome index
hash_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
unordered_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
int cind=-1;
if(li==cind_map.end()) {
// register new chromosome
Expand Down Expand Up @@ -1711,7 +1709,7 @@ SEXP read_eland_multi(SEXP filename,SEXP read_tag_names_R,SEXP eland_tag_length_
vector< vector<string> > tagnames;

// chromosome map
hash_map<string, int, hash<string>,equal_to<string> > cind_map;
unordered_map<string, int, hash<string>,equal_to<string> > cind_map;
vector<string> cnames;


Expand Down Expand Up @@ -1789,7 +1787,7 @@ SEXP read_eland_multi(SEXP filename,SEXP read_tag_names_R,SEXP eland_tag_length_
int nm=atoi(str_ndel.c_str())+atoi(str_nins.c_str())+atoi(str_nsub.c_str());

// determine the chromosome index
hash_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
unordered_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
int cind=-1;
if(li==cind_map.end()) {
// register new chromosome
Expand Down Expand Up @@ -1938,7 +1936,7 @@ SEXP read_eland_multi(SEXP filename,SEXP read_tag_names_R,SEXP eland_tag_length_
vector< vector<string> > tagnames;

// chromosome map
hash_map<string, int, hash<string>,equal_to<string> > cind_map;
unordered_map<string, int, hash<string>,equal_to<string> > cind_map;
vector<string> cnames;


Expand Down Expand Up @@ -1981,7 +1979,7 @@ SEXP read_eland_multi(SEXP filename,SEXP read_tag_names_R,SEXP eland_tag_length_
}

// determine the chromosome index
hash_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
unordered_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
int cind=-1;
if(li==cind_map.end()) {
// register new chromosome
Expand Down Expand Up @@ -2116,7 +2114,7 @@ SEXP read_eland_multi(SEXP filename,SEXP read_tag_names_R,SEXP eland_tag_length_
vector< vector<int> > posnm; // number of mismatches

// chromosome map
hash_map<string, int, hash<string>,equal_to<string> > cind_map;
unordered_map<string, int, hash<string>,equal_to<string> > cind_map;
vector<string> cnames;


Expand Down Expand Up @@ -2158,7 +2156,7 @@ SEXP read_eland_multi(SEXP filename,SEXP read_tag_names_R,SEXP eland_tag_length_
int nm=atoi(str_qual.c_str());

// determine the chromosome index
hash_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
unordered_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
int cind=-1;
if(li==cind_map.end()) {
// register new chromosome
Expand Down Expand Up @@ -2267,7 +2265,7 @@ SEXP read_eland_multi(SEXP filename,SEXP read_tag_names_R,SEXP eland_tag_length_
vector< vector<int> > posnm; // number of mismatches

// chromosome map
hash_map<string, int, hash<string>,equal_to<string> > cind_map;
unordered_map<string, int, hash<string>,equal_to<string> > cind_map;
vector<string> cnames;


Expand Down Expand Up @@ -2326,7 +2324,7 @@ SEXP read_eland_multi(SEXP filename,SEXP read_tag_names_R,SEXP eland_tag_length_


// determine the chromosome index
hash_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
unordered_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
int cind=-1;
if(li==cind_map.end()) {
// register new chromosome
Expand Down Expand Up @@ -2438,7 +2436,7 @@ SEXP read_eland_multi(SEXP filename,SEXP read_tag_names_R,SEXP eland_tag_length_
vector< vector<int> > poslen; // length of the match

// chromosome map
hash_map<string, int, hash<string>,equal_to<string> > cind_map;
unordered_map<string, int, hash<string>,equal_to<string> > cind_map;
vector<string> cnames;


Expand Down Expand Up @@ -2527,7 +2525,7 @@ SEXP read_eland_multi(SEXP filename,SEXP read_tag_names_R,SEXP eland_tag_length_


// determine the chromosome index
hash_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
unordered_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
int cind=-1;
if(li==cind_map.end()) {
// register new chromosome
Expand Down
6 changes: 2 additions & 4 deletions src/maqread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include <iostream>
#include <fstream>
#include <sstream>
#include <strstream>
#include <algorithm>
#include <string>
#include <functional>
Expand All @@ -20,7 +19,6 @@ extern "C" {
}

using namespace std;
using namespace __gnu_cxx;


class lessAbsoluteValue {
Expand Down Expand Up @@ -55,7 +53,7 @@ extern "C" {
vector< vector<string> > tagnames;

// chromosome map
hash_map<string, int, hash<string>,equal_to<string> > cind_map;
unordered_map<string, int, hash<string>,equal_to<string> > cind_map;
vector<string> cnames;


Expand Down Expand Up @@ -89,7 +87,7 @@ extern "C" {


// determine the chromosome index
hash_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
unordered_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
int cind=-1;
if(li==cind_map.end()) {
// register new chromosome
Expand Down
15 changes: 2 additions & 13 deletions src/pc.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
#ifndef PC_H
#define PC_H 1
#include <functional>
#include <ext/hash_map>

namespace __gnu_cxx
{
template<> struct hash< std::string >
{
size_t operator()( const std::string& x ) const
{
return hash< const char* >()( x.c_str() );
}
};
}

#include <unordered_set>
#include <unordered_map>
#endif
1 change: 0 additions & 1 deletion src/peaks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ extern "C" {
}

using namespace std;
using namespace __gnu_cxx;

/**
* Calculate all local peaks
Expand Down
1 change: 0 additions & 1 deletion src/wdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ extern "C" {
}

using namespace std;
using namespace __gnu_cxx;

//#define DEBUG 1

Expand Down

0 comments on commit 5aaeaad

Please sign in to comment.