Skip to content

Commit 6d4781d

Browse files
Ella DavysonElla Davyson
Ella Davyson
authored and
Ella Davyson
committed
Metabolite GWAS script"
1 parent c0c32e7 commit 6d4781d

File tree

3 files changed

+38
-11
lines changed

3 files changed

+38
-11
lines changed

Diff for: .DS_Store

0 Bytes
Binary file not shown.

Diff for: Metabolite_GWAS

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#$ -l h_rt=48:00:00
2+
#$ -l h_vmem=2G
3+
#$ -pe sharedmem 12
4+
#$ -t 3-251:10
5+
#$ -e gwas_logs
6+
#$ -o gwas_logs
7+
#$ -cwd
8+
9+
10+
IMPV3=impv3_pgen
11+
METABOLOMICS=Metabolomics_Aut2021
12+
SCRATCH=s2112198
13+
14+
local/bin/plink2 \
15+
--pfile $IMPV3/ukb_imp_v3.qc \
16+
--pheno $METABOLOMICS/unrel_eur_metabolite_covar.tsv \
17+
--pheno-col-nums $SGE_TASK_ID-$((SGE_TASK_ID+SGE_TASK_STEPSIZE-2)) \
18+
--covar $METABOLOMICS/unrel_eur_metabolite_covar.tsv \
19+
--covar-name genotyping sex age AS PC1-PC10 \
20+
--covar-variance-standardize \
21+
--linear 'hide-covar' cols=chrom,pos,ax,a1freq,machr2,nobs,orbeta,se,p \
22+
--out $SCRATCH/col_num_loop/all_gwas \
23+
--memory 92000 \
24+
--threads 12
25+
26+

Diff for: locus_zoom_meta.R

+12-11
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ library(dplyr)
66
library(readr)
77
library(ggplot2)
88

9+
source('/Users/ellad/UniversityEdinburgh/PhD/CodePhD/Metabolomics/functions_metabolite.R')
910
#scale function for the x axis
1011
scaleFUN <- function(x) {
1112
tmp <- x/1000000
@@ -45,28 +46,28 @@ locus_plot <- function(sumstats, LD_file, lowerlim, upperlim, colocalised_SNP, f
4546

4647
##LA to TFA plot ##
4748

48-
la_sumstats_chr11 <- read.table('Metabolomics/chr11_signif_metabolites/f.23456.0.0chr_11.tsv', sep = '\t', header = T)
49-
rs174578_ld <- read.table('Metabolomics/SNP_ld/rs174578.ld', header = T)
49+
la_sumstats_chr11 <- read.table('/Users/ellad/UniversityEdinburgh/PhD/Data/UKB/Metabolomics/chr11_signif_metabolites/f.23456.0.0chr_11.tsv', sep = '\t', header = T)
50+
rs174578_ld <- read.table('/Users/ellad/UniversityEdinburgh/PhD/Data/UKB/Metabolomics/SNP_ld/rs174578.ld', header = T)
5051

5152
LA_TFA_locus_plot <- locus_plot(la_sumstats_chr11, rs174578_ld, 61450000, 61800000, 'rs174578', 'f.23456.0.0')
5253
## DHA plot ##
5354

54-
DHA_sumstats_chr11 <- read.table('Metabolomics/chr11_signif_metabolites/f.23450.0.0chr_11.tsv', sep = '\t', header = T)
55-
rs2727271_ld <- read.table('Metabolomics/SNP_ld/rs2727271.ld', header = T)
55+
DHA_sumstats_chr11 <- read.table('/Users/ellad/UniversityEdinburgh/PhD/Data/UKB/Metabolomics/chr11_signif_metabolites/f.23450.0.0chr_11.tsv', sep = '\t', header = T)
56+
rs2727271_ld <- read.table('/Users/ellad/UniversityEdinburgh/PhD/Data/UKB/Metabolomics/SNP_ld/rs2727271.ld', header = T)
5657

5758
DHA_locus_plot <- locus_plot(DHA_sumstats_chr11, rs2727271_ld, 61450000, 61800000, 'rs2727271', 'f.23450.0.0')
5859
DHA_locus_plot_sameLD <- locus_plot(DHA_sumstats_chr11, rs174578_ld, 61450000, 61800000, 'rs174578', 'f.23450.0.0')
5960

6061
##DHA to Total Fatty Acids ##
6162

62-
DHA_TFA_sumstats_chr11 <- read.table('Metabolomics/chr11_signif_metabolites/f.23457.0.0chr_11.tsv', sep = '\t', header = T)
63-
rs174575_ld <- read.table('Metabolomics/SNP_ld/rs174575.ld', header = T)
63+
DHA_TFA_sumstats_chr11 <- read.table('/Users/ellad/UniversityEdinburgh/PhD/Data/UKB/Metabolomics/chr11_signif_metabolites/f.23457.0.0chr_11.tsv', sep = '\t', header = T)
64+
rs174575_ld <- read.table('/Users/ellad/UniversityEdinburgh/PhD/Data/UKB/Metabolomics/SNP_ld/rs174575.ld', header = T)
6465

6566
DHA_TFA_locus_plot <- locus_plot(DHA_TFA_sumstats_chr11, rs174575_ld, 61450000, 61800000, 'rs174575', 'f.23457.0.0')
6667

6768
## MDD locus plot - slightly different scales etc ##
6869

69-
mdd_chr11 <- read.table('Metabolomics/mdd_sumstats_chr11_noUKB_withNandBETA.tsv', sep = '\t', header = T)
70+
mdd_chr11 <- read.table('/Users/ellad/UniversityEdinburgh/PhD/Data/UKB/Metabolomics/mdd_sumstats_chr11_noUKB_withNandBETA.tsv', sep = '\t', header = T)
7071
subset_mdd_chr11 <- mdd_chr11[which(mdd_chr11$BP >= 61450000),]
7172
subset_mdd_chr11 <- subset_mdd_chr11[which(subset_mdd_chr11$BP <= 61800000),]
7273
mdd_snps_in_LD_matrix_df <- merge(subset_mdd_chr11, rs174578_ld[,c('SNP_B', 'R2')], by.x = 'SNP', by.y = 'SNP_B')
@@ -81,7 +82,7 @@ mdd_locus_plot <- ggplot(mdd_snps_in_LD_matrix_df, aes(x = BP, y = -log10(P))) +
8182
## the gene tracks of the region ##
8283

8384
#### not sure what the above is , but doing it with ggplot ####
84-
more_UCSC_genes <- read.table('Metabolomics/6145-618_UCSC_genes', sep = '\t', header = F)
85+
more_UCSC_genes <- read.table('/Users/ellad/UniversityEdinburgh/PhD/Data/UKB/Metabolomics/6145-618_UCSC_genes', sep = '\t', header = F)
8586
colnames(more_UCSC_genes) <- c('Chrom', 'Start', 'End', 'Gene', 'Description')
8687

8788
more_UCSC_genes$Colour <- 'black' #change this depending on the genes which we tested
@@ -106,10 +107,10 @@ gene_track_plot <- ggplot(more_UCSC_genes, aes(x = BP, y = Y)) + geom_segment(ae
106107
gene_track_plot <- gene_track_plot+guides(color="none")
107108

108109
all_plots <- ggarrange(LA_TFA_locus_plot,DHA_locus_plot, DHA_TFA_locus_plot, mdd_locus_plot, gene_track_plot, common.legend = T, nrow = 5, ncol = 1)
109-
ggsave('Metabolomics/plots/locus_zoom_plots.tiff', device = 'tiff', all_plots, scale = 1, width = 184, height = 285, units ="mm")
110+
ggsave('/Users/ellad/UniversityEdinburgh/PhD/Data/UKB/Metabolomics/plots/locus_zoom_plots.tiff', device = 'tiff', all_plots, scale = 1, width = 184, height = 285, units ="mm")
110111

111112
#DHA_plots <- ggarrange(DHA_locus_plot, DHA_TFA_locus_plot, mdd_locus_plot, gene_track_plot, common.legend = T, labels = c('A', 'B', 'C', 'D'), nrow = 4, ncol =1)
112113
#ggsave('Metabolomics/plots/DHA_all_locus_zoom.tiff', device = 'tiff', DHA_plots, scale = 1, width = 190, height = 243.2, units ="mm", bg = "white")
113-
DHA_plot_single <- ggarrange(DHA_locus_plot, mdd_locus_plot, gene_track_plot, common.legend = T, labels = c('A', 'B', 'C'), nrow = 3, ncol = 1)
114+
DHA_plot_single <- ggarrange(mdd_locus_plot,DHA_locus_plot, gene_track_plot, common.legend = T, labels = c('A', 'B', 'C'), nrow = 3, ncol = 1)
114115
#la_tfa_plots <- ggarrange(LA_TFA_locus_plot, mdd_locus_plot, gene_track_plot, common.legend = T, labels = c('A', 'B', 'C'), nrow = 3, ncol = 1)
115-
ggsave('Figure_3.tiff', device = 'tiff', DHA_plot_single, scale = 1, width = 190, height = 243.2, units ="mm", bg = "white")
116+
ggsave('/Users/ellad/UniversityEdinburgh/PhD/Year_1/Metabolomics_Submission/Acceptance/Proofd/Figure_3.tiff', device = 'tiff', DHA_plot_single, scale = 1, width = 190, height = 243.2, units ="mm", bg = "white")

0 commit comments

Comments
 (0)