/***************************************************************************** # 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 PADDEDPIECEOFREAD_INCLUDED #define PADDEDPIECEOFREAD_INCLUDED #include "rwcstring.h" #include "rwtvalorderedvector.h" #include "quality.h" class Contig; class paddedPieceOfRead { public: RWCString soName_; RWCString soBasesAndPads_; int nUnpaddedOffset_; // This is not the unpadded position of the first base in the alignment. // In fact, the first base could be a pad. (or could it?) Instead, // this is the unpadded position of the first non-pad before the // alignment. Thus you add this to the number of non-pads to get // the unpadded position of a base in the alignment Contig* pContig_; // unpadded positions within the contig of the aligned region int nUnpaddedAlignmentStart_; int nUnpaddedAlignmentEnd_; // these are *not* the padded equivalent of // nUnpaddedAlignmentStart_ and nUnpaddedAlignmentEnd_. There are // unaligned context bases at the beginning and end of // soBasesAndPads_. These numbers give the 0-based positions // within soBasesAndPads_ which are aligned. int nPaddedAlignmentStart_; int nPaddedAlignmentEnd_; bool bComplemented_; // soBasesAndPads_ is complemented from the way pContig is // all of the other nUnpaddedAlignmentStart_ and nPaddedAlignmentStart_ // are with respect to pContig positions. // preserve a copy of the base qualities so that people can modify // the actual consensus while they are looking at the alignment RWTValOrderedVector aBaseAndPadQualities_; public: int nGetPaddedLength() { return( soBasesAndPads_.length() ); } int nUnpaddedContigPosFromZeroBasedPaddedPos( const int nZeroBasedPaddedPos ); int nZeroBasedAlignPosFromUnpadded( const int nSourceUnpadded ); int nGetRightMostUnpaddedConsPosOfAlignment(); int nGetLeftMostUnpaddedConsPosOfAlignment(); paddedPieceOfRead( const RWCString& soNameForDebugging, const RWCString& soBasesAndPads, const int nZeroBasedPaddedPosOfKnownBase, // wrt soBasesAndPads const int nConsPosOfKnownBase, // wrt pContig Contig* pContig, const int nUnpaddedAlignmentStart, // wrt pContig const int nUnpaddedAlignmentEnd, // wrt pContig const int nPaddedAlignmentStart, // wrt soBasesAndPads const int nPaddedAlignmentEnd, // wrt soBasesAndPads const bool bComplemented ); void calculateQualities(); }; #endif