Slice Tools libSlice |
SliceDataExample.ccSimple demonstration using C++ interface to libSlice.Demonstrates how to use the various functions provided by the C++ facade. #include <list> #include <SliceData.hh> int main (int argc, char ** argv) { libSlice::ReadManager r; r.addReadData("DMGLN85TF", "", "Forward", ""); r.addReadData("DMGHB30TR", "", "Reversed", ""); r.addReadData("DMGIC39TF", "", "Forward", ""); r.addReadData("DMGRA39TR", "", "Reversed", ""); libSlice::SliceData s1(r, "Location 1", "", ""); libSlice::SliceData s2(r, "Location 2", "", ""); libSlice::SliceData s3(r, "Location 3", "", ""); s1.addNuc("AATC"); s1.addReadId("DMGHB30TR DMGRA39TR DMGLN85TF DMGIC39TF"); s1.addQualVal("30 25 20 15"); s2.addNuc("TTTT"); s2.addReadId("DMGHB30TR DMGLN85TF DMGRA39TR DMGIC39TF"); s2.addQualVal("30 30 20 15"); s3.addNuc("CTCT"); s3.addReadId("DMGHB30TR DMGRA39TR DMGLN85TF DMGIC39TF"); s3.addQualVal("30 30 30 30"); list<libSlice::SliceData> slicelist; slicelist.push_back(s1); slicelist.push_back(s2); slicelist.push_back(s3); try { list<libSlice::SliceData>::iterator i; for (i = slicelist.begin(); i != slicelist.end(); i++) { i->print(cout); libSlice::ConsensusData result = i->doCalculations(); cout << endl << "Consensus is " << result.getConsensus() << endl << "Quality Base is " << result.getConsensusBase() << endl << "Quality Class is " << result.getQualityClass() << endl << "Quality Value is " << result.getQualityValue() << endl; cout << "[qvA=" << result.getQualityValue('A') << " qvC=" << result.getQualityValue('C') << " qvG=" << result.getQualityValue('G') << " qvT=" << result.getQualityValue('T') << " qvGap=" << result.getQualityValue('-') << "]" << endl; cout << endl; } } catch (const Exception & e) { cerr << e << endl; return 10; } return 0; } |