Support throughout for S and N cigar elements.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2579 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
ebanks 2010-01-14 03:45:42 +00:00
parent 9f89c62c75
commit a082b948a3
1 changed files with 25 additions and 10 deletions

View File

@ -49,8 +49,14 @@ public class AlignmentUtils {
mm_count++; mm_count++;
} }
break; break;
case I: i_read += ce.getLength(); break; case I:
case D: i_ref += ce.getLength(); break; case S:
i_read += ce.getLength();
break;
case D:
case N:
i_ref += ce.getLength();
break;
default: throw new RuntimeException("Unrecognized cigar element"); default: throw new RuntimeException("Unrecognized cigar element");
} }
@ -86,9 +92,15 @@ public class AlignmentUtils {
mm_count++; mm_count++;
} }
break; break;
case I: i_read += ce.getLength(); break; case I:
case D: i_ref += ce.getLength(); break; case S:
default: throw new RuntimeException("Unrecognized cigar element"); i_read += ce.getLength();
break;
case D:
case N:
i_ref += ce.getLength();
break;
default: throw new RuntimeException("Unrecognized cigar element: " + ce.getOperator());
} }
} }
@ -143,12 +155,14 @@ public class AlignmentUtils {
} }
break; break;
case I: case I:
case S:
readIdx += ce.getLength(); readIdx += ce.getLength();
break; break;
case D: case D:
case N:
refIndex += ce.getLength(); refIndex += ce.getLength();
break; break;
default: throw new StingException("Only M,I,D cigar elements are currently supported"); default: throw new StingException("The " + ce.getOperator() + " cigar element is not currently supported");
} }
} }
@ -216,17 +230,18 @@ public class AlignmentUtils {
} }
break; break;
case I: case I:
case S:
readIndex += cigarElementLength; readIndex += cigarElementLength;
break; break;
case D: case D:
case N:
currentPos += cigarElementLength; currentPos += cigarElementLength;
if ( currentPos > windowStart ) if ( currentPos > windowStart )
refIndex += Math.min(cigarElementLength, currentPos - windowStart); refIndex += Math.min(cigarElementLength, currentPos - windowStart);
break; break;
case S: default:
readIndex += cigarElementLength; // fail silently
break; return 0;
default: throw new StingException("Only M,I,D,S cigar elements are currently supported; there was " + ce.getOperator());
} }
} }