From: Derek Date: Wed, 26 May 2010 20:16:03 +0000 (-0400) Subject: Removed BamConversionMain.cpp and BamDumpMain.cpp. No longer needed if toolkit available. X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=cebdcc01b264653dc17227b6b2391645661e978a;p=bamtools.git Removed BamConversionMain.cpp and BamDumpMain.cpp. No longer needed if toolkit available. --- diff --git a/BamConversionMain.cpp b/BamConversionMain.cpp deleted file mode 100644 index 51693b6..0000000 --- a/BamConversionMain.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include -#include "BamReader.h" -#include "BamWriter.h" -using namespace BamTools; -using namespace std; - -int main(int argc, char* argv[]) { - - if(argc != 3) { - cout << "USAGE: " << argv[0] << " " << endl; - exit(1); - } - - // localize our arguments - const char* inputFilename = argv[1]; - const char* outputFilename = argv[2]; - - // open our BAM reader - BamReader reader; - reader.Open(inputFilename); - - // retrieve the SAM header text - string samHeader = reader.GetHeaderText(); - - // retrieve the reference sequence vector - RefVector referenceSequences = reader.GetReferenceData(); - - // open the BAM writer - BamWriter writer; - writer.Open(outputFilename, samHeader, referenceSequences); - - // copy all of the reads from the input file to the output file - BamAlignment al; - while(reader.GetNextAlignment(al)) writer.SaveAlignment(al); - - // close our files - reader.Close(); - writer.Close(); - - return 0; -} diff --git a/BamDumpMain.cpp b/BamDumpMain.cpp deleted file mode 100644 index 5611c3b..0000000 --- a/BamDumpMain.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// *************************************************************************** -// BamDump.cpp (c) 2009 Derek Barnett -// Marth Lab, Department of Biology, Boston College -// All rights reserved. -// --------------------------------------------------------------------------- -// Last modified: 15 July 2009 (DB) -// --------------------------------------------------------------------------- -// Spits out all alignments in BAM file. -// -// N.B. - Could result in HUGE text file. This is mostly a debugging tool -// for small files. You have been warned. -// *************************************************************************** - -// Std C/C++ includes -#include -#include -#include -using namespace std; - -// BamTools includes -#include "BamReader.h" -#include "BamWriter.h" -using namespace BamTools; - -void PrintAlignment(const BamAlignment&); - -int main(int argc, char* argv[]) { - - // validate argument count - if( argc != 2 ) { - cerr << "USAGE: " << argv[0] << " " << endl; - exit(1); - } - - string filename = argv[1]; - cout << "Printing alignments from file: " << filename << endl; - - BamReader reader; - reader.Open(filename); - - BamAlignment bAlignment; - while (reader.GetNextAlignment(bAlignment)) { - PrintAlignment(bAlignment); - } - - reader.Close(); - return 0; -} - -// Spit out basic BamAlignment data -void PrintAlignment(const BamAlignment& alignment) { - cout << "---------------------------------" << endl; - cout << "Name: " << alignment.Name << endl; - cout << "Aligned to: " << alignment.RefID; - cout << ":" << alignment.Position << endl; - cout << endl; -}