SingleCellAnalyticsCollectionProxy extends CollectionProxy { public static SingleCellAnalyticsSchemaField metadataAsSchemaField(String metadata) { if (metadata.startsWith("characteristic")) { return new SingleCellAnalyticsSchemaField( metadata, metadataFieldNameToDisplayName(metadata, "characteristic_")); } else { return new SingleCellAnalyticsSchemaField( metadata, metadataFieldNameToDisplayName(metadata, "factor_")); } } SingleCellAnalyticsCollectionProxy(SolrClient solrClient); static SingleCellAnalyticsSchemaField characteristicAsSchemaField(String characteristic); static SingleCellAnalyticsSchemaField factorAsSchemaField(String factor); static SingleCellAnalyticsSchemaField metadataAsSchemaField(String metadata); static String metadataFieldNameToDisplayName(String metadataFieldName); static String attributeNameToFieldName(String attributeName); QueryResponse query(SolrQueryBuilder<SingleCellAnalyticsCollectionProxy> solrQueryBuilder); static final SingleCellAnalyticsSchemaField CELL_ID; static final SingleCellAnalyticsSchemaField CHARACTERISTIC_INFERRED_CELL_TYPE; static final SingleCellAnalyticsSchemaField CHARACTERISTIC_SPECIES; static final SingleCellAnalyticsSchemaField CHARACTERISTIC_ORGANISM_PART; static final SingleCellAnalyticsSchemaField FACTORS; static final SingleCellAnalyticsSchemaField EXPERIMENT_ACCESSION; }
@Test void validFactorNameToSchemaField() { assertThat(SingleCellAnalyticsCollectionProxy.metadataAsSchemaField("factor_biopsy_site")) .isInstanceOf(SingleCellAnalyticsSchemaField.class) .extracting("fieldName", "displayName") .contains("factor_biopsy_site", "Biopsy site"); }
@Test void validCharacteristicNameToSchemaField() { assertThat(SingleCellAnalyticsCollectionProxy.metadataAsSchemaField("characteristic_cell_type")) .isInstanceOf(SingleCellAnalyticsSchemaField.class) .extracting("fieldName", "displayName") .contains("characteristic_cell_type", "Cell type"); }