Skip to content

Commit

Permalink
Usage of boost::split completely replaced by strpbrk wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristina Yenyxe Gonzalez Garcia committed Jun 8, 2015
1 parent 6982fc1 commit 3cf61da
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions inc/util/string_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#ifndef STRING_UTILS_HPP
#define STRING_UTILS_HPP

#include <cstring>
#include <string>
#include <vector>

Expand Down
1 change: 0 additions & 1 deletion inc/vcf/record.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

#include <iostream>

#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/math/special_functions/binomial.hpp>
#include <boost/regex.hpp>
Expand Down
4 changes: 2 additions & 2 deletions inc/vcf/validator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
#include <string>
#include <vector>

#include <boost/algorithm/string.hpp>

#include "file_structure.hpp"
#include "util/string_utils.hpp"


namespace opencb
{
Expand Down
3 changes: 2 additions & 1 deletion src/vcf/store_parse_policy.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "vcf/validator.hpp"
#include "util/string_utils.hpp"

namespace opencb
{
Expand Down Expand Up @@ -147,7 +148,7 @@ namespace opencb
std::map<std::string, std::string> info;
for (auto & field : m_line_tokens["INFO"]) {
std::vector<std::string> subfields;
boost::split(subfields, field, boost::is_any_of("="));
util::string_split(field, "=", subfields);
if (subfields.size() > 1) {
info.emplace(subfields[0], subfields[1]);
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/vcf/validate_optional_policy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ namespace opencb
size_t i = 1;
for (auto & sample : record.samples) {
std::vector<std::string> subfields;
boost::split(subfields, sample, boost::is_any_of(":"));
util::string_split(sample, ":", subfields);
std::vector<std::string> alleles;
boost::split(alleles, subfields[0], boost::is_any_of("|,/"));
util::string_split(subfields[0], "|/", alleles);

if (ploidy > 0) {
if (alleles.size() != ploidy) {
Expand Down

0 comments on commit 3cf61da

Please sign in to comment.