Description

  • Determining how differences in our isopycnic cfg conditions vary in meaningful ways from those of Clay et al., 2003. Eur Biophys J
  • Needed to determine whether the Clay et al., 2003 function describing diffusion is applicable to our data

standard conditions from: Clay et al., 2003. Eur Biophys J

  • Standard conditions:
    • 44k rev/min for Beckman XL-A
      • An-50 Ti Rotor
    • 44.77k rev/min for Beckman model E
    • 35k rev/min for preparative ultra-cfg & fractionation
      • De Sario et al., 1995: vertical rotor: VTi90 (Beckman)
        • 35k rpm for 16.5 h
  • Our conditions:
    • speed (R) = 55k rev/min
    • radius top/bottom (cm) = 2.6, 4.85
    • angular velocity: w = ((2 * 3.14159 * R)/60)^2
    • TLA110 rotor

In [18]:
import numpy as np

In [3]:
%load_ext rpy2.ipython

In [26]:
%%R
library(ggplot2)
library(dplyr)


Attaching package: ‘dplyr’

The following object is masked from ‘package:stats’:

    filter

The following objects are masked from ‘package:base’:

    intersect, setdiff, setequal, union

Beckman XL-A

Beckman model E

Angular velocity (omega)


In [16]:
# angular velocity: our setup
angular_vel_f = lambda R: (2 * 3.14159 * R / 60)
print angular_vel_f(55000)

# angular velocity: De Sario et al., 1995
print angular_vel_f(35000)


5759.58166667
3665.18833333

Meselson et al., 1957 equation on s.d. of band due to diffusion

\begin{equation} \sigma^2 = \frac{RT}{M_{PX_n}\bar{\upsilon}_{PX_n} (\frac{dp}{dr})_{r_0} \omega^2 r_0} \end{equation}
  • R = gas constant
  • T = temperature (C)
  • M = molecular weight
    • PX_n = macromolecular electrolyte
  • v = partial specific volume (mL/g)
  • w = angular velocity
  • r_0 = distance between the band center and rotor center
  • dp/dr = density gradient

Time to equilibrium: vertical rotor

radius_max - radius_min = width_of_tube

  • VTi90 Rotor
    • radius_max = 71.1 mm
    • radius_min = 57.9 mm

In [26]:
%%R -w 14 -h 6 -u in
library(ggplot2)
library(reshape)
library(grid)

# radius top,bottom (cm)
r.top = 57.9 / 10
r.bottom = 71.1 / 10

# isoconcentration point
I = sqrt((r.top^2 + r.top * r.bottom + r.bottom^2)/3)

# rpm
R = 35000

# particle density
D = 1.70

# beta^o
B = 1.14e9

# dna in bp from 0.1kb - 100kb
L = seq(100, 100000, 100)

# angular velocity
## 2*pi*rpm / 60
w = ((2 * 3.14159 * R)/60)^2

# DNA GC content
G.C = seq(0.1, 0.9, 0.05)

# Molecular weight
# M.W in relation to GC content (dsDNA)
A = 313.2
T = 304.2
C = 289.2
G = 329.2
GC = G + C
AT = A + T
#GC2MW = function(x){ x*GC + (1-x)*AT + 157 }  # assuming 5' monophosphate on end of molecules
GC2MW = function(x){ x*GC + (1-x)*AT  }
M.W = sapply(G.C, GC2MW)

# buoyant density
## GC_fraction = (p - 1.66) / 0.098
GC2buoyant.density = function(x){ (x * 0.098) + 1.66 }
B.D = GC2buoyant.density(G.C)

# radius of the isoconcentration point from cfg center (AKA: r.p)
## position of the particle at equilibrium 
buoyant.density2radius = function(x){ sqrt( ((x-D)*2*B/w) + I^2 ) }
P = buoyant.density2radius(B.D)

# calculating S
S.fun = function(L){ 2.8 + (0.00834 * (L*M.W)^0.479) }
S = t(sapply( L, S.fun ))

# calculating T 
T = matrix(ncol=17, nrow=length(L))
for(i in 1:ncol(S)){
    T[,i] = 1.13e14 * B * (D-1) / (R^4 * P[i]^2 * S[,i])
}

## formating
T = as.data.frame(T)
colnames(T) = G.C
T$dna_size__kb = L / 1000
T.m = melt(T, id.vars=c('dna_size__kb'))
colnames(T.m) = c('dna_size__kb', 'GC_content', 'time__h')
#T.m$GC_content = as.numeric(as.character(T.m$GC_content))

## plotting
p = ggplot(T.m, aes(dna_size__kb, time__h, color=GC_content, group=GC_content)) +
        geom_line() +
        scale_y_continuous(limits=c(0,175)) +
        labs(x='DNA length (kb)', y='Time (hr)') +
        scale_color_discrete(name='GC content') +
        #geom_hline(yintercept=66, linetype='dashed', alpha=0.5) +
        theme( text = element_text(size=18) )

#print(p)

# plotting at small scale
p.sub = ggplot(T.m, aes(dna_size__kb, time__h, color=GC_content, group=GC_content)) +
        geom_line() +
        scale_x_continuous(limits=c(0,5)) +
        scale_y_continuous(limits=c(0,175)) +
        labs(x='DNA length (kb)', y='Time (hr)') +
        scale_color_discrete(name='GC content') +
        #geom_hline(yintercept=66, linetype='dashed', alpha=0.5) +
        theme( 
            text = element_text(size=14),
            legend.position = 'none'
            ) 

vp = viewport(width=0.43, height=0.52, x = 0.65, y = 0.68)
print(p)
print(p.sub, vp=vp)


Plotting band s.d. as defined the ultra-cfg technical manual

density gradient

\begin{equation} \frac{d\rho}{dr} = \frac{\omega^2r}{\beta} \end{equation}

band standard deviation

\begin{equation} \sigma^2 = \frac{\theta}{M_{app}}\frac{RT}{(\frac{d\rho}{dr})_{eff} \omega^2r_o} \end{equation}

combined

\begin{equation} \sigma^2 = \frac{\theta}{M_{app}}\frac{RT}{\frac{\omega^4r_o^2}{\beta}} \end{equation}

buoyant density of a molecule

\begin{equation} \theta = \rho_i + \frac{\omega^2}{2\beta}(r_o^2 - r_1^2) \end{equation}

standard deviation due to diffusion (Clay et al., 2003)

\begin{equation} \sigma_{diffusion}^2 = \Big(\frac{100%}{0.098}\Big)^2 \frac{\rho RT}{\beta_B^2GM_{Cs}} \frac{1}{1000l} \end{equation}

In [196]:
%%R

# gas constant
R = 8.3144621e7 #J / mol*K

# temp
T = 273.15 + 23   # 23oC 

# rotor speed (rpm)
S = 55000

# beta^o
beta = 1.14 * 10^-9
#beta = 1.195 * 10^-10

# G
G = 7.87 * 10^10   #cgs 

# angular velocity
## 2*pi*rpm / 60
omega = 2 * pi * S /60

# GC
GC = seq(0,1,0.1)

# lengths
lens = seq(1000, 100000, 10000)

# molecular weight
GC2MW.dry = function(x){ 
    A = 313.2
    T = 304.2
    C = 289.2
    G = 329.2
    GC = G + C
    AT = A + T
    x*GC + (1-x)*AT  
}

M.dry = sapply(GC, GC2MW)

GC2MW.dryCS = function(n){
    #n = number of bases
    #base pair = 665 daltons
    #base pair per dry cesium DNA = 665 * 4/3 ~= 882
    return(n * 882)
    }

M.dryCS = sapply(lens, GC2MW.dryCS)


# BD
GC2BD = function(x){ 
    (x * 0.098) + 1.66 
    }
rho = sapply(GC, GC2BD)


