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

fixed visualization of sample values (wrong key) #21

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions intrasom/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,16 +588,15 @@ def search_strings(search_list, target_list):
if samples_label:
if project_samples_label is not None:
samples_label_names = project_samples_label.index.tolist()
som_bmus = (project_samples_label.BMU.values-1).tolist()
rep_samples_dic = select_keys(self.rep_sample(project = project_samples_label), som_bmus)
som_bmus = project_samples_label.BMU.values.tolist()
rep_samples_dic = select_keys(self.rep_sample(project=project_samples_label), som_bmus)
else:
if samples_label_index == "all":
samples_label_names = self.sample_names
samples_label_index = np.arange(0, len(samples_label_names), 1)
else:
samples_label_index = np.array(samples_label_index)
samples_label_names = self.sample_names[samples_label_index]


som_bmus = self.bmus.astype(int)[samples_label_index]
rep_samples_dic = select_keys(self.rep_sample(), som_bmus+1)
Expand All @@ -620,7 +619,7 @@ def filter_dictionary(dictionary, values):
for key, value in rep_samples_dic_filter.items():
if isinstance(value, list):
value = ', '.join(value)
file.write(f'BMU {key+1}: {value}\n')
file.write(f'BMU {key}: {value}\n')

counter = 0
for j in range(self.mapsize[1]):
Expand Down