DrugFeatureSet

class DrugFeatureSet(**kwargs)[source]

Bases: collections.UserDict, Mapping[str, Mapping[str, Union[torch.FloatTensor, torchdrug.data.molecule.Molecule]]]

Drug feature set for compounds.

Methods Summary

from_dict(data)

Generate a drug feature set from a data dictionary.

get_feature_matrix(drugs)

Get the drug feature matrix for a list of drugs.

get_molecules(drugs)

Get the molecular structures.

Methods Documentation

classmethod from_dict(data)[source]

Generate a drug feature set from a data dictionary.

Return type

DrugFeatureSet

get_feature_matrix(drugs)[source]

Get the drug feature matrix for a list of drugs.

Parameters

drugs (Iterable[str]) – A list of drug identifiers.

Return type

FloatTensor

Returns

A matrix of drug features.

get_molecules(drugs)[source]

Get the molecular structures.

Parameters

drugs (Iterable[str]) – A list of drug identifiers.

Return type

PackedGraph

Returns

The molecules batched together for message passing.