-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Files not found when running compute_metrics() on Windows #21
Comments
Thanks for bringing it up, I think the reason behind that is that I hard-coded the path of the temporary folder as |
This issue now has been fixed by removing all hard-coded Unix style file paths "/", please download this specific commit (2c45cb7) using pip, instructions can be found (https://stackoverflow.com/questions/13685920/install-specific-git-commit-with-pip). |
Hi @frankligy, Nicolas |
Hi @Bio-data-tricks, Sorry for the confusion and inconvenience, you may use the full SHA hash for this commit like below:
Then run the program like the testing example:
I attached the standard output from my test run on my own PC, it is windows 10 system with Intel chip. And how the output result should look like: Let me know if that can solve the problem and happy to further clarify! Best, |
Hi @frankligy, Nicolas |
The package works with Linux. I take this opportunity to ask you some questions: 1) Do you see any limitation ? 2) Are all the metrics suitable for my data. 3) Is there a way to consider the spatial information ? Thank you for your time. Nicolas |
Hi @Bio-data-tricks, Thanks for digging into that and that's all great questions! [1] Since we preprint the paper about a year ago, we've been exploring the possibility to apply it to spatial data, and this is one of the avenues that we are trying to pursue ourselves as well. So far, I think the concept of scTriangulate generalizes very well to the spatial context, due to its flexibility to incorporate any features and stability metrics. So as long as there are observations of the shape [2] That's a great point, indeed, when the values are not naturally zero and non-zero, TFIDF doesn't make logical sense if directly applying it. This is a common problem we encounter in the single-cell field as well, sometimes the data is transformed after batch correction which violates the non-negativity of the count data. What we do is to additionally supply the raw count matrix in But I understand this may not be applicable in your case, since you are dealing with image data, so in your case, manually disabling TFIDF sounds like a reasonable choice. You mentioned removing TFIDF from I also want to emphasize, we can easily write customized stability metrics functions and pass them to the scTriangulate like signature below: # define stability metric
def my_stability_metric(adata,key,arg1,arg2):
# required arguments are adata and key (name of the annotation)
# you can have as much as additional arguments as possible
pass
# must return a dictionary keyed by cluster name in each annotation (key), valued by the computed metric
return cluster_to_metric
# pass to the program
sctri = ScTriangulate(dir,adata,query,add_metrics={'name_of_stability':my_stability_metric})
sctri.lazy_run(added_metrics_kwargs=[{'arg1':arg1_value,'arg2':arg2_value}]) Because after all, you are dealing with a new modality, so I think defining some modality-specific stability metric may be beneficial. [3] Yes, I wrote a few spatial stability metrics (https://sctriangulate.readthedocs.io/en/latest/api.html#cluster-level-spatial-stability), for example, assortativity score can measure whether a cell type tend to mix with itself or other cell types, based on spatial information. The implementation is not that complicated (https://sctriangulate.readthedocs.io/en/latest/_modules/sctriangulate/spatial.html#cluster_level_spatial_stability) and mostly based on the squidy and networkx package, so should be easy to modify. Also, I wrote a few spatial features to consider (https://sctriangulate.readthedocs.io/en/latest/api.html#create-spatial-features), the features can be either spatial coordinates, spatial-graph-related spatial features or image-related features (intensity, histogram, texture), just in case that might be of a bit help. I used those features a few times and I haven't rigorously tested the spatial module so it is still labeled as "experimental", so I'd be appreciated any bug report or feedback. Best, |
Hello, I am trying to use sctriangulate in windows and I have the same problem as mentioned in this issue even when I install the package using the specific commit. Is there any update for a solution ? Thank you in advance ! |
Hi @ChaDub, I am not sure why because as my screenshot showed, I tested on my windows PC as well and I can generate all the expected output without any problem. If you use the dummy test file I provided (https://github.com/frankligy/scTriangulate/tree/main/test), would you still face the same issue? And this issue is a very explicit issue, as the error suggest, due to the file path divider difference between windows and Unix system, so it shouldn't be that mysterious. Any chance the env is not properly set up (so you are actually run the previous version instead of the particular commit)? I mean if you start a new conda env, using python3.7, and pip install the commit, would that by any chance solve the problem? As last resort, any chance you may be able to switch to a linux system, if your input file is not small, I think people would typically use HPC cluster for this task as well. Best, |
Hello, Thank you very much for your answer ! I created a new conda env with python 3.7 and install the specific commit but I still have the issue + I also have the issue #23 and I can't install the pandas 1.5.3 (I have an error saying that this pandas version is not compatible with python 3.7). I will try in a linux system ! Thanks again, |
Hi @ChaDub, The issue #23 I think I tested in google colab which is by default python3.10, that's why I wrote pandas 1.5.3, I just checked the original env (https://github.com/frankligy/scTriangulate/blob/main/reproduce/sctri_new_env_py37_linux.yml), pandas 1.3.5 should be the right version. Best, |
Hello, I tested the package in a linux system (in a VM) and it worked ! Thank you for your answers, Best, |
I ran my code on windows system. Here are the errors:
File "", line 1, in
File "C:\Users\jiabl9\Anaconda3\envs\scTriangulate\lib\site-packages\sctriangulate\main_class.py", line 972, in compute_metrics
subprocess.run(['rm','-r','{}'.format(os.path.join(self.dir,'scTriangulate_local_mode_enrichr/'))])
File "C:\Users\jiabl9\Anaconda3\envs\scTriangulate\lib\subprocess.py", line 493, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Users\jiabl9\Anaconda3\envs\scTriangulate\lib\subprocess.py", line 858, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\jiabl9\Anaconda3\envs\scTriangulate\lib\subprocess.py", line 1311, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
The text was updated successfully, but these errors were encountered: