/** * 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); }
/** * 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 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(); }
private void writeIndex() throws IOException { BufferedByteWriter buffer = new BufferedByteWriter(); // Now write out dataset index buffer.putInt(datasetIndex.size()); for (Map.Entry<String, IndexEntry> entry : datasetIndex.entrySet()) { buffer.putNullTerminatedString(entry.getKey()); buffer.putLong(entry.getValue().position); buffer.putInt(entry.getValue().nBytes); } // group index log.info("Group idx: " + groupIndex.size()); buffer.putInt(groupIndex.size()); for (Map.Entry<String, IndexEntry> entry : groupIndex.entrySet()) { buffer.putNullTerminatedString(entry.getKey()); buffer.putLong(entry.getValue().position); buffer.putInt(entry.getValue().nBytes); } byte[] bytes = buffer.getBytes(); write(bytes); }
private void writeIndex() throws IOException { BufferedByteWriter buffer = new BufferedByteWriter(); // Now write out dataset index buffer.putInt(datasetIndex.size()); for (Map.Entry<String, IndexEntry> entry : datasetIndex.entrySet()) { buffer.putNullTerminatedString(entry.getKey()); buffer.putLong(entry.getValue().position); buffer.putInt(entry.getValue().nBytes); } // group index System.out.println("Group idx: " + groupIndex.size()); buffer.putInt(groupIndex.size()); for (Map.Entry<String, IndexEntry> entry : groupIndex.entrySet()) { buffer.putNullTerminatedString(entry.getKey()); buffer.putLong(entry.getValue().position); buffer.putInt(entry.getValue().nBytes); } byte[] bytes = buffer.getBytes(); write(bytes); }
private int writeIndex() throws IOException { // compress and write BufferedByteWriter buff = new BufferedByteWriter(); buff.putInt(chrPositionMap.size()); for (Map.Entry<String, IndexEntry> entry : chrPositionMap.entrySet()) { IndexEntry ie = entry.getValue(); buff.putNullTerminatedString(entry.getKey()); buff.putLong(ie.position); buff.putInt(ie.size); } byte[] bytes = buff.getBytes(); write(bytes); return bytes.length; }
public void writeTo(BufferedByteWriter fos) throws IOException { // File type TDFTile.Type type = names == null ? TDFTile.Type.bed : TDFTile.Type.bedWithName; fos.putNullTerminatedString(type.toString()); int nPositions = start.length; int nSamples = data.length; fos.putInt(nPositions); for (int i = 0; i < nPositions; i++) { fos.putInt(start[i]); } for (int i = 0; i < nPositions; i++) { fos.putInt(end[i]); } fos.putInt(nSamples); for (int i = 0; i < data.length; i++) { for (int j = 0; j < data[i].length; j++) { fos.putFloat(data[i][j]); } } // Optionally record feature names if (type == TDFTile.Type.bedWithName) { for (int i = 0; i < nPositions; i++) { fos.putNullTerminatedString(names[i]); } } }
public void writeTo(BufferedByteWriter fos) throws IOException { // File type TDFTile.Type type = names == null ? TDFTile.Type.bed : TDFTile.Type.bedWithName; fos.putNullTerminatedString(type.toString()); int nPositions = start.length; int nSamples = data.length; fos.putInt(nPositions); for (int i = 0; i < nPositions; i++) { fos.putInt(start[i]); } for (int i = 0; i < nPositions; i++) { fos.putInt(end[i]); } fos.putInt(nSamples); for (int i = 0; i < data.length; i++) { for (int j = 0; j < data[i].length; j++) { fos.putFloat(data[i][j]); } } // Optionally record feature names if (type == TDFTile.Type.bedWithName) { for (int i = 0; i < nPositions; i++) { fos.putNullTerminatedString(names[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 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 writeTo(BufferedByteWriter fos) throws IOException { // File type fos.putNullTerminatedString(TDFTile.Type.variableStep.toString()); fos.putInt(tileStart); fos.putFloat((float)span); int nPositions = start.length; int nSamples = data.length; fos.putInt(nPositions); for (int i = 0; i < nPositions; i++) { fos.putInt(start[i]); } fos.putInt(nSamples); for (int i = 0; i < data.length; i++) { for (int j = 0; j < data[i].length; j++) { fos.putFloat(data[i][j]); } } }
buffer.putNullTerminatedString(wf.toString()); buffer.putNullTerminatedString(trackType.toString()); buffer.putNullTerminatedString(nm); buffer.putNullTerminatedString(genomeId);
buffer.putNullTerminatedString(wf.toString()); buffer.putNullTerminatedString(trackType.toString()); buffer.putNullTerminatedString(nm); buffer.putNullTerminatedString(genomeId);
public void writeTo(BufferedByteWriter fos) throws IOException { // File type fos.putNullTerminatedString(TDFTile.Type.variableStep.toString()); fos.putInt(tileStart); fos.putFloat((float) span); int nPositions = start.length; int nSamples = data.length; fos.putInt(nPositions); for (int i = 0; i < nPositions; i++) { fos.putInt(start[i]); } fos.putInt(nSamples); for (int i = 0; i < data.length; i++) { for (int j = 0; j < data[i].length; j++) { fos.putFloat(data[i][j]); } } }