Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 4, 2024
1 parent b1a7034 commit 8ea881b
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 17 deletions.
12 changes: 10 additions & 2 deletions dance/modules/single_modality/imputation/deepimpute.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,16 @@
from torch.utils.data import DataLoader, TensorDataset

from dance.modules.base import BaseRegressionMethod
from dance.transforms import (AnnDataTransform, CellwiseMaskData, Compose, FilterCellsScanpy, FilterGenesScanpy,
GeneHoldout, SaveRaw, SetConfig)
from dance.transforms import (
AnnDataTransform,
CellwiseMaskData,
Compose,
FilterCellsScanpy,
FilterGenesScanpy,
GeneHoldout,
SaveRaw,
SetConfig,
)
from dance.typing import Any, List, LogLevel, Optional, Tuple


Expand Down
11 changes: 9 additions & 2 deletions dance/modules/single_modality/imputation/graphsci.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,15 @@
import torch.nn.functional as F

from dance.modules.base import BaseRegressionMethod
from dance.transforms import (AnnDataTransform, CellwiseMaskData, Compose, FilterCellsScanpy, FilterGenesScanpy,
SaveRaw, SetConfig)
from dance.transforms import (
AnnDataTransform,
CellwiseMaskData,
Compose,
FilterCellsScanpy,
FilterGenesScanpy,
SaveRaw,
SetConfig,
)
from dance.transforms.graph import FeatureFeatureGraph
from dance.typing import LogLevel

Expand Down
11 changes: 9 additions & 2 deletions dance/modules/spatial/cell_type_deconvo/card.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,15 @@

from dance import logger
from dance.modules.base import BaseRegressionMethod
from dance.transforms import (CellTopicProfile, Compose, FilterGenesCommon, FilterGenesMarker, FilterGenesMatch,
FilterGenesPercentile, SetConfig)
from dance.transforms import (
CellTopicProfile,
Compose,
FilterGenesCommon,
FilterGenesMarker,
FilterGenesMatch,
FilterGenesPercentile,
SetConfig,
)
from dance.typing import Any, LogLevel, Optional, Tuple
from dance.utils.matrix import normalize, pairwise_distance

Expand Down
11 changes: 9 additions & 2 deletions dance/modules/spatial/cell_type_deconvo/dstg.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,15 @@

from dance import logger
from dance.modules.base import BaseRegressionMethod
from dance.transforms import (AnnDataTransform, Compose, FilterGenesCommon, PseudoMixture, RemoveSplit, ScaleFeature,
SetConfig)
from dance.transforms import (
AnnDataTransform,
Compose,
FilterGenesCommon,
PseudoMixture,
RemoveSplit,
ScaleFeature,
SetConfig,
)
from dance.transforms.graph import DSTGraph
from dance.typing import Any, LogLevel, Optional, Tuple
from dance.utils import get_device
Expand Down
22 changes: 17 additions & 5 deletions dance/transforms/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
from dance.transforms import graph
from dance.transforms.cell_feature import BatchFeature, CellPCA, CellSVD, WeightedFeaturePCA
from dance.transforms.filter import (FilterCellsScanpy, FilterCellsScanpyOrder, FilterGenesCommon, FilterGenesMarker,
FilterGenesMarkerGini, FilterGenesMatch, FilterGenesPercentile,
FilterGenesRegression, FilterGenesScanpy, FilterGenesScanpyOrder, FilterGenesTopK,
FilterScanpy, HighlyVariableGenesLogarithmizedByMeanAndDisp,
HighlyVariableGenesLogarithmizedByTopGenes, HighlyVariableGenesRawCount)
from dance.transforms.filter import (
FilterCellsScanpy,
FilterCellsScanpyOrder,
FilterGenesCommon,
FilterGenesMarker,
FilterGenesMarkerGini,
FilterGenesMatch,
FilterGenesPercentile,
FilterGenesRegression,
FilterGenesScanpy,
FilterGenesScanpyOrder,
FilterGenesTopK,
FilterScanpy,
HighlyVariableGenesLogarithmizedByMeanAndDisp,
HighlyVariableGenesLogarithmizedByTopGenes,
HighlyVariableGenesRawCount,
)
from dance.transforms.gene_holdout import GeneHoldout
from dance.transforms.interface import AnnDataTransform
from dance.transforms.mask import CellwiseMaskData, MaskData
Expand Down
18 changes: 16 additions & 2 deletions dance/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,22 @@

import os
from logging import Logger
from typing import (TYPE_CHECKING, Any, Callable, Dict, Iterator, List, Literal, Mapping, Optional, Sequence, Set,
Tuple, Type, Union)
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
Iterator,
List,
Literal,
Mapping,
Optional,
Sequence,
Set,
Tuple,
Type,
Union,
)

import numpy as np
from anndata import AnnData
Expand Down
10 changes: 8 additions & 2 deletions examples/single_modality/imputation/scgnn2.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@
from dance import logger
from dance.datasets.singlemodality import ImputationDataset
from dance.modules.single_modality.imputation.scgnn2 import ScGNN2
from dance.transforms import (AnnDataTransform, CellwiseMaskData, Compose, FilterCellsScanpy, FilterGenesScanpy,
FilterGenesTopK)
from dance.transforms import (
AnnDataTransform,
CellwiseMaskData,
Compose,
FilterCellsScanpy,
FilterGenesScanpy,
FilterGenesTopK,
)
from dance.utils import set_seed

if __name__ == "__main__":
Expand Down

0 comments on commit 8ea881b

Please sign in to comment.