This requires Python v2.7 plus the following plugin:
This file contains hidden or 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
calculate_mean_squared_error <- function(dati, samplesize, numberofbootstraps) | |
{ | |
squared_error <- array(0, numberofbootstraps) | |
mean_dati <- mean(dati) | |
for(i in 1:numberofbootstraps) | |
{ | |
squared_error[i] <- (mean_dati - mean(sample(dati, samplesize)))^2 | |
} | |
return(mean(squared_error)) | |
} |
This file contains hidden or 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
#!/bin/bash | |
# From https://forums.plex.tv/index.php/topic/153446-this-server-is-not-powerful-enough-to-convert-video/page-3 | |
cd /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Plug-ins/WebClient.bundle/Contents/Resources/js | |
sudo sed -i 's/validateTranscoder:function(e,t){if/validateTranscoder:function(e,t){return false;if/g' plex.js |
This file contains hidden or 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
two_sample_iv <- function(b_exp, b_out, se_exp, se_out, n=10000) | |
{ | |
b <- sum(b_exp*b_out / se_out^2) / sum(b_exp^2/se_out^2) | |
se <- sqrt(1 / sum(b_exp^2/se_out^2)) | |
pval <- pt(b / se, df = n, low=FALSE) | |
return(list(b=b, se=se, pval=pval)) | |
} | |
two_sample_iv_delta <- function(b_exp, b_out, se_exp, se_out, n=10000, cov=1) | |
{ |
This file contains hidden or 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
setwd("/I/DON\'T/KNOW/YOUR/COMPUTER") | |
# Install pdftotext from here: | |
# http://mac.softpedia.com/get/Word-Processing/pdftotext-Installer-Package.shtml | |
# Find pdf files in a directory | |
get_pdf_files <- function(wd="./") | |
{ |
This file contains hidden or 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
#!/bin/bash | |
for i in {1..9} | |
do | |
plink1.90 --bfile ~/data/alspac_1kg/data/genotypes/bestguess/subset_maf0.01_info0.8/data_chr0${i} --extract ~/data/1kg_scratch/hapmap3_autosome.snplist --make-grm-bin --out data_chr0${i} --maf 0.01 | |
done | |
for i in {10..22} | |
do | |
plink1.90 --bfile ~/data/alspac_1kg/data/genotypes/bestguess/subset_maf0.01_info0.8/data_chr${i} --extract ~/data/1kg_scratch/hapmap3_autosome.snplist --make-grm-bin --out data_chr${i} --maf 0.01 |
This file contains hidden or 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
#!/bin/bash | |
cd /panfs/panasas01/shared/alspac/studies/latest/alspac/genetic/variants/arrays/gwas/imputed/1000genomes/released/27Feb2015/data/derived | |
mkdir -p ~/updated_ids | |
mkdir -p ~/updated_ids/kinships | |
mkdir -p ~/updated_ids/principal_components/all | |
mkdir -p ~/updated_ids/principal_components/unrelateds | |
mkdir -p ~/updated_ids/exclusion_ids | |
mkdir -p ~/updated_ids/unrelated_ids |
This file contains hidden or 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
#!/bin/bash | |
#PBS -N extractdata | |
#PBS -o extractdata-output | |
#PBS -e extractdata-error | |
#PBS -t 1-23 | |
#PBS -l walltime=24:00:00 | |
#PBS -l nodes=1:ppn=2 | |
#PBS -S /bin/bash | |
This file contains hidden or 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
#!/bin/bash | |
#PBS -l walltime=24:00:00,nodes=1:ppn=1 | |
#PBS -o output.file | |
#PBS -me | |
#PBS -S /bin/bash | |
set -e | |
module add apps/vcftools-0.1.12b | |
export PERL5LIB=/cm/shared/apps/VCFTOOLS-0.1.12b/vcftools_0.1.12b/perl/ |
This file contains hidden or 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
#!/usr/bin/env bash | |
# rmate | |
# Copyright (C) 2011-2013 by Harald Lapp <[email protected]> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# |