fasterius / VarClust

A Python package for clustering of single nucleotide variants from high-through seqencing data.
Other
5 stars 3 forks source link

Heatmap: location for distance matrix, path for output figure #6

Open Ascalon98 opened 5 days ago

Ascalon98 commented 5 days ago

Hi! I tried to use the heatmap function, but it did not work. I am not sure where the distance matrix is supposed to be, but it was in my miniconda3 directory, which I think is weird. Could you also tell me what the path for the output figure should be? It seems it is not just a simple jpg file.

(base) aimre@sisko:~/VarClust_data$ varclust_heatmap /home5/aimre/miniconda3/bin/varclust_distance_matrix /home5/aimre/Varclust_figure/heatmap1.jpg
Traceback (most recent call last):
  File "/home5/aimre/miniconda3/bin/varclust_heatmap", line 127, in <module>
    cluster.cluster_hierarchical(distances=distances,
  File "/home5/aimre/miniconda3/lib/python3.11/site-packages/varclust/cluster.py", line 148, in cluster_hierarchical
    colours['label'] = colours['index'].str.split(': ', 1).str[0]
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home5/aimre/miniconda3/lib/python3.11/site-packages/pandas/core/strings/accessor.py", line 137, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: StringMethods.split() takes from 1 to 2 positional arguments but 3 were given
(base) aimre@sisko:~/VarClust_data$ varclust_heatmap /home5/aimre/miniconda3/bin/varclust_distance_matrix /home5/aimre/miniconda3/bin/varclust_heatmap
Traceback (most recent call last):
  File "/home5/aimre/miniconda3/bin/varclust_heatmap", line 127, in <module>
    cluster.cluster_hierarchical(distances=distances,
  File "/home5/aimre/miniconda3/lib/python3.11/site-packages/varclust/cluster.py", line 148, in cluster_hierarchical
    colours['label'] = colours['index'].str.split(': ', 1).str[0]
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home5/aimre/miniconda3/lib/python3.11/site-packages/pandas/core/strings/accessor.py", line 137, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: StringMethods.split() takes from 1 to 2 positional arguments but 3 were given
(base) aimre@sisko:~/VarClust_data$ varclust_heatmap /home5/aimre/miniconda3/bin/varclust_distance_matrix /home5/aimre/Varclust_figure/heatmap1.jpg
Traceback (most recent call last):
  File "/home5/aimre/miniconda3/bin/varclust_heatmap", line 127, in <module>
    cluster.cluster_hierarchical(distances=distances,
  File "/home5/aimre/miniconda3/lib/python3.11/site-packages/varclust/cluster.py", line 148, in cluster_hierarchical
    colours['label'] = colours['index'].str.split(': ', 1).str[0]
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home5/aimre/miniconda3/lib/python3.11/site-packages/pandas/core/strings/accessor.py", line 137, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: StringMethods.split() takes from 1 to 2 positional arguments but 3 were given
fasterius commented 2 days ago

Could you please write down all of the commands that you have run, from the start, as well as where your data is stored? I think that if you've gotten results inside your Conda directory you've done something odd.

Ascalon98 commented 1 day ago

Hi! Yes indeed! I overwrote the distance matrix script somehow. So I downloaded the source code and copied the distance matrix script in the miniconda folder again, and then it worked! Thus now I could generate the the distance matrix and it is in one of my folders. I used this command for it:

(base) aimre@sisko:~/VarClust-0.2.3/bin$ varclust_distance_matrix /home5/aimre/Varclust_profiles/ /home5/aimre/Varclust_profiles/output_distance_matrix

However for the heatmap I am getting a similar error message. I am sorry, probably it is something very basic that I am missing. So I really appreciate your help!

(base) aimre@sisko:~/Varclust_profiles$ varclust_heatmap /home5/aimre/Varclust_profiles/output_distance_matrix /home5/aimre/Varclust_profiles/output_heatmap_figure Traceback (most recent call last): File "/home5/aimre/miniconda3/bin/varclust_heatmap", line 123, in cluster.cluster_hierarchical(distances=distances, File "/home5/aimre/miniconda3/lib/python3.11/site-packages/varclust/cluster.py", line 148, in cluster_hierarchical colours['label'] = colours['index'].str.split(': ', 1).str[0] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home5/aimre/miniconda3/lib/python3.11/site-packages/pandas/core/strings/accessor.py", line 137, in wrapper return func(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: StringMethods.split() takes from 1 to 2 positional arguments but 3 were given

Ascalon98 commented 1 day ago

I also add the information you asked previously: I entirely followed the instructions so far. I have single sample vcf.gz files in this folder /home5/aimre/VarClust_data/ and the generated profile files in this folder /home5/aimre/Varclust_profiles/.

Command for creating profiles: varclust_create_profiles /home5/aimre/VarClust_data/ /home5/aimre/Varclust_profiles/

I think the rest of the steps I have done is in my previous comment. Let me know if you need more information!