Changes

From Genome Analysis Wiki
Jump to navigationJump to search
1,593 bytes added ,  17:16, 29 July 2010
no edit summary
Line 159: Line 159:  
| Returns true if the passed in operator is not the same as this operator, false if they are the same.
 
| Returns true if the passed in operator is not the same as this operator, false if they are the same.
 
|}
 
|}
 +
 +
 +
== Mapping Between Reference and Read/Query ==
 +
<code>int32_t CigarRoller::getRefOffset(int32_t queryIndex)</code> and <code>int32_t CigarRoller::getQueryIndex(int32_t refOffset)</code> are used to map between the reference and the read.
 +
 +
The queryIndex is the index in the read - from 0 to (read length - 1).
 +
The refOffset is the offset into the reference from the starting position of the read.
 +
 +
For Example:
 +
Reference: ACTGAACCTTGGAAACTG
 +
Read: ACTGACTG
 +
CIGAR: 4M10N4M
 +
POS: 5
 +
 +
This means it aligns:
 +
Reference: ACTGAACCTTGGAAACTG
 +
Read:      ACTG          ACTG
 +
 +
Adding the position:
 +
RefPos:    5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22
 +
Reference:  A  C  T  G  A  A  C  C  T  T  G  G  A  A  A  C  T  G
 +
Read:      A  C  T  G                                A  C  T  G
 +
 +
Adding the offsets:
 +
RefPos:    5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22
 +
refOffset:  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17
 +
Reference:  A  C  T  G  A  A  C  C  T  T  G  G  A  A  A  C  T  G
 +
Read:      A  C  T  G                                A  C  T  G
 +
queryIndex: 0  1  2  3                                4  5  6  7
 +
 +
The results of a call to getRefOffset for each value passed in (where NA stands for INDEX_NA):
 +
queryIndex: 0  1  2  3  4  5  6  7  8(and any value over 8)
 +
Return:    0  1  2  3 14 15 16 17 NA
 +
 +
The results of a call to getQueryIndex for each value passed in (where NA stands for INDEX_NA):
 +
refOffset:  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18(and any value over 18)
 +
Return:    0  1  2  3 NA NA NA NA NA NA NA NA NA NA  4  5  6  7 NA

Navigation menu