// Copyright (c) 2008 Illumina // // This software is covered by the "Illumina Genome Analyzer Software // License Agreement" and the "Illumina Source Code License Agreement", // and certain third party copyright/licenses, and any user of this // source file is bound by the terms therein (see accompanying files // Illumina_Genome_Analyzer_Software_License_Agreement.pdf and // Illumina_Source_Code_License_Agreement.pdf and third party // copyright/license notices). // PROJECT: ELAND (Efficient Large-Scale Alignment of Nucleotide Databases) // MODULE: alignExtendedFrags.cpp // AUTHOR: M. Bauer // Description: perform a gapped alignment with reads that have not been mapped onto the genome #ifndef GA_ALIGNER_H #define GA_AlIGNER_H using namespace std; typedef unsigned char uchar; #define QUALSCALE 0.0333 #define EPSILON 0.0000001 #define UINT_INIT 1048576 // 2^20 namespace ga { namespace alignment { typedef double ScoreType; struct DPMatrix : public vector > { DPMatrix( void ) {} DPMatrix( int x, int y) { resize(x,y); } // ~ctor void resize( int x, int y) { vector >::resize(x); for (int j(0);j EPSILON ) { max=v1; which=1; } if ( (v2-max) > EPSILON ) { max=v2; which=2; } } else { max=v2; which=2; if ( (v1-v2) > EPSILON ) { max=v1; which=1; } if ( (v0-max) > EPSILON ) { max=v0; which=0; } } } // ~Aligner::max3 // GET/SET METHODS ------------------------------------------------------------------------- void setQualityScaling( const double& scaling ) { qualScaling_ = scaling; } double getQualityScaling( void ) { return qualScaling_; } /* void setWidth( const int& val ) { width_ = val; } */ /* int getWidth( void ) { return width_; } */ void allowInserts( const bool& val ) { allowInserts_ = val; } bool insertsAllowed( void ) { return( allowInserts_ == 1); } void allowDeletions( const bool& val ) { allowDeletions_ = val; } bool deletionsAllowed( void ) { return( allowDeletions_ == 1); } string convertToCIGAR( const string& alignedA,const string& alignedB ); string convertToAlignmentDescriptor( const string& alignedA,const string& alignedB,int& no_mismatches ); string convertToNewAlignmentDescriptor( const string& alignedA,const string& alignedB,int& no_mismatches,int& begin_offset,int& end_offset ); bool checkAlignmentSanity( const string& read, const string& ref ); }; // ~class Aligner } } // namespace ga #endif