Code improvements
Closed this issue · 2 comments
https://github.com/schneebergerlab/plotsr/blob/a006a7b7c1d11694c8564efbda57fde95b1203c0/plotsr/scripts/func.py#L525C26-L525C82
It is possible that the first one after uniq is not the most matched chromosome, I suggest you modify it to match the query chromosome to the most matched ref chromosome.
chrid.append((i, df.loc[(df[0] == i) & (df[6] == 'SYN'), 3].mode().iloc[0])) chrid_dict[i] = df.loc[(df[0] == i) & (df[6] == 'SYN'), 3].mode().iloc[0]
Thanks for checking this. The input must have a unique row for the filtering: df.loc[(df[0] == i) & (df[6] == 'SYN'), 3]
. If that is not the case, then that implies incorrect input. The suggested change would make plotsr work for the cases when it is actually more meaningful for it to crash. But, maybe a try/except block can be added here that can inform of the incorrect output.
Yes, good luck and looking forward to an even better version of the update! Thank you for your reply and support. :)