| 1 |
// This file is part of A2Amapper. |
| 2 |
// Copyright (c) 2004 Applera Corporation |
| 3 |
// Author: Clark Mobarry |
| 4 |
// |
| 5 |
// This program is free software; you can redistribute it and/or modify |
| 6 |
// it under the terms of the GNU General Public License as published by |
| 7 |
// the Free Software Foundation; either version 2 of the License, or |
| 8 |
// (at your option) any later version. |
| 9 |
// |
| 10 |
// This program is distributed in the hope that it will be useful, |
| 11 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
// GNU General Public License for more details. |
| 14 |
// |
| 15 |
// You should have received (LICENSE.txt) a copy of the GNU General Public |
| 16 |
// License along with this program; if not, write to the Free Software |
| 17 |
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 18 |
|
| 19 |
#include "halign.H" |
| 20 |
|
| 21 |
int main(int argc, char **argv) { |
| 22 |
char *seq1 = "ATCGTCCGGATGAAAATGTCTCGGGGGGGGGGGTCGGG"; |
| 23 |
char *seq2 = "ATCGTCTGGATGAAAAAGTCTCAAGGG"; |
| 24 |
|
| 25 |
// This is the setting for the coordinate system to be just the match. |
| 26 |
int offset1 = 0; |
| 27 |
int offset2 = 0; |
| 28 |
|
| 29 |
int bgn1, bgn2, len1, len2, nmat; |
| 30 |
|
| 31 |
H_Alignment_t * aln_ptr = NULL; |
| 32 |
|
| 33 |
// Sequence coordinates are base-based, starting from 0 |
| 34 |
halignStart(seq1+offset1, // This is the first base in the comparison. |
| 35 |
seq2+offset2, |
| 36 |
offset1, |
| 37 |
offset2, |
| 38 |
strlen(seq1), |
| 39 |
strlen(seq2), |
| 40 |
&aln_ptr); |
| 41 |
|
| 42 |
//printUngappedAlign(aln_ptr); |
| 43 |
//printUngappedAlignSharpEnds(aln_ptr); |
| 44 |
|
| 45 |
printUngappedAlignSharpEndsOnConsole(aln_ptr, seq1, seq2, 0); |
| 46 |
printUngappedAlignSharpEndsOnConsole(aln_ptr, seq1, seq2, 1); |
| 47 |
printUngappedAlignSharpEndsOnConsole(aln_ptr, seq1, seq2, 2); |
| 48 |
|
| 49 |
while(iterateUngappedAlignSharpEnds(aln_ptr, bgn1, bgn2, len1, len2, nmat)) |
| 50 |
printf("%d %d %d %d\n", bgn1, bgn2, len1, len2 ); |
| 51 |
|
| 52 |
if(aln_ptr != NULL) |
| 53 |
Free_align(aln_ptr); |
| 54 |
|
| 55 |
// Must call for each halign() but after printing output. |
| 56 |
|
| 57 |
exit(0); |
| 58 |
} |