Crushed subtle and potentially insidous bug in seeking within the fasta; a beer for anyone who can tell me the situation where this might arise...

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@106 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
depristo 2009-03-20 00:07:06 +00:00
parent 34ee48fd82
commit b83c8319c7
1 changed files with 7 additions and 2 deletions

View File

@ -35,7 +35,12 @@ public class ReferenceIterator implements Iterator<ReferenceIterator> {
//
// --------------------------------------------------------------------------------------------------------------
public byte getBaseAsByte() { return currentContig.getBases()[(int)offset]; }
public String getBaseAsString() { return StringUtil.bytesToString(currentContig.getBases(), (int)offset, 1); }
public String getBaseAsString() {
assert offset > -1 : currentContig.getName() + " index is " + offset;
//assert offset < currentContig.getBases().();
return StringUtil.bytesToString(currentContig.getBases(), (int)offset, 1);
}
public char getBaseAsChar() { return getBaseAsString().charAt(0); }
public ReferenceSequence getCurrentContig() { return currentContig; }
public long getPosition() { return offset + 1; }
@ -142,7 +147,7 @@ public class ReferenceIterator implements Iterator<ReferenceIterator> {
}
else if ( GenomeLoc.compareContigs( nextContig.getName(), contigName ) == 0 ) {
swapNextContig();
return seekForward(contigName, seekOffset);
return seekForwardOffset(contigName, seekOffset);
}
}
}