/* @source polydot application ** ** Create a polydot from a multiple sequence file. ** @author Copyright (C) Peter Rice (pmr@ebi.ac.uk) ** @@ ** ** This program is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License ** as published by the Free Software Foundation; either version 2 ** of the License, or (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ******************************************************************************/ #include "emboss.h" static float xstart = 0; static float ystart = 0; static ajint *lines; static ajint *pts; static ajint which; static void polydot_drawPlotlines(void *x, void *cl); static void polydot_plotMatches(const AjPList list); /* @prog polydot ************************************************************** ** ** Displays all-against-all dotplots of a set of sequences ** ******************************************************************************/ int main(int argc, char **argv) { AjPSeqset seqset; const AjPSeq seq1; const AjPSeq seq2; ajint wordlen; AjPTable seq1MatchTable = NULL; AjPList matchlist ; AjPGraph graph = 0; ajuint i; ajuint j; float total=0; ajuint acceptableticks[]= { 1,10,50,100,200,500,1000,1500,10000,50000, 100000,500000,1000000,5000000 }; ajint numbofticks = 10; ajint gap,tickgap; AjBool boxit = AJTRUE; AjBool dumpfeat = AJFALSE; float xmargin; float ymargin; float k; char ptr[10]; float ticklen; float onefifth; AjPFeattable *tabptr = NULL; AjPFeattabOut seq1out = NULL; AjPStr sajb = NULL; float flen1; float flen2; ajuint tui; embInit("polydot", argc, argv); wordlen = ajAcdGetInt("wordsize"); seqset = ajAcdGetSeqset("sequences"); graph = ajAcdGetGraph("graph"); gap = ajAcdGetInt("gap"); boxit = ajAcdGetBoolean("boxit"); seq1out = ajAcdGetFeatout("outfeat"); dumpfeat = ajAcdGetToggle("dumpfeat"); sajb = ajStrNew(); embWordLength(wordlen); AJCNEW(lines,ajSeqsetGetSize(seqset)); AJCNEW(pts,ajSeqsetGetSize(seqset)); AJCNEW(tabptr,ajSeqsetGetSize(seqset)); for(i=0;ilength; x1 = x2 = (p->seq1start)+xstart; y1 = y2 = (PLFLT)(p->seq2start)+ystart; x2 += p->length; y2 += (PLFLT)p->length; ajGraphicsDrawposLine(x1, y1, x2, y2); return; } /* @funcstatic polydot_plotMatches ******************************************** ** ** Undocumented. ** ** @param [r] list [const AjPList] Undocumented ** @return [void] ** @@ ******************************************************************************/ static void polydot_plotMatches(const AjPList list) { ajListMapread(list,polydot_drawPlotlines, NULL); return; }