本文整理汇总了C++中SuffixArray::MMBuildSuffixArray方法的典型用法代码示例。如果您正苦于以下问题:C++ SuffixArray::MMBuildSuffixArray方法的具体用法?C++ SuffixArray::MMBuildSuffixArray怎么用?C++ SuffixArray::MMBuildSuffixArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SuffixArray
的用法示例。
在下文中一共展示了SuffixArray::MMBuildSuffixArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
VectorIndex inFileIndex;
FASTASequence seq;
CompressedSequence<FASTASequence> compSeq;
if (read4BitCompressed == 0) {
for (inFileIndex = 0; inFileIndex < inFiles.size(); ++inFileIndex) {
FASTAReader reader;
reader.Init(inFiles[inFileIndex]);
reader.SetSpacePadding(111);
if (saBuildType == kark) {
//
// The Karkkainen sa building method requires a little extra
// space at the end of the dna sequence so that counting may
// be done mod 3 without adding extra logic for boundaries.
//
}
if (inFileIndex == 0) {
reader.ReadAllSequencesIntoOne(seq);
reader.Close();
}
else {
while(reader.ConcatenateNext(seq)) {
cout << "added " << seq.title << endl;
}
}
}
seq.ToThreeBit();
//seq.ToUpper();
}
else {
assert(inFiles.size() == 1);
cout << "reading compressed sequence." << endl;
compSeq.Read(inFiles[0]);
seq.seq = compSeq.seq;
seq.length = compSeq.length;
compSeq.RemoveCompressionCounts();
cout << "done." << endl;
}
//
// For now, do not allow creation of suffix arrays on sequences > 4G.
//
if (seq.length >= UINT_MAX) {
cout << "ERROR, references greater than " << UINT_MAX << " bases are not supported." << endl;
cout << "Consider breaking the reference into multiple files, running alignment. " << endl;
cout << "against each file, and merging the result." << endl;
exit(1);
}
vector<int> alphabet;
SuffixArray<Nucleotide, vector<int> > sa;
// sa.InitTwoBitDNAAlphabet(alphabet);
// sa.InitAsciiCharDNAAlphabet(alphabet);
sa.InitThreeBitDNAAlphabet(alphabet);
if (saBuildType == manmy) {
sa.MMBuildSuffixArray(seq.seq, seq.length, alphabet);
}
else if (saBuildType == mcilroy) {
sa.index = new SAIndex[seq.length+1];
DNALength i;
for (i = 0; i < seq.length; i++) { sa.index[i] = seq.seq[i] + 1;}
sa.index[seq.length] = 0;
ssort(sa.index, NULL);
for (i = 1; i < seq.length+1; i++ ){ sa.index[i-1] = sa.index[i];};
sa.length = seq.length;
}
else if (saBuildType == larsson) {
sa.LarssonBuildSuffixArray(seq.seq, seq.length, alphabet);
}
else if (saBuildType == kark) {
sa.index = new SAIndex[seq.length];
seq.ToThreeBit();
DNALength p;
for (p = 0; p < seq.length; p++ ){ seq.seq[p]++; }
KarkkainenBuildSuffixArray<Nucleotide>(seq.seq, sa.index, seq.length, 5);
sa.length = seq.length;
}
else if (saBuildType == mafe) {
// sa.MaFeBuildSuffixArray(seq.seq, seq.length);
}
else if (saBuildType == welter) {
if (diffCoverSize == 0) {
sa.LightweightBuildSuffixArray(seq.seq, seq.length);
}
else {
sa.LightweightBuildSuffixArray(seq.seq, seq.length, diffCoverSize);
}
}
if (doBLT) {
sa.BuildLookupTable(seq.seq, seq.length, bltPrefixLength);
}
sa.Write(saFile);
return 0;
}