plotting
plot_single_trispectrum(sfs, folded=False, cmap=_new_cmap, vmin=None, vmax=None, colorbar=False, fraction=0.046)
Plots a single triallelic spectrum (sfs)
Note
~~~~8/13: to check - does it need to be given an unfolded spectrum? what if we want to plot a folded spectrum...
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sfs
|
Spectrum
|
the triallelic spectrum to plot |
required |
folded
|
bool
|
True if we want to fold the spectrum before plotting, False if to remain unfolded |
False
|
cmap
|
Define the colormap to use. Default is same colormap as used in figures from Ragsdale et al (2016) |
_new_cmap
|
|
vmin
|
float
|
lower limit of colormap and smallest value to be plotted |
None
|
vmax
|
float
|
upper limit of colormap |
None
|
colorbar
|
bool
|
True to show colorbar for Count |
False
|
fraction
|
float
|
fraction of the axis to use for colorbar |
0.046
|
Source code in dadi/Triallele/plotting.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | |
plot_trispectrum_comp(sfs1, sfs2, folded=False, cmap=_new_cmap, vmin=None, vmax=None, resid_range=None, colorbar=False, title1='sfs1', title2='sfs2', title3='Residual', fraction=0.046)
Plots the two spectra and the residual ( (sfs1-sfs2)/sqrt(sfs1) )
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sfs1
|
Spectrum
|
the first triallelic spectrum to plot |
required |
sfs2
|
Spectrum
|
the second triallelic spectrum to plot |
required |
folded
|
bool
|
True if we want to fold the spectrum before plotting, False if to remain unfolded |
False
|
cmap
|
Define the colormap to use. Default is same colormap as used in figures from Ragsdale et al (2016) |
_new_cmap
|
|
vmin
|
float
|
lower limit of colormap and smallest value to be plotted for frequency spectra |
None
|
vmax
|
float
|
upper limit of colormap for frequency spectra |
None
|
resid_range
|
float
|
residual colormap ranges from -resid_range to +resid_range |
None
|
colorbar
|
bool
|
True to show colorbars for Count and Residual |
False
|
title1
|
str
|
title for first spectrum |
'sfs1'
|
title2
|
str
|
title for second spectrum |
'sfs2'
|
title3
|
str
|
title for residuals |
'Residual'
|
fraction
|
float
|
fraction of the axis to use for colorbars |
0.046
|
Source code in dadi/Triallele/plotting.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | |