public class DoubleMatrixReader extends AbstractMatrixReader<DoubleMatrix<String,String>,Double>
basecode.dataStructure.matrix.DoubleMatrix
. Lines beginning with "#" or "!" will be ignored.log
Constructor and Description |
---|
DoubleMatrixReader() |
Modifier and Type | Method and Description |
---|---|
protected cern.colt.list.DoubleArrayList |
createEmptyRow(int numColumns) |
protected DoubleMatrix<String,String> |
createMatrix(List<cern.colt.list.DoubleArrayList> MTemp,
List<String> rowNames,
List<String> colNames1) |
DoubleMatrix<String,String> |
read(InputStream stream) |
DoubleMatrix<String,String> |
read(InputStream stream,
Collection<String> wantedRowNames) |
DoubleMatrix<String,String> |
read(InputStream stream,
Collection<String> wantedRowNames,
boolean createEmptyRows,
int skipColumns,
int maxRows) |
DoubleMatrix<String,String> |
read(InputStream stream,
Collection<String> wantedRowNames,
int numberOfColumnsToSkip) |
DoubleMatrix<String,String> |
read(String filename) |
DoubleMatrix<String,String> |
read(String filename,
Collection<String> wantedRowNames)
Read a matrix from a file, subject to filtering criteria.
|
DoubleMatrix<String,String> |
read(String fileName,
Collection<String> wantedRowNames,
int numberOfColumnsToSkip) |
DoubleMatrix<String,String> |
read(String filename,
int maxRows) |
readHeader
public DoubleMatrix<String,String> read(InputStream stream) throws IOException
read
in class AbstractMatrixReader<DoubleMatrix<String,String>,Double>
stream
- InputStream stream to read fromIOException
public DoubleMatrix<String,String> read(InputStream stream, Collection<String> wantedRowNames) throws IOException
stream
- InputStreamwantedRowNames
- Setread( stream, wantedRowNames, createEmptyRows )
with createEmptyRows
set to
true.IOException
public DoubleMatrix<String,String> read(InputStream stream, Collection<String> wantedRowNames, boolean createEmptyRows, int skipColumns, int maxRows) throws IOException
stream
- InputStreamwantedRowNames
- SetcreateEmptyRows
- if a row contained in wantedRowNames
is not found in the file, create an
empty row filled with Double.NaN iff this param is true.maxRows
- IOException
public DoubleMatrix<String,String> read(InputStream stream, Collection<String> wantedRowNames, int numberOfColumnsToSkip) throws IOException
stream
- wantedRowNames
- numberOfColumnsToSkip
- IOException
public DoubleMatrix<String,String> read(String filename) throws IOException
read
in class AbstractMatrixReader<DoubleMatrix<String,String>,Double>
filename
- data file to read from (can be compressed)IOException
public DoubleMatrix<String,String> read(String filename, Collection<String> wantedRowNames) throws IOException
filename
- data file to read from (can be compressed)wantedRowNames
- contains names of rows we want to getIOException
public DoubleMatrix<String,String> read(String fileName, Collection<String> wantedRowNames, int numberOfColumnsToSkip) throws IOException
fileName
- wantedRowNames
- if null, takes all rowsnumberOfColumnsToSkip
- how many columns to skip -- not counting the first column. So if you set this to 4,
the first four data columns will be skipped. If you set it to zero, only the first column will be skipped.IOException
public DoubleMatrix<String,String> read(String filename, int maxRows) throws IOException
read
in class AbstractMatrixReader<DoubleMatrix<String,String>,Double>
IOException
protected cern.colt.list.DoubleArrayList createEmptyRow(int numColumns)
Copyright © 2003–2023 UBC Michael Smith Laboratories. All rights reserved.