Open bas-stringer opened 1 year ago
Thanks, I'll work on fixing this soon. Could you please provide a minimal example to reproduce this.
Ammar
I also would like to see this work! Here's an example: (edit: formatting)
amino_acids = ['A', 'R', 'N', 'D', 'C', 'Q', 'E', 'G', 'H', 'I', 'L', 'K', 'M', 'F', 'P', 'S', 'T', 'W', 'Y', 'V']
Sort amino acids in reverse alphabetical order
amino_acids_sorted = sorted(amino_acids, reverse=True)
Generate random integers between 1 and 20 for 3 rows
data = np.random.randint(1, 21, size=(3, len(amino_acids_sorted)))
Create DataFrame with columns in reverse alphabetical order
df = pd.DataFrame(data, columns=amino_acids_sorted) print(df) logomaker.Logo(df,stack_order='fixed')
It looks like the columns are reordered to pandas default (alphabetical) when either self.df = validate_matrix(...) or self.df = transform_matrix(...) edit: my quick fix didn't work. Please disregard.
See title.
Logo(df, stack_order='fixed') results in stacks wherein the glyphs appear in alphabetic order, rather than in the order of df.columns