Author: tille Date: 2014-02-14 13:47:41 +0000 (Fri, 14 Feb 2014) New Revision: 16047
Added: trunk/packages/unc-fish/trunk/debian/patches/ngopt.patch Modified: trunk/packages/unc-fish/trunk/debian/patches/series Log: Patch taken from ngopt at http://code.google.com/p/ngopt/source/browse/#svn%2Ftrunk%2FFISH%2Fsrc Without this patch the original code segfaults with the sample data set. However, the code is not only fixing a code problem but also does some other change of functionality - so the test data can not be reproduced with this patch. Added: trunk/packages/unc-fish/trunk/debian/patches/ngopt.patch =================================================================== --- trunk/packages/unc-fish/trunk/debian/patches/ngopt.patch (rev 0) +++ trunk/packages/unc-fish/trunk/debian/patches/ngopt.patch 2014-02-14 13:47:41 UTC (rev 16047) @@ -0,0 +1,227 @@ +Author: Andreas Tille <[email protected]> +Last-Changed: Fri, 14 Feb 2014 09:23:04 +0100 +Description: Patch taken from ngopt at + http://code.google.com/p/ngopt/source/browse/#svn%2Ftrunk%2FFISH%2Fsrc + Without this patch the original code segfaults with the sample data set. + However, the code is not only fixing a code problem but also does some other + change of functionality - so the test data can not be reproduced with this + patch. + +--- a/src/blocks.h ++++ b/src/blocks.h +@@ -69,6 +69,8 @@ if(PRINT_BLOCK) + int tempdist=0; + ofstream p2b; + p2b.open(Block_File.c_str(),ios::out); ++/* Lets make the output easier to parse. ++ * Get rid of this stuff first. + p2b<<get_time_stamp()<<""; + p2b<<"FISH v1.0\n"; + p2b<<"FISH is copyright (c)2003, University of North Carolina at Chapel Hill\n"; +@@ -79,15 +81,17 @@ if(PRINT_BLOCK) + p2b<<"\ttotal_features = "<<Total_Features<<"\n\ttotal_cells = "<<Total_Cells<<"\n"; + p2b<<"\th = "<<prob<<"\n\td_T = "<<Thresh_Dist<<"\n\tMin_Block_Size = "<<Min_Block_Size; + p2b<<"\n\tblock_prob = "<<BLOCK_PROB<<"\n\ttotal_blocks = "<<block_list.size()<<"\n\n\n"; +- ++*/ ++ // make the output tab-delimited ++ p2b<<"contig1\tcontig2\tblock\tpoint\tdist\tmarkers\torientation"<<endl; + for(i=0;i<block_list.size();i++) + { + + dataj=block_list[i].block.begin(); +- p2b<<"-block "<<i<<endl; +- p2b<<setw(10)<<"points"<<setw(10)<<"contig1"<<setw(10)<<"contig2"<<endl; +- p2b<<setw(9)<<block_list[i].block.size()<<setw(9)<<MATCHES[*dataj].contig1<<setw(9)<<MATCHES[*dataj].contig2<<"\n\n"; +- p2b<<"\tpoint\tdist\tmarkers\torientation"<<endl; ++ // p2b<<"-block "<<i<<endl; ++ // p2b<<setw(10)<<"points"<<setw(10)<<"contig1"<<setw(10)<<"contig2"<<endl; ++ // p2b<<setw(9)<<block_list[i].block.size()<<setw(9)<<MATCHES[*dataj].contig1<<setw(9)<<MATCHES[*dataj].contig2<<"\n\n"; ++ // p2b<<"block\tpoint\tdist\tmarkers\torientation"<<endl; + + tempy=MATCHES[*dataj].feat.y; + tempx=MATCHES[*dataj].feat.x; +@@ -96,35 +100,44 @@ if(PRINT_BLOCK) + { + tempdist=(MATCHES[*dataj].feat.y-tempy)+abs(MATCHES[*dataj].feat.x-tempx); + +- p2b<<"\t"<<*dataj<<"\t"<<tempdist<<"\t{"; +- +- for(j=0;j<f2g[MATCHES[*dataj].feat.y].gene_list.size();j++) +- p2b<<f2g[MATCHES[*dataj].feat.y].gene_list[j]<<" "; ++ p2b<<MATCHES[*dataj].contig1<<"\t"<<MATCHES[*dataj].contig2<<"\t"<<i<<"\t"<<*dataj<<"\t"<<tempdist<<"\t"; + +- p2b<<"}{"; ++ for(j=0;j<f2g[MATCHES[*dataj].feat.y].gene_list.size();j++){ ++ p2b<<f2g[MATCHES[*dataj].feat.y].gene_list[j]; ++ if (j < f2g[MATCHES[*dataj].feat.y].gene_list.size() - 1) ++ p2b <<","; ++ } ++ p2b<<"\t"; ++ // p2b<<"}{"; ++ ++ for(j=0;j<f2g[MATCHES[*dataj].feat.x].gene_list.size();j++){ ++ p2b<<f2g[MATCHES[*dataj].feat.x].gene_list[j]; ++ if (j < f2g[MATCHES[*dataj].feat.x].gene_list.size() - 1) ++ p2b << ","; ++ } + +- for(j=0;j<f2g[MATCHES[*dataj].feat.x].gene_list.size();j++) +- p2b<<f2g[MATCHES[*dataj].feat.x].gene_list[j]<<" "; ++ p2b<<"\t"<<MATCHES[*dataj].feat.direction<<"\n"; ++// p2b<<"}\t"<<MATCHES[*dataj].feat.direction<<"\n"; + +- p2b<<"}\t"<<MATCHES[*dataj].feat.direction<<"\n"; + tempx=MATCHES[*dataj].feat.x; + tempy=MATCHES[*dataj].feat.y; + + } + + +- p2b<<"\n\n"; ++ //p2b<<"\n\n"; + + } + +- ++/* + p2b<<"-by contig\n"; + p2b<<setw(10)<<"contig1"<<setw(10)<<"contig2"<<setw(10)<<"blocks\n"; + for(i=0;i<sub_grid.size();i++) + p2b<<setw(9)<<sub_grid[i].contig1<<setw(9)<<sub_grid[i].contig2<<setw(9)<<sub_grid[i].blocks<<endl; +- +- p2b<<"\n-by size\n"; +- p2b<<setw(10)<<"points"<<setw(10)<<"obs"<<setw(10)<<"exp"<<setw(25)<<"p\n"; ++*/ ++// p2b<<"\n-by size\n"; ++ p2b<<"-by size\n"; ++ p2b<<"points"<<setw(10)<<"obs"<<setw(10)<<"exp"<<setw(25)<<"p\n"; + for(l=0;l<FREQ.size();l++) + { + if(FREQ[l]>0) +@@ -132,7 +145,8 @@ if(PRINT_BLOCK) + p_u=pow(n*prob,l)*prob; + pvalue=1-exp(-1*Total_Cells*p_u); + expected_blocks=Total_Cells*p_u; +- p2b<<setw(9)<<l+1<<setw(9)<<FREQ[l]<<setw(15)<<scientific<<setprecision(2)<<expected_blocks<<setw(25)<<scientific<<pvalue<<"\n"; ++// p2b<<setw(9)<<l+1<<setw(9)<<FREQ[l]<<setw(15)<<scientific<<setprecision(2)<<expected_blocks<<setw(25)<<scientific<<pvalue<<"\n"; ++ p2b<<l+1<<"\t"<<FREQ[l]<<"\t"<<scientific<<setprecision(2)<<expected_blocks<<"\t"<<scientific<<pvalue<<"\n"; + } + } + +--- a/src/fish.cpp ++++ b/src/fish.cpp +@@ -39,7 +39,7 @@ string Block_File_S; + bool MAX_SCORE=true; + int TOP_HITS=5; + int Max_Distance=10; +-int Min_Score=200; ++int Min_Score=13; + double Threshold=0.05; + int Min_Block_Size=3; + float BLOCK_PROB=.001; +--- a/src/readfile.h ++++ b/src/readfile.h +@@ -240,7 +240,7 @@ GENE_LIST::iterator chk_pos2; + if(temp_map.size()>0) + { + sub_grid[sub_grid.size()-1].ext=true; +- image_maps.insert(make_pair(contig1+contig2,temp_map)); ++ image_maps.insert(make_pair(contig1+"&"+contig2,temp_map)); + } + + temp_map.clear(); +@@ -327,7 +327,7 @@ GENE_LIST::iterator chk_pos2; + if(image_maps.size()>0) + { + +- pos1=image_maps.find(contig1+contig2); ++ pos1=image_maps.find(contig1+"&"+contig2); + + if(pos1==image_maps.end()) + { +@@ -339,16 +339,16 @@ GENE_LIST::iterator chk_pos2; + { + inserted++; + mapexists=true; +- tempscore=(image_maps[contig1+contig2][contig1+key_y+'&'+contig2+key_x]); ++ tempscore=(image_maps[contig1+"&"+contig2][contig1+key_y+'&'+contig2+key_x]); + + if(MAX_SCORE==true) +- image_maps[contig1+contig2][contig1+key_y+'&'+contig2+key_x]=(MAX(tempscore,score)); ++ image_maps[contig1+"&"+contig2][contig1+key_y+'&'+contig2+key_x]=(MAX(tempscore,score)); + else + { + if(tempscore==0) +- image_maps[contig1+contig2][contig1+key_y+'&'+contig2+key_x]=(score); ++ image_maps[contig1+"&"+contig2][contig1+key_y+'&'+contig2+key_x]=(score); + else +- image_maps[contig1+contig2][contig1+key_y+'&'+contig2+key_x]=(AVG(tempscore,score)); ++ image_maps[contig1+"&"+contig2][contig1+key_y+'&'+contig2+key_x]=(AVG(tempscore,score)); + } + + } +@@ -365,7 +365,7 @@ GENE_LIST::iterator chk_pos2; + } + + if(mapexists==false) +- image_maps.insert(make_pair(contig1+contig2,temp_map)); ++ image_maps.insert(make_pair(contig1+"&"+contig2,temp_map)); + + temp_map.clear(); + +@@ -400,7 +400,7 @@ GENE_LIST::iterator chk_pos2; + { + contig1=i2s(sub_grid[k].contig1); + contig2=i2s(sub_grid[k].contig2); +- contigs=contig1+contig2; ++ contigs=contig1+"&"+contig2; + for(pos2=image_maps[contigs].begin();pos2!=image_maps[contigs].end();++pos2) + { + //cout<<"The firs key "<<pos2->first; +@@ -433,7 +433,7 @@ if(GENE.size()==0 ||GENE.size()<=2) + + + +-image_maps.~map(); ++//image_maps.~map(); + + INV_GENE.clear(); + INV_GENE=GENE; +--- a/src/usage.h ++++ b/src/usage.h +@@ -23,7 +23,6 @@ void process_arguments(int argc, char* a + check(i,argv,argc); + Block_File=argv[++i]; + PRINT_BLOCK=true; +- + } + + else if(temp=="-B") +@@ -43,7 +42,7 @@ void process_arguments(int argc, char* a + } + + else if(temp=="-off") +- Max_Distance=0; ++ Max_Distance=-1; + + else if(temp=="-q") + QUIET_MODE=true; +@@ -144,7 +143,7 @@ void process_arguments(int argc, char* a + i++; + + } +- ++ Max_Distance=-1; + } + + void check(int j, char* argv[],int argc) +@@ -167,7 +166,7 @@ void usage(void) + { + cerr<<"usage: fish [-f Control_File |control.txt]\n"; + cerr<<"\t[-b Block_File] [-g Grid_File] [-C Contig_File]\n"; +- cerr<<"\t[-D Max_Distance |10] [-S Min_Score |200] [-T Threshold |.05]\n"; ++ cerr<<"\t[-D Max_Distance |10] [-S Min_Score |13] [-T Threshold |.05]\n"; + cerr<<"\t[-m Min_Block_Size |3] [-off Turn off Detandemize] [-h help]\n"; + cerr<<"\t[-H Top_Hits |5] [-A Average_Score Selection | Max_Score]\n"; + cerr<<"\t[-p BLOCK_PROB |.001] [-B Block_File_Simple][-q QUIET_MODE]\n"; Modified: trunk/packages/unc-fish/trunk/debian/patches/series =================================================================== --- trunk/packages/unc-fish/trunk/debian/patches/series 2014-02-14 13:44:27 UTC (rev 16046) +++ trunk/packages/unc-fish/trunk/debian/patches/series 2014-02-14 13:47:41 UTC (rev 16047) @@ -1 +1,2 @@ fix_makefile.patch +ngopt.patch _______________________________________________ debian-med-commit mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-med-commit
