예제 #1
0
int main() {
  const string ref   = "CAGCCTTTCTGACCCGGAAATCAAAATAGGCACAACAAA";
  const string query = "CTGAGCCGGTAAATC";

  // Declares a default Aligner
  StripedSmithWaterman::Aligner aligner;
  // Declares a default filter
  StripedSmithWaterman::Filter filter;
  // Declares an alignment that stores the result
  StripedSmithWaterman::Alignment alignment;
  // Aligns the query to the ref
  aligner.Align(query.c_str(), ref.c_str(), ref.size(), filter, &alignment);

  PrintAlignment(alignment);
  
  return 0;
}
예제 #2
0
TEST(Alignment, SpeedTest) {
	const std::string seq = "ATCTACTGACGCTGCTGCTGGTCTGCTGCTCCTCGCTGCCCAGCCGGCGATGGCTAGCTCCTATGAGCTGACTCAGCCGCCCTCCCTCTCTGCATCTCCGGGATCATCTGTCAGACTCGCCTGCA";
	const std::string ref = "CAGGTTCAGCTGGTGCAGTCTGGAGCTGAGGTGAAGAAGCCTGGGGCCTCAGTGAAGGTCTCCTGCAAGGCTTCTGGTTACACCTTTACCAGCTATGGTATCAGCTGGGTGCGACAGGCCCCTGGACAAGGGCTTGAGTGGATGGGATGGATCAGCGCTTACAATGGTAACACAAACTATGCACAGAAGCTCCAGGGCAGAGTCACCATGACCACAGACACATCCACGAGCACAGCCTACATGGAGCTGAGGAGCCTGAGATCTGACGACACGGCCGTGTATTACTGTGCGAGAGA";

	StripedSmithWaterman::Aligner aligner;
	StripedSmithWaterman::Filter filter;
	StripedSmithWaterman::Alignment alignment;

	aligner.SetReferenceSequence(ref.c_str(), ref.length());

	clock_t start = clock();
	for (int i = 0; i < ITERS; ++i) {
		aligner.Align(seq.c_str(), filter, &alignment);
	}
	clock_t ends = clock();
	LOG4CXX_INFO(logger, "Processor Time Spent for " << ITERS << " alignments: " << (double) (ends - start) / CLOCKS_PER_SEC << " seconds.");
}