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

Assign view paired #324

Merged
merged 12 commits into from
Apr 1, 2022
Merged

Assign view paired #324

merged 12 commits into from
Apr 1, 2022

Conversation

Phlya
Copy link
Member

@Phlya Phlya commented Jan 20, 2022

Created a function to assign view to a bedpe-style dataframe, to be used in snipping and dotcaller. Still need to actually replace the deprecated function.
Aims to close #251

@Phlya
Copy link
Member Author

Phlya commented Jan 20, 2022

[Whoops accidentally based this on the branch for https://github.com//pull/322...]

@Phlya
Copy link
Member Author

Phlya commented Feb 4, 2022

Tests fail for test_expected, and I haven't touched any of that...

@gfudenberg
Copy link
Member

gfudenberg commented Feb 4, 2022 via email

@Phlya
Copy link
Member Author

Phlya commented Mar 30, 2022

Rename function to assign_view_paired.

cols_view=cols_view,
)
features[cols_right[1:]] = features[cols_right[1:]].astype(
int
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you check if this cast is needed for the final output - i.e. for after the second assign_view application ? just in case (also is it an expected behavior on bioframe side of things ? issue-worthy or not ?)

Copy link
Member Author

@Phlya Phlya Apr 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because the df start off with numpy int dtypes, and then bioframe converts the other columns to numpy float64. But if it is pd.Int64Dtype from the beginning, this cast is not necessary.

In the second run of assign_view the cols_right[1:] get cast to pd.Int64Dtype, and the other ones are already that from this first cast... It's confusing. But the second cast is not necessary.

I don't know if this should be an issue in bioframe, I remember extended discussions about dtypes there and I think we couldn't find a way to avoid this sort of weird casting...

@sergpolly sergpolly changed the title [WIP] Assign view 2D Assign view paired Mar 31, 2022
@sergpolly sergpolly merged commit b00d8c5 into master Apr 1, 2022
@gfudenberg gfudenberg deleted the assign_view_2D branch August 24, 2022 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

deprecate cooltools copy of assign_regions, switch to bioframe version
3 participants