public void export ( Iterator < Variant > iterator ) { // sanity check if ( writer == null ) { logger . error ( "Error exporting VCF data: exporter must be opened" ) ; return ; } // main loop (from iterator) while ( iterator . hasNext ( ) ) { try { VariantContext variantContext = variantConverter . convert ( iterator . next ( ) ) ; //System.out.println(variantContext.toString()); writer . add ( variantContext ) ; } catch ( Exception e ) { logger . error ( "Error exporting VCF data: {}" , e . getMessage ( ) , e ) ; } } // // close everything // close(); }
Export variants in VCF file format from a variant iterator .