// Path: scala/org/broad/igv/WindowFunction.java
// public enum WindowFunction {
// 
//     mean("Mean"),
//     median("Median"),
//     min("Minimum"),
//     max("Maximum"),
//     percentile2("2nd Percentile"),
//     percentile10("10th Percentile"),
//     percentile90("90th Percentile"),
//     percentile98("98th Percentile"),
// //    stddev("Standard Deviation"),
//     count("Count");
// //    density("Density");
// 
//     private String displayName = "";
// 
//     WindowFunction(String displayName) {
//         this.displayName = displayName;
//     }
// 
//     public String getDisplayName() {
//         return displayName;
//     }
// 
//     static public WindowFunction getWindowFunction(String name) {
// 
//         WindowFunction windowFunction = null;
//         if (WindowFunction.mean.name().equalsIgnoreCase(name)) {
//             windowFunction = WindowFunction.mean;
//         } else if (WindowFunction.median.name().equalsIgnoreCase(name)) {
//             windowFunction = WindowFunction.median;
//         } else if (WindowFunction.min.name().equalsIgnoreCase(name)) {
//             windowFunction = WindowFunction.min;
//         } else if (WindowFunction.max.name().equalsIgnoreCase(name)) {
//             windowFunction = WindowFunction.max;
//         } else if (WindowFunction.percentile10.name().equalsIgnoreCase(name)) {
//             windowFunction = WindowFunction.percentile10;
//         } else if (WindowFunction.percentile90.name().equalsIgnoreCase(name)) {
//             windowFunction = WindowFunction.percentile90;
//         } else if (WindowFunction.percentile98.name().equalsIgnoreCase(name)) {
//             windowFunction = WindowFunction.percentile98;
// //        } else if (WindowFunction.stddev.name().equals(name)) {
// //            windowFunction = WindowFunction.stddev;
//         } else if (WindowFunction.count.name().equalsIgnoreCase(name)) {
//             windowFunction = WindowFunction.count;
// //        } else if (WindowFunction.density.name().equals(name)) {
// //            windowFunction = WindowFunction.density;
//         }
//         return windowFunction;
//     }
// }


import java.io.File;
import java.io.FileNotFoundException;
import java.net.URISyntaxException;
import java.util.Map;
import org.broad.igv.WindowFunction;
import net.sf.samtools.seekablestream.SeekableFileStream;
						int start = tile.getStartPosition(b);
						int end = tile.getEndPosition(b);
						if (start > endLocation) {
							break;
						}
						if (end >= startLocation) {
							System.out.print(tile.getStartPosition(b));
							for (int t = 0; t < nTracks; t++) {
								System.out.print("\t" + tile.getValue(t, b));
							}
							System.out.println();
						}
					}
				}
			}

		}
	}

	/*
	 * magic number (4 bytes) version index position index size (bytes) # of
	 * window functions [window functions] track type (string) track line
	 * (string) # of tracks [track names]
	 */
	public static void dumpSummary(String ibfFile) throws URISyntaxException, FileNotFoundException {

		TDFReader reader = TDFReader.getReader(new SeekableFileStream(new File(ibfFile)));

		System.out.println("Version: " + reader.getVersion());
		System.out.println("Window Functions");
// Path: scala/org/broad/igv/WindowFunction.java
// public enum WindowFunction {
// 
//     mean("Mean"),
//     median("Median"),
//     min("Minimum"),
//     max("Maximum"),
//     percentile2("2nd Percentile"),
//     percentile10("10th Percentile"),
//     percentile90("90th Percentile"),
//     percentile98("98th Percentile"),
// //    stddev("Standard Deviation"),
//     count("Count");
// //    density("Density");
// 
//     private String displayName = "";
// 
//     WindowFunction(String displayName) {
//         this.displayName = displayName;
//     }
// 
//     public String getDisplayName() {
//         return displayName;
//     }
// 
//     static public WindowFunction getWindowFunction(String name) {
// 
//         WindowFunction windowFunction = null;
//         if (WindowFunction.mean.name().equalsIgnoreCase(name)) {
//             windowFunction = WindowFunction.mean;
//         } else if (WindowFunction.median.name().equalsIgnoreCase(name)) {
//             windowFunction = WindowFunction.median;
//         } else if (WindowFunction.min.name().equalsIgnoreCase(name)) {
//             windowFunction = WindowFunction.min;
//         } else if (WindowFunction.max.name().equalsIgnoreCase(name)) {
//             windowFunction = WindowFunction.max;
//         } else if (WindowFunction.percentile10.name().equalsIgnoreCase(name)) {
//             windowFunction = WindowFunction.percentile10;
//         } else if (WindowFunction.percentile90.name().equalsIgnoreCase(name)) {
//             windowFunction = WindowFunction.percentile90;
//         } else if (WindowFunction.percentile98.name().equalsIgnoreCase(name)) {
//             windowFunction = WindowFunction.percentile98;
// //        } else if (WindowFunction.stddev.name().equals(name)) {
// //            windowFunction = WindowFunction.stddev;
//         } else if (WindowFunction.count.name().equalsIgnoreCase(name)) {
//             windowFunction = WindowFunction.count;
// //        } else if (WindowFunction.density.name().equals(name)) {
// //            windowFunction = WindowFunction.density;
//         }
//         return windowFunction;
//     }
// }


// Path: scala/org/broad/igv/TDFUtils.java
import java.io.File;
import java.io.FileNotFoundException;
import java.net.URISyntaxException;
import java.util.Map;
import org.broad.igv.WindowFunction;
import net.sf.samtools.seekablestream.SeekableFileStream;

						int start = tile.getStartPosition(b);
						int end = tile.getEndPosition(b);
						if (start > endLocation) {
							break;
						}
						if (end >= startLocation) {
							System.out.print(tile.getStartPosition(b));
							for (int t = 0; t < nTracks; t++) {
								System.out.print("\t" + tile.getValue(t, b));
							}
							System.out.println();
						}
					}
				}
			}

		}
	}

	/*
	 * magic number (4 bytes) version index position index size (bytes) # of
	 * window functions [window functions] track type (string) track line
	 * (string) # of tracks [track names]
	 */
	public static void dumpSummary(String ibfFile) throws URISyntaxException, FileNotFoundException {

		TDFReader reader = TDFReader.getReader(new SeekableFileStream(new File(ibfFile)));

		System.out.println("Version: " + reader.getVersion());
		System.out.println("Window Functions");
		for (WindowFunction wf : reader.getWindowFunctions()) {