# sd
calc_s.d = function(p=1.72, L=50000, T=298, B=1.195e9, G=7.87e-10, M=882){
    R = 8.3145e7
    x = (100 / 0.098)^2 * ((p*R*T)/(B^2*G*L*M))
    return(x)
    }

# run
p=seq(1.7, 1.75, 0.01)
L=seq(1000, 50000, 1000)
m = outer(p, L, calc_s.d)
rownames(m) = p
colnames(m) = L


         1000     2000     3000     4000     5000     6000     7000     8000
1.7  44.24560 22.12280 14.74853 11.06140 8.849119 7.374266 6.320799 5.530699
1.71 44.50586 22.25293 14.83529 11.12647 8.901173 7.417644 6.357981 5.563233
1.72 44.76613 22.38307 14.92204 11.19153 8.953226 7.461022 6.395162 5.595766
1.73 45.02640 22.51320 15.00880 11.25660 9.005280 7.504400 6.432343 5.628300
1.74 45.28667 22.64333 15.09556 11.32167 9.057334 7.547778 6.469524 5.660834
1.75 45.54694 22.77347 15.18231 11.38673 9.109387 7.591156 6.506705 5.693367
         9000    10000    11000    12000    13000    14000    15000    16000
1.7  4.916177 4.424560 4.022327 3.687133 3.403507 3.160400 2.949706 2.765350
1.71 4.945096 4.450586 4.045988 3.708822 3.423528 3.178990 2.967058 2.781616
1.72 4.974015 4.476613 4.069648 3.730511 3.443549 3.197581 2.984409 2.797883
1.73 5.002933 4.502640 4.093309 3.752200 3.463569 3.216171 3.001760 2.814150
1.74 5.031852 4.528667 4.116970 3.773889 3.483590 3.234762 3.019111 2.830417
1.75 5.060771 4.554694 4.140631 3.795578 3.503610 3.253353 3.036462 2.846684
        17000    18000    19000    20000    21000    22000    23000    24000
1.7  2.602682 2.458089 2.328716 2.212280 2.106933 2.011163 1.923722 1.843566
1.71 2.617992 2.472548 2.342414 2.225293 2.119327 2.022994 1.935038 1.854411
1.72 2.633302 2.487007 2.356112 2.238307 2.131721 2.034824 1.946354 1.865255
1.73 2.648612 2.501467 2.369811 2.251320 2.144114 2.046655 1.957670 1.876100
1.74 2.663922 2.515926 2.383509 2.264333 2.156508 2.058485 1.968986 1.886945
1.75 2.679232 2.530385 2.397207 2.277347 2.168902 2.070315 1.980302 1.897789
        25000    26000    27000    28000    29000    30000    31000    32000
1.7  1.769824 1.701754 1.638726 1.580200 1.525710 1.474853 1.427277 1.382675
1.71 1.780235 1.711764 1.648365 1.589495 1.534685 1.483529 1.435673 1.390808
1.72 1.790645 1.721774 1.658005 1.598790 1.543660 1.492204 1.444069 1.398942
1.73 1.801056 1.731785 1.667644 1.608086 1.552634 1.500880 1.452465 1.407075
1.74 1.811467 1.741795 1.677284 1.617381 1.561609 1.509556 1.460860 1.415208
1.75 1.821877 1.751805 1.686924 1.626676 1.570584 1.518231 1.469256 1.423342
        33000    34000    35000    36000    37000    38000    39000    40000
1.7  1.340776 1.301341 1.264160 1.229044 1.195827 1.164358 1.134502 1.106140
1.71 1.348663 1.308996 1.271596 1.236274 1.202861 1.171207 1.141176 1.112647
1.72 1.356549 1.316651 1.279032 1.243504 1.209895 1.178056 1.147850 1.119153
1.73 1.364436 1.324306 1.286469 1.250733 1.216930 1.184905 1.154523 1.125660
1.74 1.372323 1.331961 1.293905 1.257963 1.223964 1.191754 1.161197 1.132167
1.75 1.380210 1.339616 1.301341 1.265193 1.230998 1.198604 1.167870 1.138673
        41000    42000    43000    44000     45000     46000     47000
1.7  1.079161 1.053467 1.028967 1.005582 0.9832355 0.9618608 0.9413956
1.71 1.085509 1.059663 1.035020 1.011497 0.9890192 0.9675188 0.9469333
1.72 1.091857 1.065860 1.041073 1.017412 0.9948029 0.9731768 0.9524709
1.73 1.098205 1.072057 1.047126 1.023327 1.0005867 0.9788348 0.9580085
1.74 1.104553 1.078254 1.053178 1.029242 1.0063704 0.9844928 0.9635461
1.75 1.110901 1.084451 1.059231 1.035158 1.0121541 0.9901508 0.9690838
         48000     49000     50000
1.7  0.9217832 0.9029713 0.8849119
1.71 0.9272055 0.9082829 0.8901173
1.72 0.9326277 0.9135945 0.8953226
1.73 0.9380500 0.9189061 0.9005280
1.74 0.9434723 0.9242177 0.9057334
1.75 0.9488945 0.9295293 0.9109387

In [85]:
%%R

# gas constant
R = 8.3144621e7 #J / mol*K

# temp
T = 273.15 + 23   # 23oC 

# rotor speed (rpm)
S = 55000

# beta^o
beta = 1.14 * 10^-9
#beta = 1.195 * 10^-10

# G
G = 7.87 * 10^10   #cgs 

# angular velocity
## 2*pi*rpm / 60
omega = 2 * pi * S /60

# GC
GC = seq(0,1,0.1)

# lengths
lens = seq(1000, 100000, 10000)

# molecular weight
GC2MW.dry = function(x){ 
    A = 313.2
    T = 304.2
    C = 289.2
    G = 329.2
    GC = G + C
    AT = A + T
    x*GC + (1-x)*AT  
}

#GC2MW = function(x){ x*GC + (1-x)*AT  }

M.dry = sapply(GC, GC2MW.dry)


GC2MW.dryCS = function(n){
    #n = number of bases
    #base pair = 665 daltons
    #base pair per dry cesium DNA = 665 * 4/3 ~= 882
    return(n * 882)
    }

M.dryCS = sapply(lens, GC2MW.dryCS)


# BD
GC2BD = function(x){ 
    (x * 0.098) + 1.66 
    }
rho = sapply(GC, GC2BD)


# sd
calc_s.d = function(p=1.72, L=50000, T=298, B=1.195e9, G=7.87e-10, M=882){
    R = 8.3145e7
    x = (100 / 0.098)^2 * ((p*R*T)/(B^2*G*L*M))
    return(sqrt(x))
    }

# run
p=seq(1.7, 1.75, 0.01)
L=seq(500, 50000, 500)
m = outer(p, L, calc_s.d)
rownames(m) = p
colnames(m) = L

In [86]:
%%R
heatmap(m, Rowv=NA, Colv=NA)



In [87]:
%%R -w 500 -h 350

df = as.data.frame(list('fragment_length'=as.numeric(colnames(m)), 'GC_sd'=m[1,]))
#df$GC_sd = sqrt(df$GC_var)

ggplot(df, aes(fragment_length, GC_sd)) +
    geom_line() +
    geom_vline(xintercept=4000, linetype='dashed', alpha=0.6) +
    labs(x='fragment length (bp)', y='G+C s.d.') +
    theme(
        text = element_text(size=16)
        )


Notes:

  • Small fragment size (<4000 bp) leads to large standard deviations in realized G+C

In [70]:
%%R
calc_s.d = function(p=1.72, L=50000, T=298, B=1.195e9, G=7.87e-10, M=882){
    R = 8.3145e7
    sigma_sq = (p*R*T)/(B^2*G*L*M)
    return(sqrt(sigma_sq))    
    }

# run
p=seq(1.7, 1.75, 0.01)
L=seq(500, 50000, 500)
m = outer(p, L, calc_s.d)
rownames(m) = p
colnames(m) = L
head(m)


             500        1000        1500        2000        2500        3000
1.7  0.009218836 0.006518702 0.005322498 0.004609418 0.004122789 0.003763574
1.71 0.009245911 0.006537846 0.005338129 0.004622955 0.004134897 0.003774627
1.72 0.009272906 0.006556935 0.005353715 0.004636453 0.004146970 0.003785648
1.73 0.009299823 0.006575968 0.005369255 0.004649912 0.004159007 0.003796637
1.74 0.009326662 0.006594946 0.005384751 0.004663331 0.004171010 0.003807594
1.75 0.009353425 0.006613870 0.005400202 0.004676712 0.004182979 0.003818520
            3500        4000        4500        5000        5500        6000
1.7  0.003484393 0.003259351 0.003072945 0.002915252 0.002779584 0.002661249
1.71 0.003494626 0.003268923 0.003081970 0.002923814 0.002787747 0.002669064
1.72 0.003504829 0.003278467 0.003090969 0.002932350 0.002795886 0.002676857
1.73 0.003515003 0.003287984 0.003099941 0.002940862 0.002804002 0.002684628
1.74 0.003525147 0.003297473 0.003108887 0.002949350 0.002812095 0.002692376
1.75 0.003535262 0.003306935 0.003117808 0.002957813 0.002820164 0.002700101
            6500        7000        7500        8000        8500        9000
1.7  0.002556845 0.002463838 0.002380293 0.002304709 0.002235896 0.002172901
1.71 0.002564354 0.002471074 0.002387284 0.002311478 0.002242463 0.002179282
1.72 0.002571841 0.002478288 0.002394254 0.002318227 0.002249010 0.002185645
1.73 0.002579307 0.002485482 0.002401204 0.002324956 0.002255538 0.002191989
1.74 0.002586751 0.002492655 0.002408134 0.002331666 0.002262048 0.002198315
1.75 0.002594173 0.002499808 0.002415044 0.002338356 0.002268539 0.002204623
            9500       10000       10500       11000       11500       12000
1.7  0.002114946 0.002061394 0.002011715 0.001965462 0.001922260 0.001881787
1.71 0.002121157 0.002067448 0.002017623 0.001971235 0.001927906 0.001887314
1.72 0.002127351 0.002073485 0.002023514 0.001976990 0.001933535 0.001892824
1.73 0.002133526 0.002079504 0.002029388 0.001982729 0.001939147 0.001898318
1.74 0.002139683 0.002085505 0.002035245 0.001988451 0.001944744 0.001903797
1.75 0.002145823 0.002091489 0.002041085 0.001994157 0.001950324 0.001909260
           12500       13000       13500       14000       14500       15000
1.7  0.001843767 0.001807963 0.001774166 0.001742196 0.001711895 0.001683122
1.71 0.001849182 0.001813272 0.001779376 0.001747313 0.001716922 0.001688065
1.72 0.001854581 0.001818566 0.001784572 0.001752415 0.001721935 0.001692993
1.73 0.001859965 0.001823845 0.001789752 0.001757501 0.001726934 0.001697908
1.74 0.001865332 0.001829109 0.001794917 0.001762574 0.001731918 0.001702808
1.75 0.001870685 0.001834358 0.001800067 0.001767631 0.001736887 0.001707694
           15500       16000       16500       17000       17500       18000
1.7  0.001655752 0.001629675 0.001604793 0.001581017 0.001558268 0.001536473
1.71 0.001660615 0.001634462 0.001609506 0.001585661 0.001562844 0.001540985
1.72 0.001665463 0.001639234 0.001614206 0.001590290 0.001567407 0.001545484
1.73 0.001670298 0.001643992 0.001618891 0.001594906 0.001571957 0.001549971
1.74 0.001675118 0.001648737 0.001623564 0.001599509 0.001576494 0.001554444
1.75 0.001679925 0.001653468 0.001628222 0.001604099 0.001581017 0.001558904
           18500       19000       19500       20000       20500       21000
1.7  0.001515567 0.001495493 0.001476195 0.001457626 0.001439740 0.001422497
1.71 0.001520018 0.001499885 0.001480531 0.001461907 0.001443969 0.001426675
1.72 0.001524456 0.001504264 0.001484853 0.001466175 0.001448185 0.001430840
1.73 0.001528881 0.001508631 0.001489163 0.001470431 0.001452388 0.001434994
1.74 0.001533294 0.001512984 0.001493461 0.001474675 0.001456580 0.001439135
1.75 0.001537694 0.001517326 0.001497747 0.001478906 0.001460760 0.001443265
           21500       22000       22500       23000       23500       24000
1.7  0.001405859 0.001389792 0.001374263 0.001359243 0.001344705 0.001330624
1.71 0.001409988 0.001393873 0.001378299 0.001363235 0.001348655 0.001334532
1.72 0.001414105 0.001397943 0.001382323 0.001367215 0.001352592 0.001338429
1.73 0.001418210 0.001402001 0.001386336 0.001371184 0.001356519 0.001342314
1.74 0.001422303 0.001406047 0.001390337 0.001375141 0.001360434 0.001346188
1.75 0.001426384 0.001410082 0.001394326 0.001379087 0.001364337 0.001350051
           24500       25000       25500       26000       26500       27000
1.7  0.001316977 0.001303740 0.001290895 0.001278423 0.001266305 0.001254525
1.71 0.001320844 0.001307569 0.001294686 0.001282177 0.001270023 0.001258209
1.72 0.001324701 0.001311387 0.001298467 0.001285921 0.001273732 0.001261883
1.73 0.001328546 0.001315194 0.001302236 0.001289653 0.001277429 0.001265546
1.74 0.001332380 0.001318989 0.001305994 0.001293375 0.001281116 0.001269198
1.75 0.001336204 0.001322774 0.001309741 0.001297087 0.001284792 0.001272840
           27500       28000       28500       29000       29500       30000
1.7  0.001243068 0.001231919 0.001221065 0.001210492 0.001200190 0.001190147
1.71 0.001246718 0.001235537 0.001224651 0.001214048 0.001203715 0.001193642
1.72 0.001250358 0.001239144 0.001228226 0.001217592 0.001207230 0.001197127
1.73 0.001253988 0.001242741 0.001231792 0.001221127 0.001210734 0.001200602
1.74 0.001257607 0.001246328 0.001235347 0.001224651 0.001214228 0.001204067
1.75 0.001261216 0.001249904 0.001238891 0.001228165 0.001217712 0.001207522
           30500       31000       31500       32000       32500       33000
1.7  0.001180351 0.001170793 0.001161464 0.001152355 0.001143456 0.001134760
1.71 0.001183818 0.001174232 0.001164875 0.001155739 0.001146814 0.001138093
1.72 0.001187274 0.001177660 0.001168276 0.001159113 0.001150162 0.001141416
1.73 0.001190720 0.001181079 0.001171668 0.001162478 0.001153501 0.001144729
1.74 0.001194157 0.001184487 0.001175049 0.001165833 0.001156830 0.001148033
1.75 0.001197583 0.001187886 0.001178421 0.001169178 0.001160150 0.001151327
           33500       34000       34500       35000       35500       36000
1.7  0.001126260 0.001117948 0.001109817 0.001101862 0.001094075 0.001086450
1.71 0.001129568 0.001121231 0.001113077 0.001105098 0.001097288 0.001089641
1.72 0.001132866 0.001124505 0.001116327 0.001108324 0.001100491 0.001092822
1.73 0.001136154 0.001127769 0.001119567 0.001111541 0.001103686 0.001095995
1.74 0.001139433 0.001131024 0.001122798 0.001114749 0.001106871 0.001099158
1.75 0.001142703 0.001134269 0.001126020 0.001117948 0.001110047 0.001102312
           36500       37000       37500       38000       38500       39000
1.7  0.001078983 0.001071668 0.001064500 0.001057473 0.001050584 0.001043828
1.71 0.001082152 0.001074815 0.001067626 0.001060579 0.001053669 0.001046893
1.72 0.001085312 0.001077953 0.001070743 0.001063675 0.001056746 0.001049950
1.73 0.001088462 0.001081082 0.001073851 0.001066763 0.001059813 0.001052998
1.74 0.001091603 0.001084202 0.001076950 0.001069842 0.001062872 0.001056037
1.75 0.001094736 0.001087314 0.001080040 0.001072911 0.001065922 0.001059067
           39500       40000       40500       41000       41500       42000
1.7  0.001037200 0.001030697 0.001024315 0.001018050 0.001011899 0.001005857
1.71 0.001040246 0.001033724 0.001027323 0.001021040 0.001014871 0.001008812
1.72 0.001043283 0.001036742 0.001030323 0.001024021 0.001017834 0.001011757
1.73 0.001046312 0.001039752 0.001033314 0.001026994 0.001020788 0.001014694
1.74 0.001049332 0.001042753 0.001036296 0.001029958 0.001023734 0.001017622
1.75 0.001052343 0.001045745 0.001039269 0.001032913 0.001026672 0.001020542
            42500        43000        43500        44000        44500
1.7  0.0009999232 0.0009940927 0.0009883630 0.0009827312 0.0009771947
1.71 0.0010028598 0.0009970122 0.0009912657 0.0009856174 0.0009800646
1.72 0.0010057879 0.0009999232 0.0009941599 0.0009884951 0.0009829261
1.73 0.0010087074 0.0010028257 0.0009970457 0.0009913645 0.0009857793
1.74 0.0010116186 0.0010057199 0.0009999232 0.0009942256 0.0009886242
1.75 0.0010145214 0.0010086057 0.0010027924 0.0009970784 0.0009914610
            45000        45500        46000        46500        47000
1.7  0.0009717507 0.0009663966 0.0009611301 0.0009559488 0.0009508503
1.71 0.0009746046 0.0009692348 0.0009639528 0.0009587563 0.0009536429
1.72 0.0009774501 0.0009720647 0.0009667673 0.0009615556 0.0009564272
1.73 0.0009802874 0.0009748864 0.0009695736 0.0009643467 0.0009592035
1.74 0.0009831165 0.0009776999 0.0009723718 0.0009671298 0.0009619718
1.75 0.0009859375 0.0009805053 0.0009751619 0.0009699050 0.0009647321
            47500        48000        48500        49000        49500
1.7  0.0009458326 0.0009408935 0.0009360310 0.0009312431 0.0009265279
1.71 0.0009486104 0.0009436568 0.0009387800 0.0009339780 0.0009292490
1.72 0.0009513801 0.0009464120 0.0009415210 0.0009367050 0.0009319621
1.73 0.0009541417 0.0009491592 0.0009442540 0.0009394240 0.0009346674
1.74 0.0009568954 0.0009518985 0.0009469791 0.0009421352 0.0009373648
1.75 0.0009596411 0.0009546299 0.0009496964 0.0009448386 0.0009400546
            50000
1.7  0.0009218836
1.71 0.0009245911
1.72 0.0009272906
1.73 0.0009299823
1.74 0.0009326662
1.75 0.0009353425

In [66]:
%%R
heatmap(m, Rowv=NA, Colv=NA)



In [79]:
%%R -w 500 -h 350

BD50 = 0.098 * 0.5 + 1.66

df = as.data.frame(list('fragment_length'=as.numeric(colnames(m)), 'BD_sd'=m[BD50,]))

ggplot(df, aes(fragment_length, BD_sd)) +
    geom_line() +
    geom_vline(xintercept=4000, linetype='dashed', alpha=0.6) +
    labs(x='fragment length (bp)', y='G+C s.d.') +
    theme(
        text = element_text(size=16)
        )



In [ ]: