Replies: 1 comment
-
potential "forced" implementation from @Phlya @agalitsyna branch: ### Draft "force" implementation:
# if not force:
# if feature_type=='bed':
# if not bioframe.is_bedframe(features_df[['chrom', 'start', 'end']]):
# raise ValueError("features_df is not a valid bedframe, use force=True if you still want to use it.")
# elif feature_type=='bedpe':
# if not bioframe.is_bedframe(features_df.rename({'chrom1': 'chrom', 'start1':'start', 'end1':'end'}, axis=1)[['chrom', 'start', 'end']]) or \
# not bioframe.is_bedframe(features_df.rename({'chrom2': 'chrom', 'start2':'start', 'end2':'end'}, axis=1)[['chrom', 'start', 'end']]):
# raise ValueError("features_df first or second coordinates does not represent a valid bedframe, use force=True if you still want to use it.")
### Mask out of bounds features?
# features_df["region"] = np.where(
# np.logical_and(
# features_df["end"]
# <= features_df["region"].replace(
# view_df[["name", "end"]].set_index("name")["end"]
# ),
# features_df["start"] >= 0,
# ),
# features_df["region"],
# None,
# ) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Beta Was this translation helpful? Give feedback.
All reactions