This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import polars as pl | |
import numpy as np | |
def windowed_bin(df, window_size, column, binedges, precision=5, log_precision=False): | |
step_size = window_size | |
def bin_values(values): | |
bins = np.histogram(values, bins=binedges)[0] | |
return bins.tolist() | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::{io, marker::PhantomData}; | |
use std::io::BufRead; | |
use coitrees::{COITree, Interval, IntervalTree}; | |
use fnv::FnvBuildHasher; | |
use indexmap::IndexMap; | |
use ndarray::{Array2, Array1}; | |
use serde::Deserialize; | |
use thiserror::Error; | |
use super::utils::{InputFile, FileError, BinEdges}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"__default__" : | |
{ | |
"time" : "0-04:00:00", | |
"n" : 1, | |
"account" : "kernlab", | |
"partition" : "kerngpu", | |
"mem" : "3G", | |
"cores" : "1", | |
"chdir": "/gpfs/projects/kernlab/vsb/projects/bprime/msprime/", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import operator | |
from collections import defaultdict | |
import numpy as np | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
import matplotlib as mpl | |
from matplotlib.collections import PatchCollection, LineCollection | |
from matplotlib.patches import Rectangle | |
import matplotlib.patches as mpatches |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import date, timedelta | |
import math | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib.patches import Rectangle | |
from matplotlib.collections import PatchCollection | |
mean_le = math.ceil(78.54) # for men in US | |
birthday = (1986, 12, 19) | |
deathday = (mean_le + birthday[0], 12, 19) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
initialize() { | |
initializeMutationRate(1e-8); | |
initializeMutationType("m1", 0.5, "f", 0.0); | |
initializeGenomicElementType("g1", m1, 1); | |
initializeGenomicElement(g1, 0, 99999); | |
initializeRecombinationRate(1e-8); | |
} | |
1 early() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fix_spines(ax, connect=True, x=True): | |
""" | |
Beautifies spines by stopping them at the last tick mark. If connect=False, | |
also stops them at the first tick mark. For y-axis only, set x=False. | |
""" | |
ylim = ax.get_ylim() | |
xlim = ax.get_xlim() | |
yticks = ax.get_yticks() | |
xticks = ax.get_xticks() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
np.random.seed(1) | |
DATADIR = "sim_results/" | |
SLIM = "/home/vsb/src/SLiM_build/slim " | |
## Parameters | |
nreps = range(50) | |
# ------- Shared Parameters ------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
np.random.seed(1) | |
DATADIR = "sim_results/" | |
SLIM = "/home/vsb/src/SLiM_build/slim " | |
## Parameters | |
nreps = range(50) | |
# ------- Shared Parameters ------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import slper.slimfile as sf | |
np.random.seed(1) | |
DATADIR = "../data/sims/" | |
SLIM = "/home/vsb/src/SLiM_build/slim " | |
## Parameters | |
nreps = range(50) |
NewerOlder