cellmaps_ppi_embedding package

Submodules

cellmaps_ppi_embedding.cellmaps_ppi_embeddingcmd module

cellmaps_ppi_embedding.cellmaps_ppi_embeddingcmd.main(args)[source]

Main entry point for program

Parameters:

args (list) – arguments passed to command line usually sys.argv[1:]()

Returns:

return value of cellmaps_ppi_embedding.runner.CellMapsPPIEmbedder.run() or 2 if an exception is raised

Return type:

int

cellmaps_ppi_embedding.exceptions module

exception cellmaps_ppi_embedding.exceptions.CellMapsPPIEmbeddingError[source]

Bases: Exception

Base exception for CellMapsPPIEmbedding

cellmaps_ppi_embedding.runner module

class cellmaps_ppi_embedding.runner.CellMapsPPIEmbedder(outdir=None, embedding_generator=None, inputdir=None, skip_logging=True, name=None, organization_name=None, project_name=None, provenance_utils=<cellmaps_utils.provenance.ProvenanceUtil object>, input_data_dict=None, provenance=None)[source]

Bases: object

Class to run algorithm

Constructor

Parameters:
  • outdir (str) – directory where ppi embeddings will be saved

  • embedding_generator

  • inputdir (str)

  • skip_logging (bool) – If True skip logging, if None or False do NOT skip logging

  • provenance (dict)

  • input_data_dict (dict)

PPI_EDGELIST_FILEKEY = 'edgelist'
static get_apms_edgelist_file(input_dir=None, edgelist_filename='ppi_edgelist.tsv')[source]
Parameters:
  • edgelist_filename

  • input_dir

Returns:

Returns:

get_ppi_embedding_file()[source]

Gets PPI embedding file in output directory

Returns:

Return type:

str

run()[source]

Run node2vec to create embeddings

Returns:

class cellmaps_ppi_embedding.runner.EmbeddingGenerator(dimensions=1024)[source]

Bases: object

Base class for implementations that generate network embeddings

Constructor

get_dimensions()[source]

Gets number of dimensions this embedding will generate

Returns:

number of dimensions aka vector length

Return type:

int

get_next_embedding()[source]

Generator method for getting next embedding. Caller should implement with yield operator

Raises:

NotImplementedError: Subclasses should implement this

Returns:

Embedding

Return type:

list

class cellmaps_ppi_embedding.runner.FakeEmbeddingGenerator(ppi_downloaddir, dimensions=1024)[source]

Bases: EmbeddingGenerator

Fakes PPI embedding

Constructor

Parameters:

dimensions (int) – Desired size of output embedding

get_next_embedding()[source]

Generator method for getting next embedding. Caller should implement with yield operator

Raises:

NotImplementedError: Subclasses should implement this

Returns:

Embedding

Return type:

list

class cellmaps_ppi_embedding.runner.Node2VecEmbeddingGenerator(nx_network, p=2, q=1, dimensions=1024, walk_length=80, num_walks=80, workers=8)[source]

Bases: EmbeddingGenerator

Constructor

get_next_embedding()[source]
Returns:

Module contents

Top-level package for cellmaps_ppi_embedding.