00001 #include "gn/gnFASSource.h" 00002 #include "gn/gnSequence.h" 00003 #include "gn/gnTranslator.h" 00004 #include "gn/gnStringSpec.h" 00005 #include <fstream> 00006 int main( int argc, char* argv[] ) 00007 { 00008 gnSequence erwinia_junk; 00009 gnSequence pruned_bush; 00010 string sequence_name = "mouse_small.fas"; 00011 string output_sequence = "mouse_filt.fas"; 00012 // cout << "Enter the name of the sequence file you want contig info on.\n"; 00013 // cin >> sequence_name; 00014 try{ 00015 erwinia_junk.LoadSource( sequence_name ); 00016 for(uint32 contigI = 0; contigI < erwinia_junk.contigListSize(); contigI++){ 00017 cout << erwinia_junk.contigName( contigI ) << '\t' << erwinia_junk.contigLength( contigI ) << '\n'; 00018 if( erwinia_junk.contigLength( contigI ) > 1000 ) 00019 pruned_bush += erwinia_junk.contig( contigI ); 00020 } 00021 gnFASSource::Write(pruned_bush, output_sequence); 00022 }catch(gnException& gne){ 00023 cout << gne << "\n"; 00024 } 00025 /* 00026 ifstream gbk1("cpneuJ.gbk"); 00027 ifstream gbk2("test_rc.gbk"); 00028 00029 uint32 badline = 0; 00030 char buf[30000]; 00031 char buf2[30000]; 00032 while(gbk1.good() && gbk2.good()){ 00033 gbk1.getline(buf, 30000); 00034 gbk2.getline(buf2, 30000); 00035 if(strcmp(buf, buf2)){ 00036 cout << "mismatched line: " << badline << "\n"; 00037 cout << buf << endl << buf2 << endl; 00038 cout << "Length 1: " << strlen(buf) << " Length 2: " << strlen(buf2) << endl; 00039 cin >> buf; 00040 } 00041 badline++; 00042 } 00043 */ 00044 /* gnStringSpec s(""); 00045 cout <<s.GetLength()<<endl; 00046 00047 gnSequence t = "ACTATATA"; 00048 if(t == string("TATATA")){ 00049 cout << "ASDFASDFSADF"; 00050 }*/ 00051 } 00052 /* // define a string to store the sequence file name 00053 00054 string filename; 00055 string nseq,pseq; 00056 // define a gnSequence to store the sequence 00057 gnSequence file_sequence; 00058 gnSequence prot_trans; 00059 00060 //nseq = "BXXBXXBXXBXXBXXBXXBXXBXXBXXBXXBXXBXXBXXBXXBXXBXXBXXBXXBXXBXXBXXBXX"; 00061 //nseq = "WSTYYYBBB"; 00062 //nseq="ATGCUXGCNGGGTATGAATEQILPFP"; 00063 //nseq="ATGGTXAGCGGNTAR"; 00064 cout<<nseq<<" (original)----> \n"; 00065 gnSequence aSeq(nseq); 00066 cout<<aSeq<<" (gnSequence)----> \n"; 00067 00068 gnTranslator::ProteinDNAConverter->ToProtein(nseq); 00069 00070 cout << nseq << '\n';; 00071 00072 00073 00074 00075 // prot_trans.append(nseq); 00076 // output the first ten bases of the sequence 00077 // cout << prot_trans.subseq(1,10); 00078 00079 return 0; 00080 00081 } 00082 00083 /*#include "gn/gnSequence.h" 00084 #include <iostream> 00085 #include <string> 00086 #include "gn/gnTranslator.h" 00087 #include "gn/gnFASSource.h" 00088 00089 int main(int argc, char* argv[]){ 00090 gnSequence gps; 00091 string seq_filename; 00092 string out_filename; 00093 00094 /* Get the name of the dnx file to convert to FastA / 00095 cout << "Debug-o-matic!\n"; 00096 cout << "Please give the name of the fof to test: "; 00097 cin >> seq_filename; 00098 00099 gps.LoadSource(seq_filename); 00100 00101 cout << "Output filename: "; 00102 cin >> out_filename; 00103 gnFASSource::Write(gps, out_filename); 00104 00105 return 0; 00106 00107 }*/