本文整理汇总了C++中ContigPaths::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ ContigPaths::push_back方法的具体用法?C++ ContigPaths::push_back怎么用?C++ ContigPaths::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContigPaths
的用法示例。
在下文中一共展示了ContigPaths::push_back方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readPaths
/** Read contig paths from the specified file.
* @param ids [out] the string ID of the paths
*/
static ContigPaths readPaths(const string& inPath,
vector<string>* ids = NULL)
{
if (ids != NULL)
assert(ids->empty());
ifstream fin(inPath.c_str());
if (opt::verbose > 0)
cerr << "Reading `" << inPath << "'..." << endl;
if (inPath != "-")
assert_good(fin, inPath);
istream& in = inPath == "-" ? cin : fin;
unsigned count = 0;
ContigPaths paths;
string id;
ContigPath path;
while (in >> id >> path) {
paths.push_back(path);
if (ids != NULL)
ids->push_back(id);
++count;
if (opt::verbose > 1 && count % 1000000 == 0)
cerr << "Read " << count << " paths. "
"Using " << toSI(getMemoryUsage())
<< "B of memory.\n";
}
if (opt::verbose > 0)
cerr << "Read " << count << " paths. "
"Using " << toSI(getMemoryUsage()) << "B of memory.\n";
assert(in.eof());
return paths;
}
示例2: mergeSeedPaths
/** Merge the specified seed paths.
* @return the merged contig paths
*/
static ContigPaths mergeSeedPaths(const Lengths& lengths,
const ContigPathMap& paths, const ContigPaths& seedPaths)
{
if (opt::verbose > 0)
cout << "\nMerging paths\n";
ContigPaths out;
out.reserve(seedPaths.size());
for (ContigPaths::const_iterator it = seedPaths.begin();
it != seedPaths.end(); ++it)
out.push_back(mergePath(lengths, paths, *it));
return out;
}
示例3: readPaths
/** Read contig paths from the specified file.
* @param[in] inPath the filename of the contig paths
* @param[out] ids the string ID of the paths
* @param[out] isAmb whether the path contains a gap
*/
static ContigPaths readPaths(const string& inPath,
vector<string>& ids, vector<bool>& isAmb)
{
typedef graph_traits<Graph>::vertex_descriptor V;
assert(ids.empty());
assert(isAmb.empty());
assert(g_ambpath_contig.empty());
ifstream fin(inPath.c_str());
if (opt::verbose > 0)
cerr << "Reading `" << inPath << "'..." << endl;
if (inPath != "-")
assert_good(fin, inPath);
istream& in = inPath == "-" ? cin : fin;
ContigPaths paths;
string id;
Path path;
while (in >> id >> path) {
paths.push_back(path);
ids.push_back(id);
isAmb.push_back(false);
if (path.size() <= 2)
continue;
for (Path::iterator it = path.begin() + 2;
it != path.end(); ++it) {
ContigPath::value_type t = it[-2], u = it[-1], v = it[0];
if (u.ambiguous()) {
assert(!t.ambiguous());
assert(!v.ambiguous());
g_ambpath_contig.insert(AmbPath2Contig::value_type(
AmbPathConstraint(t, v, u.length()),
ContigPath()));
isAmb.back() = true;
}
}
}
assert(in.eof());
return paths;
}