Commit d3fa0614 authored by Kosmas Hench's avatar Kosmas Hench

add simulations

parent f9726e5c
......@@ -7,3 +7,4 @@
2_output/07_phased_variants/*
!2_output/08_popGen/00_synteny
2_output/09_expression/*
2_output/10_simulation/*
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created by grConvert v0.1-0 -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="248pt" height="337pt" viewBox="0 0 248 337" version="1.1">
<defs>
<g>
<symbol overflow="visible" id="glyph0-0">
<path style="stroke:none;" d="M 2.484375 8.84375 L 2.484375 -35.25 L 27.484375 -35.25 L 27.484375 8.84375 Z M 5.296875 6.0625 L 24.703125 6.0625 L 24.703125 -32.453125 L 5.296875 -32.453125 Z M 5.296875 6.0625 "/>
</symbol>
<symbol overflow="visible" id="glyph0-1">
<path style="stroke:none;" d="M 17.09375 -31.59375 L 10.40625 -13.453125 L 23.796875 -13.453125 Z M 14.3125 -36.453125 L 19.890625 -36.453125 L 33.796875 0 L 28.65625 0 L 25.34375 -9.34375 L 8.90625 -9.34375 L 5.59375 0 L 0.390625 0 Z M 14.3125 -36.453125 "/>
</symbol>
<symbol overflow="visible" id="glyph0-2">
<path style="stroke:none;" d="M 9.84375 -17.40625 L 9.84375 -4.046875 L 17.75 -4.046875 C 20.40625 -4.046875 22.367188 -4.59375 23.640625 -5.6875 C 24.921875 -6.789062 25.5625 -8.476562 25.5625 -10.75 C 25.5625 -13.019531 24.921875 -14.695312 23.640625 -15.78125 C 22.367188 -16.863281 20.40625 -17.40625 17.75 -17.40625 Z M 9.84375 -32.390625 L 9.84375 -21.40625 L 17.140625 -21.40625 C 19.546875 -21.40625 21.335938 -21.859375 22.515625 -22.765625 C 23.703125 -23.671875 24.296875 -25.050781 24.296875 -26.90625 C 24.296875 -28.738281 23.703125 -30.109375 22.515625 -31.015625 C 21.335938 -31.929688 19.546875 -32.390625 17.140625 -32.390625 Z M 4.90625 -36.453125 L 17.5 -36.453125 C 21.257812 -36.453125 24.15625 -35.671875 26.1875 -34.109375 C 28.226562 -32.546875 29.25 -30.320312 29.25 -27.4375 C 29.25 -25.207031 28.726562 -23.429688 27.6875 -22.109375 C 26.644531 -20.796875 25.113281 -19.976562 23.09375 -19.65625 C 25.519531 -19.132812 27.40625 -18.046875 28.75 -16.390625 C 30.09375 -14.742188 30.765625 -12.679688 30.765625 -10.203125 C 30.765625 -6.953125 29.65625 -4.4375 27.4375 -2.65625 C 25.226562 -0.882812 22.082031 0 18 0 L 4.90625 0 Z M 4.90625 -36.453125 "/>
</symbol>
<symbol overflow="visible" id="glyph1-0">
<path style="stroke:none;" d="M 1 3.53125 L 1 -14.109375 L 11 -14.109375 L 11 3.53125 Z M 2.125 2.421875 L 9.890625 2.421875 L 9.890625 -12.984375 L 2.125 -12.984375 Z M 2.125 2.421875 "/>
</symbol>
<symbol overflow="visible" id="glyph1-1">
<path style="stroke:none;" d="M 3.375 -14.578125 L 6.03125 -14.578125 L 10.0625 -2.078125 L 12.5 -14.578125 L 14.421875 -14.578125 L 11.578125 0 L 8.921875 0 L 4.90625 -12.578125 L 2.46875 0 L 0.53125 0 Z M 3.375 -14.578125 "/>
</symbol>
<symbol overflow="visible" id="glyph1-2">
<path style="stroke:none;" d="M 17.953125 -6.609375 L 16.6875 0 L 14.890625 0 L 16.140625 -6.546875 C 16.191406 -6.828125 16.226562 -7.066406 16.25 -7.265625 C 16.28125 -7.460938 16.296875 -7.632812 16.296875 -7.78125 C 16.296875 -8.363281 16.132812 -8.816406 15.8125 -9.140625 C 15.488281 -9.472656 15.03125 -9.640625 14.4375 -9.640625 C 13.570312 -9.640625 12.796875 -9.3125 12.109375 -8.65625 C 11.421875 -8 10.976562 -7.148438 10.78125 -6.109375 L 9.578125 0 L 7.78125 0 L 9.0625 -6.546875 C 9.113281 -6.785156 9.148438 -7.003906 9.171875 -7.203125 C 9.203125 -7.410156 9.21875 -7.597656 9.21875 -7.765625 C 9.21875 -8.359375 9.054688 -8.816406 8.734375 -9.140625 C 8.410156 -9.472656 7.960938 -9.640625 7.390625 -9.640625 C 6.503906 -9.640625 5.71875 -9.3125 5.03125 -8.65625 C 4.34375 -8 3.898438 -7.148438 3.703125 -6.109375 L 2.5 0 L 0.703125 0 L 2.84375 -10.9375 L 4.640625 -10.9375 L 4.296875 -9.234375 C 4.785156 -9.878906 5.359375 -10.367188 6.015625 -10.703125 C 6.671875 -11.035156 7.367188 -11.203125 8.109375 -11.203125 C 8.910156 -11.203125 9.566406 -10.992188 10.078125 -10.578125 C 10.585938 -10.160156 10.894531 -9.582031 11 -8.84375 C 11.539062 -9.601562 12.171875 -10.1875 12.890625 -10.59375 C 13.609375 -11 14.367188 -11.203125 15.171875 -11.203125 C 16.109375 -11.203125 16.832031 -10.929688 17.34375 -10.390625 C 17.851562 -9.847656 18.109375 -9.082031 18.109375 -8.09375 C 18.109375 -7.882812 18.09375 -7.648438 18.0625 -7.390625 C 18.039062 -7.128906 18.003906 -6.867188 17.953125 -6.609375 Z M 17.953125 -6.609375 "/>
</symbol>
<symbol overflow="visible" id="glyph1-3">
<path style="stroke:none;" d="M 8.453125 -10.9375 L 8.1875 -9.546875 L 4.59375 -9.546875 L 3.4375 -3.609375 C 3.394531 -3.378906 3.363281 -3.191406 3.34375 -3.046875 C 3.332031 -2.898438 3.328125 -2.785156 3.328125 -2.703125 C 3.328125 -2.285156 3.453125 -1.976562 3.703125 -1.78125 C 3.953125 -1.59375 4.351562 -1.5 4.90625 -1.5 L 6.71875 -1.5 L 6.421875 0 L 4.703125 0 C 3.628906 0 2.832031 -0.207031 2.3125 -0.625 C 1.789062 -1.039062 1.53125 -1.671875 1.53125 -2.515625 C 1.53125 -2.671875 1.535156 -2.835938 1.546875 -3.015625 C 1.566406 -3.191406 1.597656 -3.390625 1.640625 -3.609375 L 2.796875 -9.546875 L 1.28125 -9.546875 L 1.5625 -10.9375 L 3.0625 -10.9375 L 3.65625 -14.046875 L 5.453125 -14.046875 L 4.859375 -10.9375 Z M 8.453125 -10.9375 "/>
</symbol>
<symbol overflow="visible" id="glyph2-0">
<path style="stroke:none;" d="M 1 3.53125 L 1 -14.109375 L 11 -14.109375 L 11 3.53125 Z M 2.125 2.421875 L 9.890625 2.421875 L 9.890625 -12.984375 L 2.125 -12.984375 Z M 2.125 2.421875 "/>
</symbol>
<symbol overflow="visible" id="glyph2-1">
<path style="stroke:none;" d="M 9.625 -6.453125 C 9.644531 -6.554688 9.65625 -6.660156 9.65625 -6.765625 C 9.664062 -6.878906 9.671875 -6.988281 9.671875 -7.09375 C 9.671875 -7.894531 9.4375 -8.523438 8.96875 -8.984375 C 8.507812 -9.441406 7.878906 -9.671875 7.078125 -9.671875 C 6.191406 -9.671875 5.40625 -9.390625 4.71875 -8.828125 C 4.03125 -8.265625 3.515625 -7.46875 3.171875 -6.4375 Z M 11.1875 -5.046875 L 2.828125 -5.046875 C 2.785156 -4.796875 2.753906 -4.597656 2.734375 -4.453125 C 2.722656 -4.304688 2.71875 -4.179688 2.71875 -4.078125 C 2.71875 -3.171875 2.992188 -2.46875 3.546875 -1.96875 C 4.109375 -1.476562 4.898438 -1.234375 5.921875 -1.234375 C 6.703125 -1.234375 7.441406 -1.320312 8.140625 -1.5 C 8.835938 -1.675781 9.484375 -1.9375 10.078125 -2.28125 L 9.734375 -0.5 C 9.085938 -0.238281 8.421875 -0.046875 7.734375 0.078125 C 7.046875 0.210938 6.347656 0.28125 5.640625 0.28125 C 4.128906 0.28125 2.960938 -0.078125 2.140625 -0.796875 C 1.328125 -1.523438 0.921875 -2.554688 0.921875 -3.890625 C 0.921875 -5.035156 1.125 -6.097656 1.53125 -7.078125 C 1.9375 -8.054688 2.535156 -8.929688 3.328125 -9.703125 C 3.828125 -10.179688 4.425781 -10.550781 5.125 -10.8125 C 5.832031 -11.070312 6.578125 -11.203125 7.359375 -11.203125 C 8.597656 -11.203125 9.582031 -10.828125 10.3125 -10.078125 C 11.050781 -9.335938 11.421875 -8.34375 11.421875 -7.09375 C 11.421875 -6.800781 11.398438 -6.484375 11.359375 -6.140625 C 11.316406 -5.796875 11.257812 -5.429688 11.1875 -5.046875 Z M 11.1875 -5.046875 "/>
</symbol>
<symbol overflow="visible" id="glyph2-2">
<path style="stroke:none;" d="M 10 -10.609375 L 9.65625 -8.921875 C 9.1875 -9.179688 8.6875 -9.375 8.15625 -9.5 C 7.625 -9.632812 7.082031 -9.703125 6.53125 -9.703125 C 5.582031 -9.703125 4.835938 -9.539062 4.296875 -9.21875 C 3.753906 -8.894531 3.484375 -8.457031 3.484375 -7.90625 C 3.484375 -7.257812 4.113281 -6.765625 5.375 -6.421875 C 5.46875 -6.390625 5.539062 -6.367188 5.59375 -6.359375 L 6.15625 -6.1875 C 7.351562 -5.851562 8.148438 -5.503906 8.546875 -5.140625 C 8.953125 -4.773438 9.15625 -4.273438 9.15625 -3.640625 C 9.15625 -2.484375 8.691406 -1.539062 7.765625 -0.8125 C 6.847656 -0.0820312 5.644531 0.28125 4.15625 0.28125 C 3.582031 0.28125 2.972656 0.222656 2.328125 0.109375 C 1.691406 0.00390625 0.988281 -0.164062 0.21875 -0.40625 L 0.578125 -2.25 C 1.234375 -1.914062 1.878906 -1.660156 2.515625 -1.484375 C 3.160156 -1.304688 3.773438 -1.21875 4.359375 -1.21875 C 5.234375 -1.21875 5.945312 -1.40625 6.5 -1.78125 C 7.050781 -2.164062 7.328125 -2.644531 7.328125 -3.21875 C 7.328125 -3.84375 6.601562 -4.347656 5.15625 -4.734375 L 4.96875 -4.78125 L 4.359375 -4.9375 C 3.441406 -5.175781 2.769531 -5.492188 2.34375 -5.890625 C 1.925781 -6.285156 1.71875 -6.789062 1.71875 -7.40625 C 1.71875 -8.570312 2.15625 -9.492188 3.03125 -10.171875 C 3.90625 -10.859375 5.097656 -11.203125 6.609375 -11.203125 C 7.191406 -11.203125 7.765625 -11.148438 8.328125 -11.046875 C 8.898438 -10.953125 9.457031 -10.804688 10 -10.609375 Z M 10 -10.609375 "/>
</symbol>
<symbol overflow="visible" id="glyph2-3">
<path style="stroke:none;" d="M 1.796875 -2.484375 L 3.859375 -2.484375 L 3.53125 -0.796875 L 1.3125 2.328125 L 0.0625 2.328125 L 1.46875 -0.796875 Z M 1.796875 -2.484375 "/>
</symbol>
<symbol overflow="visible" id="glyph3-0">
<path style="stroke:none;" d="M 1 3.53125 L 1 -14.109375 L 11 -14.109375 L 11 3.53125 Z M 2.125 2.421875 L 9.890625 2.421875 L 9.890625 -12.984375 L 2.125 -12.984375 Z M 2.125 2.421875 "/>
</symbol>
<symbol overflow="visible" id="glyph3-1">
<path style="stroke:none;" d="M 6.84375 -12.640625 L 4.15625 -5.375 L 9.515625 -5.375 Z M 5.71875 -14.578125 L 7.953125 -14.578125 L 13.515625 0 L 11.46875 0 L 10.140625 -3.734375 L 3.5625 -3.734375 L 2.234375 0 L 0.15625 0 Z M 5.71875 -14.578125 "/>
</symbol>
<symbol overflow="visible" id="glyph3-2">
<path style="stroke:none;" d="M 2.34375 -2.484375 L 4.40625 -2.484375 L 4.40625 0 L 2.34375 0 Z M 2.34375 -10.34375 L 4.40625 -10.34375 L 4.40625 -7.859375 L 2.34375 -7.859375 Z M 2.34375 -10.34375 "/>
</symbol>
<symbol overflow="visible" id="glyph3-3">
<path style="stroke:none;" d=""/>
</symbol>
<symbol overflow="visible" id="glyph3-4">
<path style="stroke:none;" d="M 6.359375 -13.28125 C 5.335938 -13.28125 4.570312 -12.78125 4.0625 -11.78125 C 3.550781 -10.78125 3.296875 -9.28125 3.296875 -7.28125 C 3.296875 -5.28125 3.550781 -3.78125 4.0625 -2.78125 C 4.570312 -1.78125 5.335938 -1.28125 6.359375 -1.28125 C 7.378906 -1.28125 8.144531 -1.78125 8.65625 -2.78125 C 9.164062 -3.78125 9.421875 -5.28125 9.421875 -7.28125 C 9.421875 -9.28125 9.164062 -10.78125 8.65625 -11.78125 C 8.144531 -12.78125 7.378906 -13.28125 6.359375 -13.28125 Z M 6.359375 -14.84375 C 7.992188 -14.84375 9.238281 -14.195312 10.09375 -12.90625 C 10.957031 -11.613281 11.390625 -9.738281 11.390625 -7.28125 C 11.390625 -4.820312 10.957031 -2.945312 10.09375 -1.65625 C 9.238281 -0.363281 7.992188 0.28125 6.359375 0.28125 C 4.722656 0.28125 3.472656 -0.363281 2.609375 -1.65625 C 1.742188 -2.945312 1.3125 -4.820312 1.3125 -7.28125 C 1.3125 -9.738281 1.742188 -11.613281 2.609375 -12.90625 C 3.472656 -14.195312 4.722656 -14.84375 6.359375 -14.84375 Z M 6.359375 -14.84375 "/>
</symbol>
<symbol overflow="visible" id="glyph3-5">
<path style="stroke:none;" d="M 2.34375 -2.484375 L 4.40625 -2.484375 L 4.40625 -0.796875 L 2.796875 2.328125 L 1.546875 2.328125 L 2.34375 -0.796875 Z M 2.34375 -2.484375 "/>
</symbol>
<symbol overflow="visible" id="glyph3-6">
<path style="stroke:none;" d="M 6.859375 -5.5 C 5.398438 -5.5 4.390625 -5.332031 3.828125 -5 C 3.273438 -4.664062 3 -4.097656 3 -3.296875 C 3 -2.660156 3.207031 -2.15625 3.625 -1.78125 C 4.050781 -1.40625 4.625 -1.21875 5.34375 -1.21875 C 6.34375 -1.21875 7.140625 -1.570312 7.734375 -2.28125 C 8.335938 -2.988281 8.640625 -3.925781 8.640625 -5.09375 L 8.640625 -5.5 Z M 10.4375 -6.234375 L 10.4375 0 L 8.640625 0 L 8.640625 -1.65625 C 8.234375 -1 7.722656 -0.507812 7.109375 -0.1875 C 6.492188 0.125 5.742188 0.28125 4.859375 0.28125 C 3.742188 0.28125 2.851562 -0.03125 2.1875 -0.65625 C 1.53125 -1.289062 1.203125 -2.132812 1.203125 -3.1875 C 1.203125 -4.414062 1.613281 -5.34375 2.4375 -5.96875 C 3.257812 -6.59375 4.488281 -6.90625 6.125 -6.90625 L 8.640625 -6.90625 L 8.640625 -7.078125 C 8.640625 -7.910156 8.367188 -8.550781 7.828125 -9 C 7.285156 -9.445312 6.519531 -9.671875 5.53125 -9.671875 C 4.90625 -9.671875 4.296875 -9.597656 3.703125 -9.453125 C 3.117188 -9.304688 2.550781 -9.082031 2 -8.78125 L 2 -10.4375 C 2.65625 -10.695312 3.289062 -10.890625 3.90625 -11.015625 C 4.53125 -11.140625 5.132812 -11.203125 5.71875 -11.203125 C 7.300781 -11.203125 8.484375 -10.789062 9.265625 -9.96875 C 10.046875 -9.144531 10.4375 -7.898438 10.4375 -6.234375 Z M 10.4375 -6.234375 "/>
</symbol>
<symbol overflow="visible" id="glyph4-0">
<path style="stroke:none;" d="M 1 3.53125 L 1 -14.109375 L 11 -14.109375 L 11 3.53125 Z M 2.125 2.421875 L 9.890625 2.421875 L 9.890625 -12.984375 L 2.125 -12.984375 Z M 2.125 2.421875 "/>
</symbol>
<symbol overflow="visible" id="glyph4-1">
<path style="stroke:none;" d="M 5.078125 -14.578125 L 6.734375 -14.578125 L 1.65625 1.859375 L 0 1.859375 Z M 5.078125 -14.578125 "/>
</symbol>
<symbol overflow="visible" id="glyph4-2">
<path style="stroke:none;" d="M 3.84375 -1.65625 L 10.71875 -1.65625 L 10.71875 0 L 1.46875 0 L 1.46875 -1.65625 C 2.21875 -2.4375 3.238281 -3.476562 4.53125 -4.78125 C 5.820312 -6.082031 6.632812 -6.925781 6.96875 -7.3125 C 7.59375 -8.019531 8.03125 -8.617188 8.28125 -9.109375 C 8.53125 -9.597656 8.65625 -10.082031 8.65625 -10.5625 C 8.65625 -11.332031 8.382812 -11.960938 7.84375 -12.453125 C 7.300781 -12.941406 6.59375 -13.1875 5.71875 -13.1875 C 5.101562 -13.1875 4.453125 -13.078125 3.765625 -12.859375 C 3.078125 -12.648438 2.34375 -12.328125 1.5625 -11.890625 L 1.5625 -13.875 C 2.351562 -14.195312 3.09375 -14.4375 3.78125 -14.59375 C 4.476562 -14.757812 5.113281 -14.84375 5.6875 -14.84375 C 7.195312 -14.84375 8.398438 -14.460938 9.296875 -13.703125 C 10.191406 -12.953125 10.640625 -11.945312 10.640625 -10.6875 C 10.640625 -10.082031 10.523438 -9.507812 10.296875 -8.96875 C 10.078125 -8.4375 9.671875 -7.804688 9.078125 -7.078125 C 8.921875 -6.890625 8.40625 -6.34375 7.53125 -5.4375 C 6.65625 -4.539062 5.425781 -3.28125 3.84375 -1.65625 Z M 3.84375 -1.65625 "/>
</symbol>
<symbol overflow="visible" id="glyph4-3">
<path style="stroke:none;" d="M 2.34375 -2.484375 L 4.40625 -2.484375 L 4.40625 -0.796875 L 2.796875 2.328125 L 1.546875 2.328125 L 2.34375 -0.796875 Z M 2.34375 -2.484375 "/>
</symbol>
<symbol overflow="visible" id="glyph4-4">
<path style="stroke:none;" d=""/>
</symbol>
<symbol overflow="visible" id="glyph4-5">
<path style="stroke:none;" d="M 6.859375 -5.5 C 5.398438 -5.5 4.390625 -5.332031 3.828125 -5 C 3.273438 -4.664062 3 -4.097656 3 -3.296875 C 3 -2.660156 3.207031 -2.15625 3.625 -1.78125 C 4.050781 -1.40625 4.625 -1.21875 5.34375 -1.21875 C 6.34375 -1.21875 7.140625 -1.570312 7.734375 -2.28125 C 8.335938 -2.988281 8.640625 -3.925781 8.640625 -5.09375 L 8.640625 -5.5 Z M 10.4375 -6.234375 L 10.4375 0 L 8.640625 0 L 8.640625 -1.65625 C 8.234375 -1 7.722656 -0.507812 7.109375 -0.1875 C 6.492188 0.125 5.742188 0.28125 4.859375 0.28125 C 3.742188 0.28125 2.851562 -0.03125 2.1875 -0.65625 C 1.53125 -1.289062 1.203125 -2.132812 1.203125 -3.1875 C 1.203125 -4.414062 1.613281 -5.34375 2.4375 -5.96875 C 3.257812 -6.59375 4.488281 -6.90625 6.125 -6.90625 L 8.640625 -6.90625 L 8.640625 -7.078125 C 8.640625 -7.910156 8.367188 -8.550781 7.828125 -9 C 7.285156 -9.445312 6.519531 -9.671875 5.53125 -9.671875 C 4.90625 -9.671875 4.296875 -9.597656 3.703125 -9.453125 C 3.117188 -9.304688 2.550781 -9.082031 2 -8.78125 L 2 -10.4375 C 2.65625 -10.695312 3.289062 -10.890625 3.90625 -11.015625 C 4.53125 -11.140625 5.132812 -11.203125 5.71875 -11.203125 C 7.300781 -11.203125 8.484375 -10.789062 9.265625 -9.96875 C 10.046875 -9.144531 10.4375 -7.898438 10.4375 -6.234375 Z M 10.4375 -6.234375 "/>
</symbol>
<symbol overflow="visible" id="glyph4-6">
<path style="stroke:none;" d="M 2.34375 -2.484375 L 4.40625 -2.484375 L 4.40625 0 L 2.34375 0 Z M 2.34375 -10.34375 L 4.40625 -10.34375 L 4.40625 -7.859375 L 2.34375 -7.859375 Z M 2.34375 -10.34375 "/>
</symbol>
<symbol overflow="visible" id="glyph4-7">
<path style="stroke:none;" d="M 6.84375 -12.640625 L 4.15625 -5.375 L 9.515625 -5.375 Z M 5.71875 -14.578125 L 7.953125 -14.578125 L 13.515625 0 L 11.46875 0 L 10.140625 -3.734375 L 3.5625 -3.734375 L 2.234375 0 L 0.15625 0 Z M 5.71875 -14.578125 "/>
</symbol>
<symbol overflow="visible" id="glyph4-8">
<path style="stroke:none;" d="M 6.359375 -13.28125 C 5.335938 -13.28125 4.570312 -12.78125 4.0625 -11.78125 C 3.550781 -10.78125 3.296875 -9.28125 3.296875 -7.28125 C 3.296875 -5.28125 3.550781 -3.78125 4.0625 -2.78125 C 4.570312 -1.78125 5.335938 -1.28125 6.359375 -1.28125 C 7.378906 -1.28125 8.144531 -1.78125 8.65625 -2.78125 C 9.164062 -3.78125 9.421875 -5.28125 9.421875 -7.28125 C 9.421875 -9.28125 9.164062 -10.78125 8.65625 -11.78125 C 8.144531 -12.78125 7.378906 -13.28125 6.359375 -13.28125 Z M 6.359375 -14.84375 C 7.992188 -14.84375 9.238281 -14.195312 10.09375 -12.90625 C 10.957031 -11.613281 11.390625 -9.738281 11.390625 -7.28125 C 11.390625 -4.820312 10.957031 -2.945312 10.09375 -1.65625 C 9.238281 -0.363281 7.992188 0.28125 6.359375 0.28125 C 4.722656 0.28125 3.472656 -0.363281 2.609375 -1.65625 C 1.742188 -2.945312 1.3125 -4.820312 1.3125 -7.28125 C 1.3125 -9.738281 1.742188 -11.613281 2.609375 -12.90625 C 3.472656 -14.195312 4.722656 -14.84375 6.359375 -14.84375 Z M 6.359375 -14.84375 "/>
</symbol>
</g>
</defs>
<g id="surface189">
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(43.529412%,51.372549%,70.196078%);fill-opacity:1;" d="M 83.191406 108.53125 C 35.761719 122.789062 0.308594 178.386719 0.0507812 244.984375 L 0 336.984375 L 47.925781 336.984375 L 47.925781 244.984375 C 48.222656 202.28125 74.65625 167.859375 107.171875 167.84375 Z M 83.191406 108.53125 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(99.215686%,92.54902%,31.372549%);fill-opacity:1;" d="M 107.171875 167.84375 C 139.691406 167.855469 166.132812 202.277344 166.429688 244.984375 L 166.429688 336.984375 L 214.285156 336.984375 L 214.285156 244.984375 C 214.03125 178.367188 178.554688 122.757812 131.105469 108.519531 Z M 107.171875 167.84375 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(90.196078%,90.196078%,90.196078%);fill-opacity:1;" d="M 107.171875 167.84375 L 131.105469 108.519531 L 131.105469 51.328125 L 83.21875 51.328125 L 83.191406 108.53125 Z M 107.171875 167.84375 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(60%,60%,60%);fill-opacity:1;" d="M 43.570312 197.183594 L 43.570312 203.183594 L 170.714844 203.183594 L 170.714844 197.183594 L 184.714844 213.542969 L 170.714844 229.898438 L 170.714844 223.898438 L 43.570312 223.898438 L 43.570312 229.898438 L 29.570312 213.542969 Z M 43.570312 197.183594 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(60%,60%,60%);fill-opacity:1;" d="M 43.570312 270.515625 L 43.570312 276.515625 L 170.714844 276.515625 L 170.714844 270.515625 L 184.714844 286.875 L 170.714844 303.230469 L 170.714844 297.230469 L 43.570312 297.230469 L 43.570312 303.230469 L 29.570312 286.875 Z M 43.570312 270.515625 "/>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph0-1" x="6.265625" y="333.829101"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph0-2" x="173.949219" y="333.829101"/>
</g>
<path style="fill:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 83.000001 750.420778 L 83.179688 757.920778 M 130.85547 750.420778 L 131.035157 757.920778 M 83.089844 754.080934 L 130.945313 754.260622 " transform="matrix(1,0,0,1,0,-685.463742)"/>
<path style="fill:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 223.925783 1021.948123 L 231.425783 1021.772342 M 223.925783 824.073122 L 231.425783 823.893434 M 227.585939 1021.858279 L 227.765626 823.983278 " transform="matrix(1,0,0,1,0,-685.463742)"/>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph1-1" x="93.5625" y="88.470703"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph2-1" x="108.523438" y="92.470703"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph1-2" x="97.734375" y="255.806641"/>
</g>
<path style="fill:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 107.144532 945.494998 L 107.144532 967.994998 " transform="matrix(1,0,0,1,0,-685.463742)"/>
<path style="fill:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 107.144532 903.350466 L 107.144532 925.850466 " transform="matrix(1,0,0,1,0,-685.463742)"/>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph1-3" x="239.734375" y="244.478516"/>
</g>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(99.215686%,92.54902%,31.372549%);fill-opacity:1;" d="M 20.386719 20 L 233.898438 20 L 233.898438 39.191406 L 20.386719 39.191406 Z M 20.386719 20 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(43.529412%,51.372549%,70.196078%);fill-opacity:1;" d="M 20.386719 0 L 233.898438 0 L 233.898438 19.191406 L 20.386719 19.191406 Z M 20.386719 0 "/>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph3-1" x="26.128906" y="36.693359"/>
<use xlink:href="#glyph3-1" x="40.367187" y="36.693359"/>
<use xlink:href="#glyph3-2" x="53.697265" y="36.693359"/>
<use xlink:href="#glyph3-3" x="60.435547" y="36.693359"/>
<use xlink:href="#glyph3-4" x="66.792968" y="36.693359"/>
<use xlink:href="#glyph3-5" x="79.517578" y="36.693359"/>
<use xlink:href="#glyph3-3" x="85.875" y="36.693359"/>
<use xlink:href="#glyph3-3" x="92.232421" y="36.693359"/>
<use xlink:href="#glyph3-1" x="98.589843" y="36.693359"/>
<use xlink:href="#glyph3-6" x="112.271484" y="36.693359"/>
<use xlink:href="#glyph3-2" x="124.527343" y="36.693359"/>
<use xlink:href="#glyph3-3" x="131.265624" y="36.693359"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph2-2" x="137.621094" y="36.693359"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph4-1" x="148.042969" y="36.693359"/>
<use xlink:href="#glyph4-2" x="154.78125" y="36.693359"/>
<use xlink:href="#glyph4-3" x="167.505859" y="36.693359"/>
<use xlink:href="#glyph4-4" x="173.863281" y="36.693359"/>
<use xlink:href="#glyph4-5" x="180.220703" y="36.693359"/>
<use xlink:href="#glyph4-5" x="192.476562" y="36.693359"/>
<use xlink:href="#glyph4-6" x="204.732422" y="36.693359"/>
<use xlink:href="#glyph4-4" x="211.470703" y="36.693359"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph2-2" x="217.828125" y="36.693359"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph3-1" x="26.582031" y="16.669922"/>
<use xlink:href="#glyph3-1" x="40.820312" y="16.669922"/>
<use xlink:href="#glyph3-2" x="54.15039" y="16.669922"/>
<use xlink:href="#glyph3-3" x="60.888672" y="16.669922"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph2-2" x="67.246094" y="16.669922"/>
<use xlink:href="#glyph2-3" x="77.666016" y="16.669922"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph4-4" x="84.023438" y="16.669922"/>
<use xlink:href="#glyph4-4" x="90.380859" y="16.669922"/>
<use xlink:href="#glyph4-7" x="96.738281" y="16.669922"/>
<use xlink:href="#glyph4-5" x="110.419922" y="16.669922"/>
<use xlink:href="#glyph4-6" x="122.675781" y="16.669922"/>
<use xlink:href="#glyph4-4" x="129.414062" y="16.669922"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph2-2" x="135.769531" y="16.669922"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph4-1" x="146.191406" y="16.669922"/>
<use xlink:href="#glyph4-2" x="152.929687" y="16.669922"/>
<use xlink:href="#glyph4-3" x="165.654297" y="16.669922"/>
<use xlink:href="#glyph4-4" x="172.011719" y="16.669922"/>
<use xlink:href="#glyph4-5" x="178.36914" y="16.669922"/>
<use xlink:href="#glyph4-5" x="190.625" y="16.669922"/>
<use xlink:href="#glyph4-6" x="202.880859" y="16.669922"/>
<use xlink:href="#glyph4-4" x="209.61914" y="16.669922"/>
<use xlink:href="#glyph4-8" x="215.976562" y="16.669922"/>
</g>
</g>
</svg>
create_K_plot <- function(searchLG,gfffile,xr,searchgene,secondary_genes,searchsnp,muskID){
source('../../0_data/0_scripts/F3.functions.R');
source('../../0_data/0_scripts/F3.getFSTs.R')
source('../../0_data/0_scripts/F3.getGxP.R')
source('../../0_data/0_scripts/F3.getDXY.R')
highclr <- '#3bb33b'
......@@ -20,11 +19,6 @@ create_K_plot <- function(searchLG,gfffile,xr,searchgene,secondary_genes,searchs
global_fst<-fst_list$global_fst;
data_fst<-fst_list$data_fst
# get pfst values
pfst_list <- getGxP(searchLG,xr)
# data_pfst_pw<-pfst_list$data_pfst_pw;
data_pfst<-pfst_list$data_pfst
# get dxy values
dxy_list <- getDXY(searchLG,xr)
#data_dxy_pw<-dxy_list$data_dxy_pw;
......@@ -127,20 +121,6 @@ create_K_plot <- function(searchLG,gfffile,xr,searchgene,secondary_genes,searchs
guides(linetype= guide_legend(override.aes = list(color = 'black')))+plotSET
p13 <- ggplot()+coord_cartesian(xlim=xr)+
geom_line(data=(data_pfst %>% filter(POS > xr[1],POS<xr[2]))
,aes(x=POS,y=avgp_wald,col=run),lwd=LW)+
# geom_line(data=(data_pfst_pw %>% filter(POS > xr[1],POS<xr[2]))
# ,aes(x=POS,y=avgp_wald,col=run,linetype=group),lwd=1)+
scale_color_manual(values=c(clr,annoclr),
breaks=c("nig-pue","nig-uni","pue-uni","x","y","z"),guide=F)+
facet_grid(window~.,scales='free_y',
switch = 'y',labeller = label_parsed,as.table = T)+
scale_x_continuous(name=searchLG,expand=c(0,0),position = 'top')+
scale_y_continuous(breaks = seq(0,9,length.out = 4))+
scale_linetype(name='location',label=c('Belize','Honduras','Panama'))+
guides(linetype= guide_legend(override.aes = list(color = 'black')))+plotSET
p14 <- ggplot()+coord_cartesian(xlim=xr)+
geom_line(data=(data_dxy %>% filter(POS > xr[1],POS<xr[2]))
,aes(x=POS,y=dxy,col=run),lwd=LW)+
# geom_line(data=(data_dxy_pw %>% filter(POS > xr[1],POS<xr[2]))
......@@ -153,7 +133,7 @@ create_K_plot <- function(searchLG,gfffile,xr,searchgene,secondary_genes,searchs
scale_linetype(name='location',label=c('Belize','Honduras','Panama'))+
guides(linetype= guide_legend(override.aes = list(color = 'black')))+plotSET
p2 <- plot_grid(p11,p12,p13,p14,
p2 <- plot_grid(p11,p12,p13,
ncol = 1,align = 'v',axis = 'r',
rel_heights = c(1.3,rep(1,3)))
rel_heights = c(1.3,rep(1,2)))
return(p2)}
\ No newline at end of file
......@@ -93,7 +93,7 @@ trplot <- function(sel){
Nx2 = (y+scling[sclr])/10000)
zmLab <- data.frame(x=c(s1+.5*l1,s2+.5*l2,s3+.5*l3,s4+.5*l4),
label=c('LG09 (a)','LG12 (b)','LG12 (c)','LG17 (d)')) %>%
label=c('LG09 (A)','LG12 (B)','LG12 (C)','LG17 (D)')) %>%
mutate(sclr=1:4, Nx= (x+scling[sclr])/10000)
zmEND <- data.frame(x=c(s1,s1+l1,
......@@ -159,4 +159,23 @@ trplot <- function(sel){
}
return(p1)
}
run_one_sample_test <- function(pop,n,data){
df <- data %>%
filter(run == pop)
x <- df$R.2 %>% na.omit() %>% as.vector()
exp_mu <- 1/(2*n)
test_result <- wilcox.test(x,mu = exp_mu)
return(tibble(population = pop,
mean = x %>% mean,
sd = x %>% sd,
se = x %>% se,
var = x %>% var,
n = length(x),
exp_mu = exp_mu) %>% bind_cols(
test_result %>% broom::tidy()))
}
\ No newline at end of file
......@@ -28,13 +28,27 @@ dt2 <- BW %>%
BC <-rgb(.7,.7,.7)
clr <-colorRampPalette(colors = c('white',BC,'black'))(8)
# tests
locations <- c('Global',"Panana","Belize","Honduras","H. puella","H. nigricans","H. unicolor")
sample_sizes <- c(110,39,36,35,37,37,36)
test_gw <- purrr::map2(locations,sample_sizes,run_one_sample_test,data=BW) %>% bind_rows()
test_gw$xS <- factor(test_gw$population,
levels = c('Global',"Panana","Belize","Honduras",
"H. nigricans","H. puella","H. unicolor")) %>%
as.numeric()
pBOX <- ggplot(BW,aes(x=run,y=R.2))+
geom_boxplot(fill=BC,width=.7,outlier.size = .1)+
coord_fixed(ylim=c(0,.031),ratio = 250)+
geom_segment(inherit.aes = FALSE,
data=test_gw,aes(x=xS-.38,
xend=xS+.38,
y=exp_mu,yend=exp_mu),col='red',size=.5)+
geom_point(inherit.aes = F, data=dt2,aes(x=run,y=val,fill=type),shape=23,size=1)+
scale_x_discrete(labels = expression(Global,Panama,Belize,Honduas,
italic("H. nigricans"),italic("H. puella"),italic("H. unicolor")))+
scale_y_continuous(name=expression(genome~wide~ILD~(italic(r)^2)))+
scale_y_continuous(name=expression(Genome~wide~ILD~(italic(r)^2)))+
scale_fill_manual('',values = clr[c(6,1)],labels=c('mean','median'))+
guides(shape = guide_legend(ncol = 1))+
theme(legend.position = c(-.4,1.27),
......@@ -43,4 +57,6 @@ pBOX <- ggplot(BW,aes(x=run,y=R.2))+
axis.text.y = element_text(size=7),
axis.text.x = element_text(size=7,angle=45,hjust = 1),
panel.background = element_blank(),
plot.background = element_blank())
\ No newline at end of file
plot.background = element_blank())
......@@ -27,11 +27,25 @@ BoxGenes_summary <- dataBoxGenes %>%
select(xS,meanR2,medR2) %>%
gather(key = 'type',value = 'val',2:3)
# tests
locations <- c("global","boc","bel","hon","nig","pue","uni")
sample_sizes <- c(110,39,36,35,37,37,36)
test_area <- purrr::map2(locations,sample_sizes,run_one_sample_test,data=dataBoxGenes) %>%
bind_rows()
test_area$xS <- factor(test_area$population,
levels = c("global","boc","bel","hon","nig","pue","uni")) %>%
as.numeric()
boxGenes <- ggplot(dataBoxGenes,aes(x=xS))+
geom_boxplot(aes(y=R.2),fill=BC,width=.7,outlier.size = .1) +
geom_segment(inherit.aes = FALSE,
data=test_area,aes(x=xS-.38,
xend=xS+.38,
y=exp_mu,yend=exp_mu),col='red',size=.5)+
geom_point(data=BoxGenes_summary,aes(y=val,fill=type),shape=23,size=1)+
coord_fixed(ylim=c(0,.031),ratio = 250)+
scale_y_continuous(expression(candidate~gene~ILD~(italic(r)^2)))+
scale_y_continuous(expression(Candidate~gene~ILD~(italic(r)^2)))+
scale_x_discrete(labels = expression(Global,Panama,Belize,Honduas,
italic("H. nigricans"),italic("H. puella"),italic("H. unicolor")))+
scale_fill_manual('',values = clr[c(6,1)],labels=c('mean','median'))+
......@@ -43,4 +57,5 @@ boxGenes <- ggplot(dataBoxGenes,aes(x=xS))+
axis.text.y = element_text(size=7),
axis.text.x = element_text(size=7,angle=45,hjust = 1),
panel.background = element_blank(),
plot.background = element_blank())
\ No newline at end of file
plot.background = element_blank())
......@@ -139,7 +139,7 @@ trplot <- function(sel){
zmLab <- data.frame(x=c(s1+.5*lALL,s2+.5*lALL,s3+.5*lALL,s4+.5*lALL,
s5+.5*lALL,s6+.5*lALL,s7+.5*lALL,s8+.5*lALL),
label=c("LG4 (e)","LG08 (f)","LG08 (g)",'LG09 (a)','LG12 (b)','LG12 (c)','LG17 (d)',"LG20 (h)")) %>%
label=c("LG4 (E)","LG08 (F)","LG08 (G)",'LG09 (A)','LG12 (B)','LG12 (C)','LG17 (D)',"LG20 (H)")) %>%
mutate(sclr=1:8, Nx= (x+scling[sclr])/10000)
zmEND <- data.frame(x=c(s1,s1+lALL,
......
se <- function(x){
x2 <- x[!is.na(x)]
return(sd(x2)/sqrt(length(x2)))}
trplot <- function(sel){
files <- c("global","boc","bel","hon","pue","nig","uni","nig-pue","nig-uni","pue-uni")
data <- read.csv(paste('../../2_output/08_popGen/07_LD/',files[sel],'-10000-bins.txt',sep=''),sep='\t')
message(files[sel])
s1=17620000;s2=19910000;s3=21960000;s4=22320000;
e2=20660000;e3=22460000;
stp=20000;
l1=500000;l2=750000;l3=500000;l4=500000
scling <- c(-s1,-s2+(l1+stp),-s3+(l1+l2+2*stp),-s4+(l1+l2+l3+(stp*3)))
dt <- data %>% mutate(miX = floor(Mx/10000),miY=floor(My/10000))
print(max(dt$Mval,na.rm=TRUE))
genes <- data.frame(start=c(17871610,20186151,22225149,22553187,22556763,22561894,22573388),
end=c(17873915,20347811,22228342,22555052,22559742,22566321,22575503),
sclr=c(1,2,3,4,4,4,4),
LG=c("LG09","LG12-1","LG12-2","LG17","LG17","LG17","LG17"),
name=c("sox10",'casz1',"hoxc13a","sws2a\u03B1","sws2a\u03B2","sws2b","lws"))
genes <- genes %>% mutate(Nx1 = (start+scling[sclr])/10000,Nx2 = (end+scling[sclr])/10000,
labPOS = (Nx1+Nx2)/2)
genes$labPOS[genes$name %in% c("sws2a\u03B1","sws2a\u03B2","sws2b","lws")] <- genes$labPOS[genes$name %in% c("sws2a\u03B1","sws2a\u03B2","sws2b","lws")]+c(-16,-1,12,20)
GZrS <- 40000;GZrS2 <- 20000; #gene zoom offset
BS <- c(-5,5,-4,3,-8,8,-20,-10,-6,5,7,16,17,22)*10000 # Backshifter for gene zoom
GZdf <- data.frame(x=c(genes$start[1],genes$end[1],genes$end[1]+GZrS+BS[1],genes$start[1]+GZrS+BS[2],genes$start[1],
genes$start[2],genes$end[2],genes$end[2]+GZrS+BS[3],genes$start[2]+GZrS+BS[4],genes$start[2],
genes$start[3],genes$end[3],genes$end[3]+GZrS+BS[5],genes$start[3]+GZrS+BS[6],genes$start[3],
genes$start[4],genes$end[4],genes$end[4]+GZrS+BS[7],genes$start[4]+GZrS+BS[8],genes$start[4],
genes$start[5],genes$end[5],genes$end[5]+GZrS+BS[9],genes$start[5]+GZrS+BS[10],genes$start[5],
genes$start[6],genes$end[6],genes$end[6]+GZrS+BS[11],genes$start[6]+GZrS+BS[12],genes$start[6],
genes$start[7],genes$end[7],genes$end[7]+GZrS+BS[13],genes$start[7]+GZrS+BS[14],genes$start[7])+GZrS2,
y=c(genes$start[1],genes$end[1],genes$end[1]-GZrS+BS[1],genes$start[1]-GZrS+BS[2],genes$start[1],
genes$start[2],genes$end[2],genes$end[2]-GZrS+BS[3],genes$start[2]-GZrS+BS[4],genes$start[2],
genes$start[3],genes$end[3],genes$end[3]-GZrS+BS[5],genes$start[3]-GZrS+BS[6],genes$start[3],
genes$start[4],genes$end[4],genes$end[4]-GZrS+BS[7],genes$start[4]-GZrS+BS[8],genes$start[4],
genes$start[5],genes$end[5],genes$end[5]-GZrS+BS[9],genes$start[5]-GZrS+BS[10],genes$start[5],
genes$start[6],genes$end[6],genes$end[6]-GZrS+BS[11],genes$start[6]-GZrS+BS[12],genes$start[6],
genes$start[7],genes$end[7],genes$end[7]-GZrS+BS[13],genes$start[7]-GZrS+BS[14],genes$start[7])-GZrS2,
grp=rep(letters[1:7],each=5)) %>%
mutate(sclr=rep(c(1,2,3,4,4,4,4),each=5),
Nx1 = (x+scling[sclr])/10000,
Nx2 = (y+scling[sclr])/10000)
clr = c(viridis::inferno(5)[c(1,1:5)])
Gcol <- '#3bb33b'
Zcol = rgb(.94,.94,.94)
DG <- rgb(.4,.4,.4)
LGoffset <- 15
GLABoffset <- 8
rS <- 100000 # width of grey annotation band
zmRange <- data.frame(x=c(s1,s1+l1,s1+l1+rS,s1+rS,s1,
s2,s2+l2,s2+l2+rS,s2+rS,s2,
s3,s3+l3,s3+l3+rS,s3+rS,s3,
s4,s4+l4,s4+l4+rS,s4+rS,s4),
y=c(s1,s1+l1,s1+l1-rS,s1-rS,s1,
s2,s2+l2,s2+l2-rS,s2-rS,s2,
s3,s3+l3,s3+l3-rS,s3-rS,s3,
s4,s4+l4,s4+l4-rS,s4-rS,s4),
grp=rep(letters[1:4],each=5)) %>%
mutate(sclr=rep(1:4,each=5),
Nx1 = (x+scling[sclr])/10000-1,
Nx2 = (y+scling[sclr])/10000)
rS2 <- .75*rS
zmRange2 <- data.frame(x=c(s1,s1+l1,s1+l1+rS2,s1+rS2,s1,
s2,s2+l2,s2+l2+rS2,s2+rS2,s2,
s3,s3+l3,s3+l3+rS2,s3+rS2,s3,
s4,s4+l4,s4+l4+rS2,s4+rS2,s4),
y=c(s1,s1+l1,s1+l1-rS2,s1-rS2,s1,
s2,s2+l2,s2+l2-rS2,s2-rS2,s2,
s3,s3+l3,s3+l3-rS2,s3-rS2,s3,
s4,s4+l4,s4+l4-rS2,s4-rS2,s4),
grp=rep(letters[1:4],each=5)) %>%
mutate(sclr=rep(1:4,each=5),
Nx1 = (x+scling[sclr])/10000-1,
Nx2 = (y+scling[sclr])/10000)
rS3 <- .07*rS
zmRange3 <- data.frame(x=c(s1,s1+l1,s1+l1+rS3,s1+rS3,s1,
s2,s2+l2,s2+l2+rS3,s2+rS3,s2,
s3,s3+l3,s3+l3+rS3,s3+rS3,s3,
s4,s4+l4,s4+l4+rS3,s4+rS3,s4),
y=c(s1,s1+l1,s1+l1-rS3,s1-rS3,s1,
s2,s2+l2,s2+l2-rS3,s2-rS3,s2,
s3,s3+l3,s3+l3-rS3,s3-rS3,s3,
s4,s4+l4,s4+l4-rS3,s4-rS3,s4),
grp=rep(letters[1:4],each=5)) %>%
mutate(sclr=rep(1:4,each=5),
Nx1 = (x+scling[sclr])/10000-1,
Nx2 = (y+scling[sclr])/10000)
zmLab <- data.frame(x=c(s1+.5*l1,s2+.5*l2,s3+.5*l3,s4+.5*l4),
label=c('LG09 (A)','LG12 (B)','LG12 (C)','LG17 (D)')) %>%
mutate(sclr=1:4, Nx= (x+scling[sclr])/10000)
zmEND <- data.frame(x=c(s1,s1+l1,
s2,s2+l2,
s3,s3+l3,
s4,s4+l4)) %>%
mutate(sclr=rep(1:4,each=2),
Nx = ((x+scling[sclr])/10000)+rep(c(2.5,-4),4),
label=round((x/1000000),2))
textSCALE1 <- c(1.8,rep(NA,6),.7)
textSCALE2 <- c(2,rep(NA,6),1)
textSCALE3 <- c(3.5,rep(NA,6),1.75)
p1 <- ggplot(dt %>% filter(!is.na(Mval)),aes(fill=Mval))+
coord_equal()+
geom_polygon(inherit.aes = F,data=zmRange,
aes(x=Nx1+1,y=Nx2-1,group=grp),fill='lightgray')+
geom_polygon(inherit.aes = F,data=zmRange2,
aes(x=Nx1+11,y=Nx2-11,group=grp),fill=DG)+
geom_polygon(inherit.aes = F,data=zmRange3,
aes(x=Nx1+1.1,y=Nx2-1.1,group=grp),fill=DG)+
geom_polygon(inherit.aes = F,data=GZdf,
aes(x=Nx1,y=Nx2,group=grp),fill=Zcol)+
geom_segment(inherit.aes = F,data=genes,
aes(x=Nx1+1,y=Nx1-1,xend=Nx2+1,yend=Nx2-1),
col=Gcol,size=1.5)+
geom_tile(aes(x=miX,y=miY))+
geom_text(inherit.aes = F,data=zmEND,
aes(x=Nx+LGoffset,y=Nx-LGoffset,label=paste(label,'\n(Mb)')),
angle=45,size=textSCALE1[sel])+
geom_text(inherit.aes = F,data=genes,
aes(x=labPOS+GLABoffset,y=labPOS-GLABoffset,label=name),
angle=-45,fontface='italic',size=textSCALE2[sel])+
geom_text(inherit.aes = F,data=zmLab,
aes(x=Nx+LGoffset-.8,y=Nx-LGoffset+.8,label=label),
angle=-45,fontface='bold',size=textSCALE3[sel],col='white')+
scale_x_continuous(expand=c(0,0))+
scale_y_continuous(expand=c(0,0),
trans = 'reverse')+
scale_fill_viridis_c(name=expression(bar(italic(r)^2)))+
theme_void()+
theme(legend.position = c(.9,.75),
legend.direction = 'vertical')
return(p1)
}
\ No newline at end of file
BW <- read.csv('../../2_output/08_popGen/07_LD/subsets/glob_between.interchrom.hap.ld',sep='\t') %>%
select(R.2) %>%
mutate(type='Global',run='Global')
for(j in 1:6){
flS <- c("boc","bel","hon","pue","nig","uni")
flL <- c("Panana","Belize","Honduras","H. puella","H. nigricans","H. unicolor")
flT <- c(rep('Geo',3),rep('Spec',3))
k <- flS[j]
q <- flL[j]
u <- flT[j]
print(j)
BW <- BW %>%
rbind(.,(read.csv(paste('../../2_output/08_popGen/07_LD/subsets/glob_between.',k,'.interchrom.hap.ld',sep=''),
sep='\t') %>%
select(R.2) %>%
mutate(type=u,run=q)))
}
BW$run <- factor(BW$run,levels=c('Global',"Panana","Belize","Honduras",
"H. nigricans","H. puella","H. unicolor"))
dt2 <- BW %>%
group_by(run) %>%
summarise(meanR2=mean(R.2,na.rm = T),medR2=median(R.2,na.rm = T)) %>%
gather(key = 'type',value = 'val',2:3)
BC <-rgb(.7,.7,.7)
clr <-colorRampPalette(colors = c('white',BC,'black'))(8)
pBOX <- ggplot(BW,aes(x=run,y=R.2))+
geom_boxplot(fill=BC,width=.7,outlier.size = .1)+
#coord_fixed(ylim=c(0,.031),ratio = 250)+
geom_point(inherit.aes = F, data=dt2,aes(x=run,y=val,fill=type),shape=23,size=1)+
ggtitle(expression(Genome~wide~ILD~(italic(r)^2)))+
scale_x_discrete(labels = expression(Global,Panama,Belize,Honduas,
italic("H. nigricans"),italic("H. puella"),italic("H. unicolor")))+
scale_y_continuous()+
scale_fill_manual('',values = clr[c(6,1)],labels=c('mean','median'))+
guides(shape = guide_legend(ncol = 1))+
theme(legend.position = c(-.4,1.27),
text = element_text(size=10),
axis.title.y = element_blank(),
axis.title.x = element_blank(),
axis.text.y = element_text(size=7),
axis.text.x = element_text(size=7,angle=45,hjust = 1),
panel.background = element_blank(),
plot.background = element_blank())
\ No newline at end of file
dataBoxGenes <- data.frame(R.2=c(),run=c(),stringsAsFactors = F)
for (file in dir("../../2_output/08_popGen/07_LD/",pattern = "interchrom.hap.ld.gz")) {
nm <- str_remove_all(file, "spotlight.") %>% str_remove_all(.,".interchrom.hap.ld.gz")
if(nm %in% c("global","uni","pue","nig","hon","bel","boc")){
dataBoxGenes <- read.csv(gzfile(paste('../../2_output/08_popGen/07_LD/',file,sep='')),sep='\t') %>%
mutate(run = nm) %>%
select(R.2,run) %>%
rbind(dataBoxGenes,.)
}
}
dataBoxGenes$xS <- factor(dataBoxGenes$run,
levels = c("global","boc","bel","hon","nig","pue","uni"))
BoxGenes_summary <- dataBoxGenes %>%
group_by(xS) %>%
summarise(run = run[1],
meanR2 = mean(R.2,na.rm = T),
medR2 = median(R.2,na.rm = T),
sdR2 = sd(R.2,na.rm=T),
seR2 = se(R.2),
nanr = sum(is.na(R.2)),
minR2 = min(R.2,na.rm = T),
maxR2 = max(R.2,na.rm = T),
lengthR2 = length(R.2)) %>%
select(xS,meanR2,medR2) %>%
gather(key = 'type',value = 'val',2:3)
boxGenes <- ggplot(dataBoxGenes,aes(x=xS))+
geom_boxplot(aes(y=R.2),fill=BC,width=.7,outlier.size = .1) +
geom_point(data=BoxGenes_summary,aes(y=val,fill=type),shape=23,size=1)+
#coord_fixed(ylim=c(0,.031),ratio = 250)+
ggtitle(expression(Candidate~gene~ILD~(italic(r)^2)))+
scale_y_continuous(expression(Candidate~gene~ILD~(italic(r)^2)))+
scale_x_discrete(labels = expression(Global,Panama,Belize,Honduas,
italic("H. nigricans"),italic("H. puella"),italic("H. unicolor")))+
scale_fill_manual('',values = clr[c(6,1)],labels=c('mean','median'))+
guides(shape = guide_legend(ncol = 1))+
theme(legend.position = c(.35,1.27),
text = element_text(size=10),