Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -853,19 +853,31 @@ Map<FactorValue, ExpressionExperimentSubSet> getSubSetsByFactorValue(
Taxon getTaxon( ExpressionExperiment expressionExperiment );

/**
* Indicate if the given experiment is a single-cell experiment.
* Indicate if the given experiment is a single-cell RNA-Seq experiment.
* <p>
* Gemma does not treat single-cell experiments differently from other experiments, so we need to rely on various
* aspect of the dataset to determine if it is a single-cell experiment.
*/
boolean isSingleCell( ExpressionExperiment ee );

/**
* @param expressionExperiment ee
* @return true if this experiment was run on a sequencing-based platform.
* Indicate if the given experiment is a bulk RNA-Seq experiment.
*/
boolean isBulkRNASeq( ExpressionExperiment ee );

/**
* Indicate if the given experiment is a RNA-Seq experiment.
* <p>
* This includes single-cell, bulk and potentially other kind of RNA-Seq experiments.
*/
boolean isRNASeq( ExpressionExperiment expressionExperiment );

/**
* Indicate if the given experiment is a microarray experiment.
* @return
*/
boolean isMicroarray(ExpressionExperiment expressionExperiment);

/**
* Check if the dataset is either troubled or uses a troubled platform.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1593,13 +1593,59 @@ public boolean isSingleCell( ExpressionExperiment ee ) {
&& ee.getCharacteristics().stream()
.noneMatch( c -> hasCategory( c, Categories.ASSAY )
&& hasValue( c, Values.FLUORESCENCE_ACTIVATED_CELL_SORTING ) ) )
|| expressionExperimentDao.hasSingleCellQuantitationTypes( ee );
// more expensive, check the presence of SC vectors
|| hasSingleCellData( ee );
}

@Override
public boolean isBulkRNASeq( ExpressionExperiment ee ) {
return ee.getCharacteristics().stream()
.anyMatch( c -> hasCategory( c, Categories.ASSAY )
&& hasAnyValue( c ) )
||
// include FAC-sorted single-cell datasets
( ee.getCharacteristics().stream()
.anyMatch( c -> hasCategory( c, Categories.ASSAY ) && hasAnyValue( c,
Values.SINGLE_NUCLEUS_RNA_SEQUENCING_ASSAY,
Values.SINGLE_CELL_RNA_SEQUENCING_ASSAY,
Values.RNASEQ_OF_CODING_RNA_FROM_SINGLE_CELLS,
Values.SINGLE_NUCLEUS_RNA_SEQUENCING,
Values.SINGLE_CELL_RNA_SEQUENCING
) )
&& ee.getCharacteristics().stream()
.anyMatch( c -> hasCategory( c, Categories.ASSAY )
&& hasValue( c, Values.FLUORESCENCE_ACTIVATED_CELL_SORTING ) ) )
|| hasBulkRnaSeqData( ee );
// TODO: check the presence of vectors from the RNA-Seq pipeline
}

@Override
@Transactional(readOnly = true)
public boolean isRNASeq( ExpressionExperiment expressionExperiment ) {
Collection<ArrayDesign> ads = this.expressionExperimentDao.getArrayDesignsUsed( expressionExperiment );
public boolean isRNASeq( ExpressionExperiment ee ) {
return ee.getCharacteristics().stream()
.anyMatch( c -> hasCategory( c, Categories.ASSAY ) && hasAnyValue( c,
Values.SINGLE_NUCLEUS_RNA_SEQUENCING_ASSAY,
Values.SINGLE_CELL_RNA_SEQUENCING_ASSAY,
Values.RNASEQ_OF_CODING_RNA_FROM_SINGLE_CELLS,
Values.SINGLE_NUCLEUS_RNA_SEQUENCING,
Values.SINGLE_CELL_RNA_SEQUENCING,
Values.BULK_RNA_SEQ
) )
|| ( !isMicroarray( ee ) && hasSequencingPlatform( ee ) )
|| expressionExperimentDao.hasSingleCellQuantitationTypes( ee )
|| hasBulkRnaSeqData( ee )
;
}

@Override
@Transactional(readOnly = true)
public boolean isMicroarray( ExpressionExperiment ee ) {
return ee.getCharacteristics().stream()
.anyMatch( c -> hasCategory( c, Categories.ASSAY ) && hasValue( c, Values.MICROARRAY ) );
}

private boolean hasSequencingPlatform( ExpressionExperiment ee ) {
Collection<ArrayDesign> ads = this.expressionExperimentDao.getArrayDesignsUsed( ee );
/*
* This isn't completely bulletproof. We are simply assuming that if any of the platforms isn't a microarray (or
* 'OTHER'), it's RNA-seq.
Expand All @@ -1613,7 +1659,15 @@ public boolean isRNASeq( ExpressionExperiment expressionExperiment ) {
}
}
return false;
}

private boolean hasBulkRnaSeqData( ExpressionExperiment ee ) {
// TODO: check for the presence of vectors from the RNA-Seq pipeline
return false;
}

private boolean hasSingleCellData(ExpressionExperiment ee) {
return expressionExperimentDao.hasSingleCellQuantitationTypes( ee );
}

/**
Expand Down