Class CellXGeneUtils

java.lang.Object
ubic.gemma.core.loader.expression.cellxgene.CellXGeneUtils

public class CellXGeneUtils extends Object
Author:
poirigui
  • Field Details

    • GENE_EXPRESSION_ASSAYS

      public static final List<OntologyTerm> GENE_EXPRESSION_ASSAYS
      List of all known gene expression assays from CELLxGENE.

      TODO: we should keep a list of supported assays in a shared location

  • Constructor Details

    • CellXGeneUtils

      public CellXGeneUtils()
  • Method Details

    • getCollectionUri

      public static String getCollectionUri(String collectionId)
    • getDatasetUri

      @Nullable public static String getDatasetUri(String datasetId)
      FIXME: CELLxGENE does not have a landing page for datasets. The workaround is to fill in the DatabaseEntry.getUri() with a link to the collection obtained by getCollectionUri(String).
    • resolveDataset

      public static DatasetVersion resolveDataset(String collectionId, List<DatasetVersion> datasets, String identifier)
      Resolve a dataset in a collection from a user-supplied identifier.

      The identifier is matched, in order, against the permanent dataset ID, the dataset version ID and the dataset title. Titles are compared exactly first, then ignoring case and surrounding whitespace. Titles are not unique across CELLxGENE, which is why resolution is always scoped to a collection.

      Parameters:
      collectionId - used in error messages only
      datasets - the datasets of the collection, as reported by the curation API
      identifier - a permanent dataset ID, a dataset version ID or a dataset title
      Throws:
      IllegalArgumentException - if no dataset or more than one dataset matches
    • getDatasetMetadata

      public static DatasetMetadata getDatasetMetadata(CollectionMetadata cm, DatasetVersion datasetVersion)
      Select the metadata of a resolved dataset from a collection.
      Throws:
      IllegalStateException - if the collection metadata does not list the dataset's current version, which happens if the dataset was revised between the two requests
    • getGeoAccessions

      public static Set<String> getGeoAccessions(CollectionMetadata cm)
      Extract GEO accessions from the given collection metadata.
    • isGeneExpressionAssay

      public static boolean isGeneExpressionAssay(OntologyTerm a)
      Determine if the given assay corresponds to a single cell assay producing gene expression data.
    • isAnnData

      public static boolean isAnnData(DatasetAsset a)
      Check if the given dataset asset is in AnnData format.

      TODO: handle FileType.RAW_H5AD

    • getTermUri

      public static String getTermUri(OntologyTerm term)
      Convert a CELLxGENE ontology term into a URI.
    • getTermUri

      public static String getTermUri(String termId)
      Convert a CELLxGENE ontology term ID into a URI.