TestRevComp.cpp Source File

Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# TestRevComp.cpp

Go to the documentation of this file.

    00001 #include "gn/gnSourceFactory.h"
    00002 #include "gn/gnFASSource.h"
    00003 #include "gn/gnDNXSource.h"
    00004 #include "gn/gnSEQSource.h"
    00005 #include "gn/gnSequence.h"
    00006 #include <iostream>
    00007 #include <fstream>
    00008
    00009 #include "gn/gnFilter.h"
    00010
    00011 int main( int32 argc, char* argv[])
    00012 {
    00013
    00014         argc; argv;
    00015
    00016         string filename;
    00017         cout << "Enter a filename to read bases from.\n";
    00018         cin >> filename;
    00019         cout << "Opening " + filename + "\n";
    00020         gnSequence gnseq, smallseq;
    00021         if(gnseq.LoadSource(filename))
    00022                 cout << "Sequence has " << gnseq.length() << " base pairs.\n";
    00023
    00024         smallseq = gnseq.subseq(3836480, 10);
    00025         cout << smallseq;
    00026         string dump;
    00027         cin >> dump;
    00028
    00029         cout << "Give a file name to output reverse complement data: ";
    00030         string outfilename;
    00031         cin >> outfilename;
    00032         cout << "Bases are:\n";
    00033 //      cout << gpseq;
    00034         cout << "\nComplement Bases are:\n";
    00035         gnBaseSpec* gpbs = gnseq.GetSpec();
    00036         gpbs->SetReverseComplement(true);
    00037 //      cout << gpseq << "\n";
    00038
    00039         gnFASSource::Write(gnseq, outfilename);
    00040 //      gnGBKSource::Write(gpbs, "testfile.seq");
    00041 //      gnDNXSource::Write(gpbs, "testfile.dnx");
    00042
    00043         cout << "All done.  RevComp is in " << outfilename << "\n";
    00044         char bubba[50];
    00045         cin >> bubba;
    00046 }