public void writeTo(BufferedByteWriter fos) throws IOException { fos.putNullTerminatedString(TDFTile.Type.fixedStep.toString()); fos.putInt(getSize()); fos.putInt(start); fos.putFloat((float) span); for (int i = 0; i < data.length; i++) { for (int j = 0; j < data[i].length; j++) { fos.putFloat(data[i][j]); } } }
public void write(BufferedByteWriter dos) throws IOException { writeAttributes(dos); writeString(dos, dataType.toString()); dos.putFloat(tileWidth); // dos.writeFloat(binWidth); dos.putInt(tilePositions.length); for (int i = 0; i < tilePositions.length; i++) { dos.putLong(tilePositions[i]); dos.putInt(tileSizes[i]); } }
public TDFDataset(String name, ByteBuffer byteBuffer, TDFReader reader) throws IOException { super(name); this.reader = reader; fill(byteBuffer); }
private void writeDatasets() throws IOException { for (TDFDataset dataset : datasetCache.values()) { long position = bytesWritten; BufferedByteWriter buffer = new BufferedByteWriter(); dataset.write(buffer); write(buffer.getBytes()); int nBytes = (int) (bytesWritten - position); datasetIndex.put(dataset.getName(), new IndexEntry(position, nBytes)); } }
private void writeGroups() throws IOException { for (TDFGroup group : groupCache.values()) { long position = bytesWritten; BufferedByteWriter buffer = new BufferedByteWriter(); group.write(buffer); write(buffer.getBytes()); int nBytes = (int) (bytesWritten - position); groupIndex.put(group.getName(), new IndexEntry(position, nBytes)); } }
public static void dumpTile(String ibfFile, String dsName, int tileNumber) { TDFReader reader = TDFReader.getReader(ibfFile); TDFDataset ds = reader.getDataset(dsName); TDFTile tile = reader.readTile(ds, tileNumber); if (tile == null) { System.out.println("Null tile: " + dsName + " [" + tileNumber + "]"); } else { dumpTileData(reader, "", tile, System.out); } }
public byte [] encodeBinary() throws IOException { BufferedByteWriter writer = new BufferedByteWriter(); writer.putNullTerminatedString(snp); writer.putNullTerminatedString(chr); writer.putInt(position); writer.putNullTerminatedString(geneId); writer.putNullTerminatedString(geneName); //writer.putFloat(tStat); writer.putFloat(pValue); //writer.putFloat(qValue); return writer.getBytes(); }
Raw(String chr, int chrLength, int tileWidth) { this.tileWidth = tileWidth; int nTiles = (int) (chrLength / tileWidth) + 1; dsName = "/" + chr + "/raw"; dataset = writer.createDataset(dsName, TDFDataset.DataType.FLOAT, tileWidth, nTiles); }
public double getDataMax() { Double val = getValue(WindowFunction.max); return val == null ? 100 : val; }
/** * Write a string as a null terminated character sequence. * <p/> * IGV requires all strings to be ascii, so single byte storaged is enough * * @param dos * @param s * @throws java.io.IOException */ public void writeString(BufferedByteWriter dos, String s) throws IOException { dos.putNullTerminatedString(s); }
public TDFGroup(String name, ByteBuffer byteBuffer) throws IOException { super(name); fill(byteBuffer); }
public TDFDataSource(TDFReader reader, int trackNumber, String trackName, Genome genome) { this.genome = genome; this.trackNumber = trackNumber; this.trackName = trackName; this.reader = reader; init(); }
private void writeDatasets() throws IOException { for (TDFDataset dataset : datasetCache.values()) { long position = bytesWritten; BufferedByteWriter buffer = new BufferedByteWriter(); dataset.write(buffer); write(buffer.getBytes()); int nBytes = (int) (bytesWritten - position); datasetIndex.put(dataset.getName(), new IndexEntry(position, nBytes)); } }
private void writeGroups() throws IOException { for (TDFGroup group : groupCache.values()) { long position = bytesWritten; BufferedByteWriter buffer = new BufferedByteWriter(); group.write(buffer); write(buffer.getBytes()); int nBytes = (int) (bytesWritten - position); groupIndex.put(group.getName(), new IndexEntry(position, nBytes)); } }
public void write(BufferedByteWriter dos) throws IOException { writeAttributes(dos); writeString(dos, dataType.toString()); dos.putFloat(tileWidth); // dos.writeFloat(binWidth); dos.putInt(tilePositions.length); for (int i = 0; i < tilePositions.length; i++) { dos.putLong(tilePositions[i]); dos.putInt(tileSizes[i]); } }
public void writeTo(BufferedByteWriter fos) throws IOException { fos.putNullTerminatedString(TDFTile.Type.fixedStep.toString()); fos.putInt(getSize()); fos.putInt(start); fos.putFloat((float)span); for (int i = 0; i < data.length; i++) { for (int j = 0; j < data[i].length; j++) { fos.putFloat(data[i][j]); } } }
public double getDataMin() { Double val = getValue(WindowFunction.min); return val == null ? 0 : val; }