Skip to content

Instantly share code, notes, and snippets.

@kate-crosby
kate-crosby / seeds_inv4.sh
Last active August 29, 2015 14:21
get_seeds_inv4.sh
#Run tassel from the get_list.R
module load gcc jdk/1.8 tassel/5
run_pipeline.pl -Xmx64g -fork1 -h All_SeeD_2.7_chr4_no_filter.unimputed.hmp.txt -export -exportType VCF -runfork1
sed '11q;d' All_SeeD_2.7_chr4_no_filter.unimputed.vcf > header.vcf
@kate-crosby
kate-crosby / ppsize.R
Created April 24, 2015 16:50
ppsize R
# Doesn't matter what this is just defining an object
Y <- rnorm(500)
as.formula(paste("Y~",paste("SNP",1:16657,sep="",collapse="+"),sep=" "))
# Compare the two - if set max ppsize, goes up but not enough for 160k fixed effects
as.formula(paste("Y~",paste("SNP",1:16658,sep="",collapse="+"),sep=" "))
@kate-crosby
kate-crosby / gist:fd1317e22080b7042d4a
Created March 18, 2015 20:05
for jinliang climate
rm(list=ls())
library(raster)
#Get bio variables at 10 minutes of a degree resolution
biovar = getData('worldclim', var='bio', res=10)
biovar5 = getData('worldclim', var="bio", res=5)
###Get elevation data with SRTM - go to website to determine relevant tiles,
#each of these tiles are large - may be easier to do on website
@kate-crosby
kate-crosby / convert_hmp_plink_ped.py
Created December 3, 2014 01:22
hmp.txt or hmp.txt.gz to plink ped format - use R gist to get map format
@kate-crosby
kate-crosby / convert_big.R
Created November 18, 2014 16:07
Bigger files - unzip the gz and use fread
library(data.table)
fulldata <- fread("AmesUSInbreds_AllZeaGBSv1.0_imputed_20130508_chr1.hmp.txt",
header=T, sep = "\t")
dim(fulldata)
fulldata <-data.frame(fulldata)
# Eliminate unwanted columns prior to conversion
drops <- c("alleles","chrom", "pos", "strand", "assembly#", "center", "protLSID",
"assayLSID", "panelLSID", "QCcode")
new.df <- fulldata[,!(names(fulldata) %in% drops)]
@kate-crosby
kate-crosby / hmp2ped.R
Last active December 7, 2023 02:52
take hmp.txt or hmp.txt.gz from PANZEA and convert to PED & MAP file for plink
# Let's make some fake plink map and ped files - ped files contain the genotype and map the chrom and position
############################################################################
# Let's start with the PED file - reading in zip file downloaded from PANZEA
############################################################################
fulldata <- read.table("NAM_phasedImputed_1cM_AllZeaGBSv2.3_allChrs.hmp.txt",
header=T,comment.char="",stringsAsFactors=F)
dim(fulldata)