Skip to content

pbenner/jigwig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 

Repository files navigation

Library for reading BigWig files (ported from Gonetics).

Basic Usage

  Path path = Paths.get("test.bw");
  SeekableByteChannel rbc = Files.newByteChannel(path, EnumSet.of(StandardOpenOption.READ));
  BigWigFile bwf = new BigWigFile(rbc);

  BigWigFileIterator it = bwf.query("chr11|chr12", 112643206, 112658727, 0);

  while (it.hasNext()) {
    BigWigFileIteratorType r = it.next();
    BigWigSummaryRecord s = r.getSummary();
    System.out.printf("chrom: %s\n", s.getChromName());
    System.out.printf("from : %d\n", s.getFrom());
    System.out.printf("to   : %d\n", s.getTo());
    System.out.printf("value: %f\n", s.getMean());
    System.out.println();
  }