You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have used tensor-cell2cell but currently using a dataset that doesn't have a clear context/condition to set, hence I have reverted to the previous cell2cell. I wanted to clarify whether cell2cell automatically does the interaction calculation on a per-sample basis, or if not, how it might be best to do this manually.
I believe it is not considering samples separately, since I cannot find something like 'sample_col' to feed into the SingleCellInteractions function. However this line in the tutorial is slightly ambiguous (https://github.com/earmingol/cell2cell/blob/master/examples/cell2cell/Toy-Example-SingleCellPipeline.ipynb): "It generates an interaction space containing an instance for each sample/cell type". Is this referring to the selection of a single sample in the toy example, and should I be hence running cell2cell for each sample manually? How would be best to reintegrate the sample interaction info afterwards?
Thanks a lot for any advice
The text was updated successfully, but these errors were encountered:
In Tensor-cell2cell you can treat each sample as a context if you want to, it doesn't necessarily have to be a condition like a disease for example.
If you decide to go with cell2cell, you need to create an interaction space for each sample separately, then run the permutation for each interaction space independently. You can do this by iterating the code for each sample:
result_dict = dict()
for sample, df in adata.obs.groupby('sample_id'): # Instead of sample_id use the column name for locating your samples.
cells = df.index.tolist()
adata_sample = adata[cells]
# Continue with the normal code of cell2cell, you can create a dictionary to store your interaction spaces and save the results
# For example:
result_dict[sample] = interactions
Hello,
I have used tensor-cell2cell but currently using a dataset that doesn't have a clear context/condition to set, hence I have reverted to the previous cell2cell. I wanted to clarify whether cell2cell automatically does the interaction calculation on a per-sample basis, or if not, how it might be best to do this manually.
I believe it is not considering samples separately, since I cannot find something like 'sample_col' to feed into the SingleCellInteractions function. However this line in the tutorial is slightly ambiguous (https://github.com/earmingol/cell2cell/blob/master/examples/cell2cell/Toy-Example-SingleCellPipeline.ipynb): "It generates an interaction space containing an instance for each sample/cell type". Is this referring to the selection of a single sample in the toy example, and should I be hence running cell2cell for each sample manually? How would be best to reintegrate the sample interaction info afterwards?
Thanks a lot for any advice
The text was updated successfully, but these errors were encountered: