Skip to content

P(s) curve and its derivative on individual chromosomes #315

Answered by golobor
LAlvarezGlez asked this question in Q&A
Discussion options

You must be logged in to vote

sure!

You should be able to re-use the code for derivative plotting from our contacts-vs-distance notebook (currently, cells 13-15) with two small modifications:

  1. Filter the cvd dataframe to select only the chromosomal region of interest:
cvd_merged = cvd_merged[cvd_merged['name'] == 'chr2_p']
  1. Instead of 'balanced.avg.smoothed.agg' (which contains genome-wide aggregated contact frequencies), use 'balanced.avg.smoothed' (non-aggregated contact frequencies).
der = np.gradient(np.log(cvd_merged['balanced.avg.smoothed']),
                  np.log(cvd_merged['s_bp']))
f, axs = plt.subplots(
    figsize=(6.5,13),
    nrows=2,
    gridspec_kw={'height_ratios':[6,2]},
    sharex=True)
ax = ax…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by golobor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #314 on November 25, 2021 10:59.