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
#Assumes data is a table delimited .bim file | |
bimfile=bim_name_here | |
grep -P "A\tT" $bimfile > ambiguous_snps.txt | |
grep -P "T\tA" $bimfile >> ambiguous_snps.txt | |
grep -P "C\tG" $bimfile >> ambiguous_snps.txt | |
grep -P "G\tC" $bimfile >> ambiguous_snps.txt | |
#for metal | |
bimfile=LOOMeur_1_.results |
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
library(metafor) | |
y <- scan(what=numeric()) | |
0.273936 | |
0.278002 | |
0.117789 | |
0.170343 | |
se <- scan(what=numeric()) | |
0.0864617 |
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
#PBS -lnodes=1 | |
#PBS -lwalltime=0:05:00 | |
#!/bin/bash | |
while getopts n:o:p:d:s: option | |
do | |
case "${option}" | |
in | |
o) outputfile=${OPTARG};; |
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
#Test the association between a SNP and PTSD, in R, assuming ordered logit of the SNP | |
#Do the following in PLINK | |
plink --bfile --snp rs4680 --recodeA --out rs4680 | |
#Open the corresponding .raw file and note the column name for the SNP. you'll need this for R | |
#Then load R | |
R |
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 | |
while getopts s:i:o:e: option | |
do | |
case "${option}" | |
in | |
s) scriptname=${OPTARG};; | |
i) indata=${OPTARG};; | |
o) outdata=${OPTARG};; | |
e) errorbars=${OPTARG};; |
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(trailingOnly = TRUE) | |
scriptloc <- args[1] | |
results <- args[2] | |
outfile <- args[3] | |
snpcol <- args[4] | |
chrcol <- args[5] | |
bpcol <- args[6] | |
pcol <- args[7] | |
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
chunknum=$(echo $chunk | sed 's/.*\(chr[0-9]*_[0-9]*_[0-9]*\).*/\1/') | |
chrnum=$(echo $chunk | sed 's/.*\(chr[0-9]*\).*/\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
bimfile=pts_meg2_mix_am-qc.bim | |
grep -P "A\tT" $bimfile > ambiguous_snps.txt | |
grep -P "T\tA" $bimfile >> ambiguous_snps.txt | |
grep -P "C\tG" $bimfile >> ambiguous_snps.txt | |
grep -P "G\tC" $bimfile >> ambiguous_snps.txt | |
#filer out ambiguous | |
$plink_location --bfile pts_meg2_mix_am-qc --exclude ambiguous_snps.txt --make-bed --out pts_meg2_mix_am-qc-ambig |
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
#PBS -lnodes=1 | |
#PBS -lwalltime=0:05:00 | |
#!/bin/bash | |
while getopts a:b:o:p:d: option | |
do | |
case "${option}" | |
in | |
a) phenotype=${OPTARG};; |
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
#Requires a list of SNPs written into snplist.txt | |
dosage_directory=write_path_to_dosage_files_here | |
for snp in $(cat snplist.txt) | |
do | |
filename=$(grep -w -m1 -l $snp "$dosage_directory"/*.map | sed 's/.map/.gz/g' ) | |
zgrep -w -m1 $snp $filename > "$snp".dosage | |
done | |
OlderNewer