Skip to content

Conversation

@xingzhongyu
Copy link
Collaborator

@xingzhongyu xingzhongyu commented Jan 13, 2024

add CellTypeNums SC3Feature RESEPTGraph TangramFeature test
Changed local github repository. So I will pre-commit install next time
The code of the automl demo is a bit irregular. I will continue to modify it in the future and learn singularity if necessary.
It is ready to review in the transform test part @RemyLau
complete automl in single modality,maybe need to change it.
More information is needed on the inputs, functions, and return values of functions
In general, leave out the outdated comments.They're caused by file moves, which I've pretty much added to the new file.

@RemyLau
Copy link
Collaborator

RemyLau commented Jan 13, 2024

@xingzhongyu Please let me know when it is ready review. Thanks!

@xingzhongyu
Copy link
Collaborator Author

@RemyLau OK. I need to add some comments to review in the transform test part , and the automatic machine learning part needs to be modified


def __call__(self, data: Data) -> Data:
xy_pixel = data.get_feature(return_type="numpy", channel="spatial_pixel", channel_type="obsm")
sc.pp.neighbors(data.data, n_neighbors=self.n_neighbors)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neighbors need to be calculated in advance

sim_matrix_mean = np.mean(sim_matrix_all, axis=0)

data.data.uns[self.out] = sim_matrix_mean
data.data.obsm[self.out] = sim_matrix_mean
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to obsm

data = Data(adata.copy())
RESEPTgraph = RESEPTGraph()
RESEPTgraph(data)
assert data.data.uns['RESEPTGraph'].shape == (2000, 2000, 3)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test passed

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resize to (2000,2000,3)

sc3feature = SC3Feature()
data = sc3feature(data)
sc3_feature = data.get_feature(return_type="numpy", channel="SC3Feature", channel_type="obsm")
assert sc3_feature.shape[0] == data.shape[0]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test passed

tangramFeature = TangramFeature()
data = tangramFeature(data)
tangram_feature = data.get_feature(return_type="numpy", channel="TangramFeature", channel_type="obs")
assert np.sum(tangram_feature) == 1
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure the sum is 1 and the test passed

data = Data(adata.copy())
data = CellTypeNums()(data)
cell_type_nums = data.get_feature(return_type="numpy", channel="CellTypeNums", channel_type="uns")
return cell_type_nums.shape[0] == len(np.unique(cell_types))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test passed.Make sure the number of cell types is the same

for i, j in params_dict.items():
idx, key = i.split(f"{Pipeline.PIPELINE_KEY}.", 1)[1].split(".", 1)
idx, key = i.split(f"{Pipeline.PIPELINE_KEY}.", i)[1].split(".", 1)
idx = int(idx)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it should be PARAMS_KEY

if param_dict is not None:
for key, val in param_dict.items():
search_space[f"{self.PARAMS_KEY}.{i}.{key}"] = val
if type(val) == DictConfig:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants