alexarnimueller / modlAMP

Python package for peptide sequence generation, peptide descriptor calculation and sequence analysis.
https://modlamp.org
Other
50 stars 17 forks source link

GlobalAnalysis of different seq_database #16

Open poppop-dot opened 1 month ago

poppop-dot commented 1 month ago

Hello @alexarnimueller: I used the GlobalAnalysis method you provided to compare different sequence libraries:

Traceback (most recent call last): File "d:/reoccur/amp-gan/ampgan/evaluation/analyze_seq.py", line 44, in analysis.plot_summary() File "E:\anaconda3\envs\ampgan_test\lib\site-packages\modlamp\analysis.py", line 304, in plot_summary color=colors[:num]) File "E:\anaconda3\envs\ampgan_test\lib\site-packages\matplotlib__init__.py", line 1414, in inner return func(ax, *map(sanitize_sequence, args), **kwargs) File "E:\anaconda3\envs\ampgan_test\lib\site-packages\matplotlib\axes_axes.py", line 6597, in hist raise ValueError(f"The 'color' keyword argument must have one " ValueError: The 'color' keyword argument must have one color per dataset, but 2000 datasets and 3 colors were provided

The 2 D array shape of my input is (3,5000)。

alexarnimueller commented 1 month ago

It looks like your data frame is organized with one dataset per row. Can you try to transpose it to one dataset per column? e.g. df.T

poppop-dot commented 1 month ago

It looks like your data frame is organized with one dataset per row. Can you try to transpose it to one dataset per column? e.g. df.T I have tried transposing the array before typing it, or recreating a new array. But the error is shown: Traceback (most recent call last): File "d:/reoccur/amp-gan/ampgan/evaluation/analyze_seq.py", line 44, in analysis.plot_summary() File "E:\anaconda3\envs\ampgan_test\lib\site-packages\modlamp\analysis.py", line 231, in plot_summary patch.set(facecolor=colors[p], edgecolor='black', alpha=0.8) IndexError: list index out of range

poppop-dot commented 1 month ago

In my attempt, only the (3,3) arrays can run, nothing else