public static void main ( String [ ] args ) { if ( args . length == 0 ) { System . out . println ( "Usage: SplittingBAMIndex [splitting BAM indices...]\n\n" + "Writes a few statistics about each splitting BAM index." ) ; return ; } for ( String arg : args ) { final File f = new File ( arg ) ; if ( f . isFile ( ) && f . canRead ( ) ) { try { System . err . printf ( "%s:\n" , f ) ; final SplittingBAMIndex bi = new SplittingBAMIndex ( f ) ; if ( bi . size ( ) == 1 ) { System . err . printf ( "\t0 alignments\n" + "\tassociated BAM file size %d\n" , bi . bamSize ( ) ) ; } else { final long first = bi . first ( ) ; final long last = bi . last ( ) ; System . err . printf ( "\t%d alignments\n" + "\tfirst is at %#06x in BGZF block at %#014x\n" + "\tlast is at %#06x in BGZF block at %#014x\n" + "\tassociated BAM file size %d\n" , bi . size ( ) , first & 0xffff , first >>> 16 , last & 0xffff , last >>> 16 , bi . bamSize ( ) ) ; } } catch ( IOException e ) { System . err . printf ( "Failed to read %s!\n" , f ) ; e . printStackTrace ( ) ; } } else System . err . printf ( "%s does not look like a readable file!\n" , f ) ; } }
Writes some statistics about each splitting BAM index file given as an argument .