/***************************************************************************** # Copyright (C) 1994-2008 by David Gordon. # All rights reserved. # # This software is part of a beta-test version of the Consed/Autofinish # package. It should not be redistributed or # used for any commercial purpose, including commercially funded # sequencing, without written permission from the author and the # University of Washington. # # This software is provided ``AS IS'' and any express or implied # warranties, including, but not limited to, the implied warranties of # merchantability and fitness for a particular purpose, are disclaimed. # In no event shall the authors or the University of Washington be # liable for any direct, indirect, incidental, special, exemplary, or # consequential damages (including, but not limited to, procurement of # substitute goods or services; loss of use, data, or profits; or # business interruption) however caused and on any theory of liability, # whether in contract, strict liability, or tort (including negligence # or otherwise) arising in any way out of the use of this software, even # if advised of the possibility of such damage. # # Building Consed from source is error prone and not simple which is # why I provide executables. Due to time limitations I cannot # provide any assistance in building Consed. Even if you do not # modify the source, you may introduce errors due to using a # different version of the compiler, a different version of motif, # different versions of other libraries than I used, etc. For this # reason, if you discover Consed bugs, I can only offer help with # those bugs if you first reproduce those bugs with an executable # provided by me--not an executable you have built. # # Modifying Consed is also difficult. Although Consed is modular, # some modules are used by many other modules. Thus making a change # in one place can have unforeseen effects on many other features. # It may takes months for you to notice these other side-effects # which may not seen connected at all. It is not feasable for me to # provide help with modifying Consed sources because of the # potentially huge amount of time involved. # #*****************************************************************************/ #ifndef seqMatch_included #define seqMatch_included #include #include "bool.h" class Contig; class seqMatch { public: seqMatch( Contig* pContig1, Contig* pContig2, const int nStart1, const int nStart2, const int nEnd1, const int nEnd2, const bool bComplemented, const float fPercentSimilar ); // default copy ctor already does this, and does it more reliably // with additional member data // seqMatch( const seqMatch* pSeqMatch ) { // pContig_[0] = pSeqMatch->pContig_[0]; // pContig_[1] = pSeqMatch->pContig_[1]; // nUnpaddedStartConsPos_[0] = pSeqMatch->nUnpaddedStartConsPos_[0]; // nUnpaddedStartConsPos_[1] = pSeqMatch->nUnpaddedStartConsPos_[1]; // nUnpaddedEndConsPos_[0] = pSeqMatch->nUnpaddedEndConsPos_[0]; // nUnpaddedEndConsPos_[1] = pSeqMatch->nUnpaddedEndConsPos_[1]; // bComplemented_ = pSeqMatch->bComplemented_; // nScaffold_[0] = pSeqMatch->nScaffold_[0]; // nScaffold_[1] = pSeqMatch->nScaffold_[1]; // nScaffoldPosStart_[0] = pSeq // } bool operator==( const seqMatch& seqq ) const { return( this == &seqq ); } GC gcGet(); inline int nGetBezierX( const int nArc, const float fT ) { int n = 0.5 + // for rounding fAX_[ nArc ] * fT*fT*fT + fBX_[ nArc ] * fT*fT + fCX_[ nArc ] * fT + fDX_[ nArc ]; return n; } inline int nGetBezierY( const int nArc, const float fT ) { int n = 0.5 + // for rounding fAY_[ nArc ] * fT*fT*fT + fBY_[ nArc ] * fT*fT + fCY_[ nArc ] * fT + fDY_[ nArc ]; return n; } bool bOKToShow(); public: // indexed by the copy of the repeat Contig* pContig_[2]; int nUnpaddedStartConsPos_[2]; int nUnpaddedEndConsPos_[2]; // perhaps we should also have which scaffold and scaffold positions // my understanding (Dec 2002): // nUnpaddedStartConsPos_[0] goes to nUnpaddedStartConsPos_[1] // and // nUnpaddedEndConsPos_[0] goes to nUnpaddedEndConsPos_[1] // nUnpaddedStartConsPos_[0] <= nUnpaddedEndConsPos_[0] // but no guarantees about // nUnpaddedStartConsPos_[1] <=> nUnpaddedEndConsPos_[1] bool bComplemented_; // indexed by the copy of the repeat // The arc goes from start to start // and from end to end, regardless // whether complemented or not. These are not necessarily set-- // could not be set if the seqMatch is not visible. int nScaffold_[2]; int nScaffoldPosStart_[2]; int nScaffoldPosEnd_[2]; bool bDirectNotInverted_; float fPercentSimilar_; // some measure of the similarity of the // sequences.--perhaps % similar since that is what many people will // understand // there are 2 arcs for a matching region, so two sets // of Bezier coefficients. These are indexed by the arcs--not // the regions float fAX_[2]; float fBX_[2]; float fCX_[2]; float fDX_[2]; float fAY_[2]; float fBY_[2]; float fCY_[2]; float fDY_[2]; int nNumberOfPointsForDrawing_[2]; bool bInView_[2]; // this would be false if the contig wasn't // displayed in assemblyView, or if the curve was off the visible screen. }; #endif