You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Thu, May 9, 2024, 19:50 DekkerBastiaan ***@***.***> wrote:
Hi,
While running scaling by pairs I ran into the following error.
File
~/miniconda3/envs/tools/lib/python3.10/site-packages/pairtools/lib/scaling.py:54,
in (.0)
def assign_regs(chroms, pos, regs):
gb_regs = regs.sort_values(["chrom", "start", "end"]).groupby(["chrom"])
regs_dict = {
---> chrom.encode(): regs_per_chrom[["start", "end"]]
.values.flatten()
.astype(np.int64)
for chrom, regs_per_chrom in gb_regs
}
return assign_regs_c(np.asarray(chroms).astype("bytes"), np.asarray(pos),
regs_dict)
AttributeError: 'tuple' object has no attribute 'encode'
Perhaps it is due to how my regions dataframe was constructed, but the
following change at the groupby function did fix the issue.
regs.sort_values(["chrom", "start", "end"]).groupby(["chrom"])
regs.sort_values(["chrom", "start", "end"]).groupby("chrom")
Let me know if this this is due to my regions formatting or if others will
have the same problem.
—
Reply to this email directly, view it on GitHub
<#240>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAG64CS2K35AWHYHXJLMQ7TZBOZPFAVCNFSM6AAAAABHPHKVPOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI4DQMJXGU2DSMA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
Hi,
While running scaling by pairs I ran into the following error.
Perhaps it is due to how my regions dataframe was constructed, but the following change at the groupby function did fix the issue.
Let me know if this this is due to my regions formatting or if others will have the same problem.
The text was updated successfully, but these errors were encountered: