/** * attempt to close the VCF file; we need to flush the queue first */ @Override public void close() { stopWaitingToSort(); if (takeOwnershipOfInner) innerWriter.close(); }
/** * attempt to close the VCF file; we need to flush the queue first */ @Override public void close() { stopWaitingToSort(); if (takeOwnershipOfInner) innerWriter.close(); }
/** * attempt to close the VCF file; we need to flush the queue first */ @Override public void close() { stopWaitingToSort(); if (takeOwnershipOfInner) innerWriter.close(); }
/** * add a record to the file * * @param vc the Variant Context object */ @Override public synchronized void add(VariantContext vc) { /* Note that the code below does not prevent the successive add()-ing of: (chr1, 10), (chr20, 200), (chr15, 100) since there is no implicit ordering of chromosomes: */ VCFRecord firstRec = queue.peek(); if (firstRec != null && !vc.getContig().equals(firstRec.vc.getContig())) { // if we hit a new contig, flush the queue if (finishedChromosomes.contains(vc.getContig())) throw new IllegalArgumentException("Added a record at " + vc.getContig() + ":" + vc.getStart() + ", but already finished with chromosome" + vc.getContig()); finishedChromosomes.add(firstRec.vc.getContig()); stopWaitingToSort(); } noteCurrentRecord(vc); // possibly overwritten queue.add(new VCFRecord(vc)); emitSafeRecords(); }
/** * add a record to the file * * @param vc the Variant Context object */ @Override public synchronized void add(VariantContext vc) { /* Note that the code below does not prevent the successive add()-ing of: (chr1, 10), (chr20, 200), (chr15, 100) since there is no implicit ordering of chromosomes: */ VCFRecord firstRec = queue.peek(); if (firstRec != null && !vc.getChr().equals(firstRec.vc.getChr())) { // if we hit a new contig, flush the queue if (finishedChromosomes.contains(vc.getChr())) throw new IllegalArgumentException("Added a record at " + vc.getChr() + ":" + vc.getStart() + ", but already finished with chromosome" + vc.getChr()); finishedChromosomes.add(firstRec.vc.getChr()); stopWaitingToSort(); } noteCurrentRecord(vc); // possibly overwritten queue.add(new VCFRecord(vc)); emitSafeRecords(); }
/** * add a record to the file * * @param vc the Variant Context object */ @Override public synchronized void add(VariantContext vc) { /* Note that the code below does not prevent the successive add()-ing of: (chr1, 10), (chr20, 200), (chr15, 100) since there is no implicit ordering of chromosomes: */ VCFRecord firstRec = queue.peek(); if (firstRec != null && !vc.getContig().equals(firstRec.vc.getContig())) { // if we hit a new contig, flush the queue if (finishedChromosomes.contains(vc.getContig())) throw new IllegalArgumentException("Added a record at " + vc.getContig() + ":" + vc.getStart() + ", but already finished with chromosome" + vc.getContig()); finishedChromosomes.add(firstRec.vc.getContig()); stopWaitingToSort(); } noteCurrentRecord(vc); // possibly overwritten queue.add(new VCFRecord(vc)); emitSafeRecords(); }