Skip to content
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

"IndexError: list index out of range" in plot_1d_clusters #50

Open
SebastianHollizeck opened this issue Oct 18, 2020 · 2 comments
Open

Comments

@SebastianHollizeck
Copy link

Hi,

I seem to have run into an issue when generating the plots with the command

~/bin/PhylogicNDT/PhylogicNDT.py Cluster -i CA99 -sif /dawson_genomics/Projects/CASCADE/CA99/analysis/phylogicNDT/samples.sif -rb --maf_input_type calc_ccf

There were file produced

total 904M
drwxrwsr-x 2 shollizeck res_dawsongenomics  512 Oct 14 23:36 CA99_1d_cluster_plots
-rw-r--r-- 1 shollizeck res_dawsongenomics 549K Oct 14 23:34 CA99.cluster_ccfs.txt
-rw-rw-r-- 1 shollizeck res_dawsongenomics 1.7K Oct 14 23:36 CA99.cnvs.txt
-rw-r--r-- 1 shollizeck res_dawsongenomics 903M Oct 14 23:36 CA99.mut_ccfs.txt
-rw-rw-r-- 1 shollizeck res_dawsongenomics 111K Oct 14 23:36 CA99.unclustered.txt

but the 1d cluster plots folder is empty and the log file displays the following error at the end

Traceback (most recent call last):
  File "/home/shollizeck/bin/PhylogicNDT/PhylogicNDT.py", line 515, in <module>
    args.func(args)
  File "/home/shollizeck/bin/PhylogicNDT/Cluster/Cluster.py", line 100, in run_tool
    phylogicoutput.plot_1d_clusters('{}.cluster_ccfs.txt'.format(patient_data.indiv_name))
  File "/home/shollizeck/bin/PhylogicNDT/output/PhylogicOutput.py", line 703, in plot_1d_clusters
    dist.setAttribute('fill', ClusterColors.get_rgb_string(c))
  File "/home/shollizeck/bin/PhylogicNDT/output/PhylogicOutput.py", line 1456, in get_rgb_string
    return 'rgb({},{},{})'.format(*cls.color_list[c])
IndexError: list index out of range

Could it be, that the program ran out of colours to use, as the CA99.cluster_ccfs.txt says there are 81 clusters to be considered?

Cheers,
Sebastian

@jcha40
Copy link
Contributor

jcha40 commented Jan 26, 2021

Your intuition is correct, PhylogicNDT is limited to 58 colors for clusters. If there are any clusters with very few events (maybe less than 5), there is a high possibility that they are artifactual, and I would try blacklisting them.

@SebastianHollizeck
Copy link
Author

Hi,

sorry I was occupied with another project, so now that i am coming back I would like to fix this problem.

I ran PhylogicNDT again but without -rb, because i thought then i can blacklist the clusters which have low support, however the program still fails with the same error, so i cannot really blacklist clusters, before they are created.

nevertheless I then had a look at the cluster assignment you can see, that the smallest cluster is still 6 variants.
I could remove everything under 10 supporting variants, which seems arbitraty, but if thats the only way to get it to run I will try that. Is there an option for the clustering to supply a minimum amount of required support?

[shollizeck@vmpr-res-cluster1 ~]$ cut -f 14 PhylogicNDT/CA80.mut_ccfs.txt | sort | uniq -c | sort -n
      1 Cluster_Assignment
      6 55
      8 38
     11 42
     12 12
     12 22
     15 34
     18 37
     18 43
     21 23
     24 41
     24 48
     24 5
     30 36
     34 11
     34 45
     35 30
     36 16
     36 4
     36 9
     42 2
     42 20
     42 26
     42 52
     48 10
     48 33
     60 28
     62 6
     72 24
     72 49
     78 17
     90 32
     92 27
     93 18
     94 53
     99 13
     99 15
    100 25
    108 46
    113 29
    117 31
    126 54
    129 50
    132 14
    132 7
    136 3
    136 35
    138 58
    159 21
    170 39
    174 40
    188 51
    202 56
    216 47
    264 19
    264 44
    434 8
   7817 57
   8779 1

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

No branches or pull requests

2 participants