Open SimonE1220 opened 8 months ago
Hi @SimonE1220 !
Multiple issues could be associated with this:
It would be useful if you share your full code here, or some screenshots about your data/tensor objects.
Thank you very much. The error altough appears if I set the upper rank to 25. Here I just used 2 in order to reduce computational time to check for the error. Thats the code:
Can you provide more details, as for examples the ones in this screenshot?
Thanks!
torch.Size([2, 1136, 6, 6]) missing_fraction: 0.7027581930160522 sparsity_fraction: 0.06341695785522461 excluded_value_fraction: 0.7027582228183746
can you check what version of tensorly you are using?
import tensorly
tensorly.__version__
My guess, this could be due to tensorly version, or because you have only two contexts/samples in your tensor.
Can you try passing a rank
in your pipeline function? Maybe something like rank=6
and check whether you get a decomposition.
An alternative is that you export your tensor and metadata using these commands,
# Export Tensor after decomposition
c2c.io.export_variable_with_pickle(tensor2, output_folder + 'Tensor.pkl')
# Export Tensor Metadata
c2c.io.export_variable_with_pickle(meta_tensor, output_folder + 'Tensor-Metadata.pkl')
Then put them in your google drive, and load them in this Google Colab notebook to check whether it's an issue with your environment or not: https://colab.research.google.com/drive/1sbNuer5CsPU2hFzyea0AjD_3kgSPOWoC?usp=sharing
Another option is to try reducing the expr_prop
when running liana, this could help to reduce the sparsity. For example you can use this:
li.mt.rank_aggregate.by_sample(adata,
sample_key='sample_new',
groupby='celltype',
resource_name = 'consensus',
expr_prop=0.05,
min_cells = 5,
n_perms = 100,
use_raw = False,
verbose = True,
inplace = True
)
Hey, now it worked ! I am very happy. Thanks a lot. Did even work without the expr_prop option.
Dear all, thank you for the nice package. However, unfortunatley i have an issue with the tensor2 = c2c.analysis.run_tensor_cell2cell_pipeline(..) function I tried now many times to run it but it always get this error:
rank = int(_compute_elbow(loss)) else: rank = manual_elbow TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'
After finishing the Elbow analysis.
I am new here, so sorry if sometihing is missing in this question. Would be great if you could help me.
Python Version: 3.11.7