Support for multiple records at the same site. The first record gets chr:start, and subsequent records get chr:start_2, chr:start_3, etc.

This commit is contained in:
Mark DePristo 2011-07-18 15:43:52 -04:00
parent 782a05e9b5
commit c05451047c
1 changed files with 7 additions and 1 deletions

View File

@ -72,13 +72,19 @@ public class VCFDiffableReader implements DiffableReader {
}
String line = lineReader.readLine();
int count = 0;
int count = 0, nRecordsAtPos = 1;
String prevName = "";
while ( line != null ) {
if ( count++ > maxElementsToRead && maxElementsToRead != -1)
break;
VariantContext vc = (VariantContext)vcfCodec.decode(line);
String name = vc.getChr() + ":" + vc.getStart();
if ( name.equals(prevName) ) {
name += "_" + ++nRecordsAtPos;
} else {
prevName = name;
}
DiffNode vcRoot = DiffNode.empty(name, root);
// add fields