Class MexSingleCellDataLoader
- java.lang.Object
-
- ubic.gemma.core.loader.expression.singleCell.MexSingleCellDataLoader
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,DataLoader
,SequencingDataLoader
,SingleCellDataLoader
public class MexSingleCellDataLoader extends Object implements SingleCellDataLoader
Load single cell data from 10X Genomics MEX format.- Author:
- poirigui
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Free any resources that the loaded has setup.float[]
double2float(double[] vec)
int[]
double2int(double[] vec)
long[]
double2long(double[] vec)
Set<CellTypeAssignment>
getCellTypeAssignments(SingleCellDimension dimension)
MEX does not provide cell type labels.Set<ExperimentalFactor>
getFactors(Collection<BioAssay> samples, Map<BioMaterial,Set<FactorValue>> factorValueAssignments)
MEX does not provide experimental factors.Set<String>
getGenes()
Load gene identifiers present in the data.Set<CellLevelCharacteristics>
getOtherCellLevelCharacteristics(SingleCellDimension dimension)
Load cell-level characteristics that are not cell type assignments present in the data.Set<QuantitationType>
getQuantitationTypes()
Load quantitation types present in the data.Set<String>
getSampleNames()
Obtain the sample names present in the data.Map<BioMaterial,Set<Characteristic>>
getSamplesCharacteristics(Collection<BioAssay> samples)
MEX does not provide sample characteristics.Map<BioAssay,SequencingMetadata>
getSequencingMetadata(Collection<BioAssay> samples)
Retrieve various sequencing metadata if counting data is present.Map<BioAssay,SequencingMetadata>
getSequencingMetadata(SingleCellDimension dimension)
SingleCellDimension
getSingleCellDimension(Collection<BioAssay> bioAssays)
Load the single-cell dimension present in the data.Stream<SingleCellExpressionDataVector>
loadVectors(Collection<CompositeSequence> designElements, SingleCellDimension scd, QuantitationType quantitationType)
Produces a stream of single-cell expression data vectors for the givenQuantitationType
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ubic.gemma.core.loader.expression.DataLoader
setBioAssayToSampleNameMapper, setDesignElementToGeneMapper, setIgnoreUnmatchedDesignElements, setIgnoreUnmatchedSamples
-
-
-
-
Method Detail
-
getSampleNames
public Set<String> getSampleNames()
Description copied from interface:DataLoader
Obtain the sample names present in the data.- Specified by:
getSampleNames
in interfaceDataLoader
-
getSingleCellDimension
public SingleCellDimension getSingleCellDimension(Collection<BioAssay> bioAssays) throws IOException
Description copied from interface:SingleCellDataLoader
Load the single-cell dimension present in the data.Not all samples might be present and thus the returned
SingleCellDimension
will have a expression data for a subset of the data.- Specified by:
getSingleCellDimension
in interfaceSingleCellDataLoader
- Parameters:
bioAssays
- a set of bioassays to use when populating the dimension, not all bioassays may be used- Throws:
IOException
-
getQuantitationTypes
public Set<QuantitationType> getQuantitationTypes() throws IOException
Description copied from interface:DataLoader
Load quantitation types present in the data.- Specified by:
getQuantitationTypes
in interfaceDataLoader
- Throws:
IOException
-
getCellTypeAssignments
public Set<CellTypeAssignment> getCellTypeAssignments(SingleCellDimension dimension)
MEX does not provide cell type labels.- Specified by:
getCellTypeAssignments
in interfaceSingleCellDataLoader
-
getOtherCellLevelCharacteristics
public Set<CellLevelCharacteristics> getOtherCellLevelCharacteristics(SingleCellDimension dimension)
Description copied from interface:SingleCellDataLoader
Load cell-level characteristics that are not cell type assignments present in the data.- Specified by:
getOtherCellLevelCharacteristics
in interfaceSingleCellDataLoader
-
getFactors
public Set<ExperimentalFactor> getFactors(Collection<BioAssay> samples, @Nullable Map<BioMaterial,Set<FactorValue>> factorValueAssignments)
MEX does not provide experimental factors.- Specified by:
getFactors
in interfaceDataLoader
- Parameters:
samples
- samples to use when determining which factors to loadfactorValueAssignments
- if non-null, the proposed assignment of factor values to samples are populated in the mapping.- Returns:
- a set of factors present in the data
-
getSamplesCharacteristics
public Map<BioMaterial,Set<Characteristic>> getSamplesCharacteristics(Collection<BioAssay> samples)
MEX does not provide sample characteristics.- Specified by:
getSamplesCharacteristics
in interfaceDataLoader
- Parameters:
samples
- to use when determining which characteristics to load- Returns:
- proposed characteristics grouped by sample
-
getGenes
public Set<String> getGenes() throws IOException
Description copied from interface:DataLoader
Load gene identifiers present in the data.- Specified by:
getGenes
in interfaceDataLoader
- Throws:
IOException
-
getSequencingMetadata
public Map<BioAssay,SequencingMetadata> getSequencingMetadata(SingleCellDimension dimension) throws IOException
- Specified by:
getSequencingMetadata
in interfaceSingleCellDataLoader
- Throws:
IOException
-
getSequencingMetadata
public Map<BioAssay,SequencingMetadata> getSequencingMetadata(Collection<BioAssay> samples) throws IOException
Description copied from interface:SequencingDataLoader
Retrieve various sequencing metadata if counting data is present.- Specified by:
getSequencingMetadata
in interfaceSequencingDataLoader
- Throws:
IOException
-
loadVectors
public Stream<SingleCellExpressionDataVector> loadVectors(Collection<CompositeSequence> designElements, SingleCellDimension scd, QuantitationType quantitationType) throws IOException
Description copied from interface:SingleCellDataLoader
Produces a stream of single-cell expression data vectors for the givenQuantitationType
.- Specified by:
loadVectors
in interfaceSingleCellDataLoader
- Parameters:
designElements
- a collection of design elements for mapping of element names used in the dataset toCompositeSequence
scd
- a dimension to use for creating vectors, may be loaded from the single-cell data withSingleCellDataLoader.getSingleCellDimension(Collection)
quantitationType
- a quantitation type to extract from the data for, may be loaded from the single-cell data withDataLoader.getQuantitationTypes()
- Returns:
- a stream of single-cell expression data vectors that must be closed when done, preferably using a try-with-resource block.
- Throws:
IOException
-
close
public void close() throws IOException
Description copied from interface:DataLoader
Free any resources that the loaded has setup.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceDataLoader
- Throws:
IOException
-
double2float
public float[] double2float(double[] vec)
-
double2int
public int[] double2int(double[] vec)
-
double2long
public long[] double2long(double[] vec)
-
-