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
| src='/run/media/genetics/pgc_ptsd/broad/gracy' # Source directory | |
| dst='/run/media/root/_gen/pts1/gracy' # Destination directory | |
| icp() { | |
| f="${1}"; | |
| [ -d "$f" ] && { | |
| [ ! -d "${dst}${f#$src}" ] && mkdir -p "${dst}${f#$src}"; | |
| return | |
| } |
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
| #List 1000g Europeans | |
| awk '{if ($3 == "EUR") print $1}' integrated_call_samples_v3.20130502.ALL.panel > 1000g_europeans.subjects | |
| for i in 22 # {1..22} | |
| do | |
| vcf-subset -c 1000g_europeans.subjects ALL.chr"$i".phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf.gz | fill-an-ac | gzip -c > CEU.chr"$i".phase1.vcf.gz | |
| done | |
| #Get marker info for all markers. Only take rs markers that are di-allelic | |
| for i in {1..22} |
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
| #Convert all 1000g data to plink binary | |
| for chr in {1..22} | |
| do | |
| plink2 --vcf 1000g/ALL.chr"$chr".phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf.gz --keep 1000g_eur.ref2 --make-bed --out 1000g/1000geur_chr"$chr" | |
| plink2 --vcf 1000g/ALL.chr"$chr".phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf.gz --keep 1000g_afr.ref2 --make-bed --out 1000g/1000gafr_chr"$chr" | |
| done | |
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
| awk '{print $1"_"$2, $1"_"$2,$6}' pts_mrsc_mix_am-qc.fam > mrsc.pheno | |
| awk '{print $1"_"$2, $1"_"$2,$4,$5,$6,$7,$8}' pts_mrsc_mix_am-qc-eur_pca.menv.mds_cov > mrsc.cov | |
| awk '{print $1"_"$2, $1"_"$2,$4,$5,$6,$7,$8}' pts_mrsc_mix_am-qc-aam_pca.menv.mds_cov > mrscA.cov | |
| zcat chr1.dose.vcf.gz | head -n 100000 | gzip > chr1.abbr.dose.vcf.gz | |
| /mnt/sdb/genetics/tiff1/hrc_impute/plink --vcf chr1.dose.vcf.gz --hide-covar --pheno mrsc.pheno --allow-no-sex --covar mrsc.cov --double-id --logistic --ci 0.95 --out mrsc_chr1 | |
| #Compare to gwas results | |
| zcat daner_mrsc_eur_analysis_run3.gz | grep -v NA | awk '{if (NR == 1 || $1 == "1") print}' | sort -g -k 11 > chr1_eur.out |
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
| wd=/home/maihofer/haps/ | |
| cd $wd | |
| #Datasets that have (x) or need (y) to rephase haplotype data | |
| # safr y | |
| # mrsc y | |
| # dnhs y | |
| # gsdc y | |
| # fscd y | |
| # nss1 y |
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
| Case Prep 65 CEPHDNA Crtl Post 31 Case Prep 29 Ctrl Prep 42 Case Post 64 Case Post 83 Ctrl Prep 75 Case Prep 85 Ctrl Post 81 Ctrl Post 116 Case Prep 107 | |
| Case Post 65 Ctrl Prep 179 Ctrl Prep 31 Case Post 29 Ctrl Post 42 Case Prep 64 Case Prep 83 Ctrl Post 75 Case Post 85 Ctrl Prep 81 Ctrl Prep 116 Case Post 107 | |
| Ctrl Post 28 Case Prep 72 Ctrl Prep 37 Case Post 93 Case Post 48 Ctrl Prep 56 Case Prep 49 Ctrl Post 66 Ctrl Post 68 Case Prep 95 Case Prep 104 Ctrl Post 136 | |
| Ctrl Prep 28 Case Post 72 Ctrl Post 37 Case Prep 93 Case Prep 48 Ctrl Post 56 Case Post 49 Ctrl Prep 66 Ctrl Prep 68 Case Post 95 Case Post 104 Ctrl Prep 136 | |
| Ctrl Prep 185 Case Post 90 Case Post 74 Ctrl Prep 39 Case Prep 77 Ctrl Post 60 Ctrl Post 58 Case Prep 87 Ctrl Prep 1 Case Post 97 Case Post 102 Ctrl Prep 73 | |
| Ctrl Post 185 Case Prep 90 Case Prep 74 Ctrl Post 39 Case Post 77 Ctrl Prep 60 Ctrl Prep 58 Case Post 87 Ctrl Post 1 Case Prep 97 Case Prep 102 Ctrl Post 73 | |
| Case Post 69 Ctrl Prep 35 Case Prep 215 Ctrl Post 41 Ctrl Post 54 Case Prep 78 Ctr |
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
| #Note according to Katy format: Anyone with value "5-all others" is alphabetically ordered by last name. | |
| #!!! ASSUMING THAT DATA HAS BEEN DOUBLE SORTED BY "Paper order" and "Published Name" !!! | |
| dat_ordered <- read.csv('affiliations_Freeze2.csv',stringsAsFactors=F,header=T) | |
| #Generate single variable for affiliations, easily to work with.. | |
| dat_ordered$Afone <- paste(dat_ordered$Institution..EDITED.,dat_ordered$Department..EDITED.,dat_ordered$City,dat_ordered$State,dat_ordered$Country,sep=". ") | |
| dat_ordered$Afone <- sapply(dat_ordered$Afone, gsub, pattern='\xa0', replacement=" " ) |
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
| args <- commandArgs(TRUE) | |
| scriptno <- args[1] | |
| scriptno <- as.numeric(scriptno) | |
| ncore=7 #Assume that node has this many cores | |
| Ngroups=1 | |
| fineness=.005 | |
| efseq1 <- seq(1.05,1.3,by=fineness) |
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
| impute_median <- function(x) | |
| { | |
| med <- median(x,na.rm=T) | |
| x[is.na(x)] <- med | |
| return(x) | |
| } | |
| ##Read in a .csv file consisting of Barfield CpGs, one row per CpG, one column per sample. | |
| d1 <- read.csv('MRS_Long_barfieldProbes.csv',header=T,nr=20000) | |
| d1$CpG <- d1$X |
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
| #list all files, make folder for each | |
| ls * | grep .idat | awk 'BEGIN{FS="_"}{print $1}' | sort -u > folderlist.txt | |
| for folders in $(cat folderlist.txt) | |
| do | |
| mkdir $folders | |
| done |