In [2]:
library(biomaRt) #  Load the biomaRt library for accessing biological data through BioMart
library(data.table) # Load the data.table library for efficient data manipulation
library(ggplot2) # Load the ggplot2 library for creating data visualizations
library(readxl) # Load the readxl library for reading Excel files into R
Warning message:
“multiple methods tables found for ‘which’”
In [3]:
setwd("/scratch/silo1/rameez/ldscore/Geneweaver")

GeneWeaver database

In [4]:
# Read an Excel file named "Withdrawal Human Orthologs.xlsx" from the specified path
Jason_list <- read_excel("/projects/bga_lab/DATA_REPOSITORIES/COGA_WITHDRAWAL/UM_IMP_RESULTS/MERGED_CLEAN/SmokeScreen/Withdrawal Human Orthologs.xlsx",sheet = 1, skip = 7)
# Convert the read data into a data frame
Jason_list <- as.data.frame(Jason_list)
# Display the first few rows and dimensions of the data frame
head(Jason_list); dim(Jason_list)
# Create a new column named "GENE" containing lowercase versions of values from "Column 2"
Jason_list$GENE <- tolower(Jason_list$'Column 2')
# Extract columns "GENE" and "Hippocampus Alcohol Withdrawal" into a new data frame
J_list_withdrawal <- Jason_list[,c("GENE","Hippocampus Alcohol Withdrawal")]
# Filter rows where the "Hippocampus Alcohol Withdrawal" column is equal to 1
J_list_withdrawal <- J_list_withdrawal[J_list_withdrawal$'Hippocampus Alcohol Withdrawal' == 1,]
# Display the first few rows and dimensions of the filtered data frame
J_list_withdrawal$GENE <- toupper(J_list_withdrawal$GENE )
head(J_list_withdrawal); dim(J_list_withdrawal)
A data.frame: 6 × 17
GeneWeaver IDColumn 2human_gene_idHippocampus Alcohol WithdrawalPrefrontal cortex and HICPrefontal cortex HICEtOH abstinence postchronic WSPRVentral Striaum SOT vs NOTHippocampus and alcohol withdrawalStriatum and HICStriatum and WithdrawalPrefrontal Cortex of C57BL/6J MiceNucleus Accumbens of C57BL/6J MiceHippocampus of C57BL/6J MiceUpReg EtOH Withdrawal D2DwnReg EtOH Withdrawl B6Sum
<dbl><chr><chr><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl>
1 4475Rgs5 HGNC:1000100000000001001
2118287Rit1 HGNC:1002310000000000001
3104584Rnase4HGNC:1004710000000000001
4 4465RnaselHGNC:1005000001000000001
5 7196Rnf10 HGNC:1005500000000010001
6 5619Bcl7c HGNC:1006 00001000000001
  1. 3070
  2. 17
A data.frame: 6 × 2
GENEHippocampus Alcohol Withdrawal
<chr><dbl>
2RIT1 1
3RNASE41
17RPL10A1
20RPL18 1
21RPL18A1
22RPL27 1
  1. 816
  2. 2

Option #1: Utilize the BioMart packages in R to extract chromosome, start/end positions.

In [6]:
# Define the biomart connection for GRCh37
grch37 = useMart(biomart="ENSEMBL_MART_ENSEMBL", host="grch37.ensembl.org", path="/biomart/martservice", dataset="hsapiens_gene_ensembl")
# Retrieve gene information from GRCh37 biomart
gene_37 <-getBM(attributes=c('ensembl_gene_id',"ensembl_gene_id_version","hgnc_symbol",'chromosome_name','start_position','end_position'), mart = grch37)
# Filter genes located on chromosomes 1 to 22
gene_37 <- gene_37[gene_37$chromosome_name == 1 | gene_37$chromosome_name == 2 | gene_37$chromosome_name == 3 | gene_37$chromosome_name == 4 |
				  gene_37$chromosome_name == 5 | gene_37$chromosome_name == 6 | gene_37$chromosome_name == 7 | gene_37$chromosome_name == 8  |
				  gene_37$chromosome_name == 9 | gene_37$chromosome_name == 10 | gene_37$chromosome_name == 11 | gene_37$chromosome_name == 12  |
				  gene_37$chromosome_name == 13 | gene_37$chromosome_name == 14 | gene_37$chromosome_name == 15 | gene_37$chromosome_name == 16  |
				  gene_37$chromosome_name == 17 | gene_37$chromosome_name == 18 | gene_37$chromosome_name == 19 | gene_37$chromosome_name == 20  |
				  gene_37$chromosome_name == 21 | gene_37$chromosome_name == 22 ,]
# Convert the result to a data frame
gene_37 <- as.data.frame(gene_37)
# Display the first few rows and dimensions of the data frame

head(gene_37); dim(gene_37)
A data.frame: 6 × 6
ensembl_gene_idensembl_gene_id_versionhgnc_symbolchromosome_namestart_positionend_position
<chr><chr><chr><chr><int><int>
2ENSG00000223116ENSG00000223116.1 132355199423552136
3ENSG00000233440ENSG00000233440.2HMGA1P6 132370831323708703
4ENSG00000207157ENSG00000207157.1RNY3P4 132372672523726825
5ENSG00000229483ENSG00000229483.2LINC00362132374397423744736
6ENSG00000252952ENSG00000252952.1RNU6-58P 132379157123791673
7ENSG00000235205ENSG00000235205.1TATDN2P3 132381765923821323
  1. 54921
  2. 6
In [11]:
# Merge the J_list_withdrawal and gene_37 data frames by the 'GENE' column without sorting
gene_37_J_list_withdrawal <- merge(J_list_withdrawal,gene_37,by.x = "GENE", by.y = "hgnc_symbol", sort = FALSE)
# Display the first few rows and dimensions of the merged data frame
head(gene_37_J_list_withdrawal); dim(gene_37_J_list_withdrawal)
A data.frame: 6 × 7
GENEHippocampus Alcohol Withdrawalensembl_gene_idensembl_gene_id_versionchromosome_namestart_positionend_position
<chr><dbl><chr><chr><chr><int><int>
1RIT1 1ENSG00000143622ENSG00000143622.61 155867599155881195
2RNASE41ENSG00000258818ENSG00000258818.214 21152259 21168761
3RPL10A1ENSG00000198755ENSG00000198755.66 35436185 35438562
4RPL18 1ENSG00000063177ENSG00000063177.819 49118585 49122793
5RPL18A1ENSG00000105640ENSG00000105640.819 17970685 17974962
6RPL27 1ENSG00000131469ENSG00000131469.817 41150290 41154976
  1. 724
  2. 7
In [14]:
# Select specific columns 'chromosome_name', 'start_position', and 'end_position' from gene_37_J_list_withdrawal
gene_37_J_list_withdrawal_sub <- gene_37_J_list_withdrawal[,c("chromosome_name","start_position","end_position")]
# Prepend "chr" to the 'chromosome_name' column values
gene_37_J_list_withdrawal_sub$chromosome_name <- paste("chr",gene_37_J_list_withdrawal_sub$chromosome_name,sep = "")
# Rename the column names to 'CHR', 'START', and 'END'
colnames(gene_37_J_list_withdrawal_sub) <- c("CHR","START","END")
# Display the first few rows and dimensions of the subsetted data frame
head(gene_37_J_list_withdrawal_sub); dim(gene_37_J_list_withdrawal_sub)
# Write the subsetted data frame to a tab-separated text file named "J_list_withdrawal_geneset.txt"
fwrite(gene_37_J_list_withdrawal_sub,"J_list_withdrawal_geneset.txt",sep = "\t")
A data.frame: 6 × 3
CHRSTARTEND
<chr><int><int>
1chr1 155867599155881195
2chr14 21152259 21168761
3chr6 35436185 35438562
4chr19 49118585 49122793
5chr19 17970685 17974962
6chr17 41150290 41154976
  1. 724
  2. 3
In [15]:
fwrite(as.data.frame(J_list_withdrawal[,1]),"J_list_withdrawal_gene.txt", col.names = F)
In [16]:
IRdisplay::display_png(file = "gene_list.png")
In [24]:
J_list_withdrawal_ENSG <- fread("gProfiler_hsapiens_7-24-2023_12-41-16 PM.csv")
head(J_list_withdrawal_ENSG); dim(J_list_withdrawal_ENSG)
sum(is.na(J_list_withdrawal_ENSG$converted_alias))
sum(J_list_withdrawal_ENSG$converted_alias == "None")
fwrite(as.data.frame(J_list_withdrawal_ENSG[,2]),"J_list_withdrawal_ENSG.txt", col.names = F)
A data.table: 6 × 5
initial_aliasconverted_aliasnamedescriptionnamespace
<chr><chr><chr><chr><chr>
RIT1 ENSG00000143622RIT1 Ras like without CAAX 1 [Source:HGNC Symbol;Acc:HGNC:10023] ENTREZGENE,GENECARDS,HGNC,UNIPROT_GN,WIKIGENE
RNASE4ENSG00000258818RNASE4ribonuclease A family member 4 [Source:HGNC Symbol;Acc:HGNC:10047]ENTREZGENE,GENECARDS,HGNC,UNIPROT_GN,WIKIGENE
RPL10AENSG00000198755RPL10Aribosomal protein L10a [Source:HGNC Symbol;Acc:HGNC:10299] ENTREZGENE,GENECARDS,HGNC,UNIPROT_GN,WIKIGENE
RPL18 ENSG00000063177RPL18 ribosomal protein L18 [Source:HGNC Symbol;Acc:HGNC:10310] ENTREZGENE,GENECARDS,HGNC,UNIPROT_GN,WIKIGENE
RPL18AENSG00000105640RPL18Aribosomal protein L18a [Source:HGNC Symbol;Acc:HGNC:10311] ENTREZGENE,GENECARDS,HGNC,UNIPROT_GN,WIKIGENE
RPL27 ENSG00000131469RPL27 ribosomal protein L27 [Source:HGNC Symbol;Acc:HGNC:10328] ENTREZGENE,GENECARDS,HGNC,UNIPROT_GN,WIKIGENE
  1. 818
  2. 5
0
37

Annot

In [35]:
# Run In Linux 
mkdir J_list_withdrawal
for i in {1..22}
do
/projects/bga_lab/Rameez/Tool/miniconda3/envs/ldsc/bin/python \
/projects/bga_lab/Rameez/Tool/ldsc/make_annot.py \
--gene-set-file /scratch/silo1/rameez/ldscore/Geneweaver/J_list_withdrawal_ENSG.txt \
--gene-coord-file /scratch/silo1/rameez/ldscore/analysis/reference/make_annot_sample_files/ENSG_coord.txt \
--windowsize 100000 \
--bimfile /scratch/silo1/rameez/ldscore/analysis/reference/1000G_EUR_Phase3_plink/1000G.EUR.QC.${i}.bim \
--annot-file J_list_withdrawal/J_list_withdrawal.${i}.annot.gz
done

Summary Statistics

In [38]:
sum_stat_ea <- fread("/projects/bga_lab/DATA_REPOSITORIES/COGA_WITHDRAWAL/UM_IMP_RESULTS/MERGED_CLEAN_V2/update_result/ea_sub/MLMA/COGA_factor_res_age_sex_PC14_cov_cohort_mlma.mlma")
sum_stat_ea <- as.data.frame(sum_stat_ea)

rs <- fread("/projects/bga_lab/DATA_REPOSITORIES/COGA_WITHDRAWAL/UM_IMP_RESULTS/MERGED_CLEAN_V2/update_result/ea_sub/H_magma/sumStat_rs.txt")
rs <- as.data.frame(rs)

sum_stat_ea <- sum_stat_ea[order(sum_stat_ea$p),]
# 7320 Total sample
In [39]:
sum_stat_ea_rs <- merge(sum_stat_ea,rs, by.x = "p", by.y = "P", sort = FALSE)
head(sum_stat_ea_rs); dim(sum_stat_ea_rs)
A data.frame: 6 × 10
pChrSNP.xbpA1A2FreqbseSNP.y
<dbl><int><chr><int><chr><chr><dbl><dbl><dbl><chr>
16.33316e-091616:7098341370983413CT0.05722220.2525610.0434871rs145973320
22.52755e-07 88:13454638 13454638CT0.25203700.1225350.0237671rs1481592
32.73638e-07 88:13452449 13452449CT0.25000000.1224210.0238138rs12677258
43.56828e-071616:7076981270769812AG0.05620370.2263990.0444735rs62048007
55.18775e-071616:7090151070901510CT0.05611110.2221920.0442681rs115986303
65.82773e-07 88:13451319 13451319GA0.25009300.1189250.0238001rs7828829
  1. 73578560
  2. 10
In [44]:
sum_stat_ea_rs_sub <- sum_stat_ea_rs[,c("SNP.y","A1","A2","Freq","b","se","p")]
sum_stat_ea_rs_sub <- sum_stat_ea_rs_sub[!duplicated(sum_stat_ea_rs_sub$SNP.y),]
colnames(sum_stat_ea_rs_sub)[1:7] <- c("SNP_RS","Allele1","Allele2","Freq.A1","BETA","SE","P")
head(sum_stat_ea_rs_sub); dim(sum_stat_ea_rs_sub); sum(duplicated(sum_stat_ea_rs_sub$SNP_RS))
fwrite(sum_stat_ea_rs_sub,"sum_stat_ea_rs_sub.txt", sep = "\t")
A data.frame: 6 × 7
SNP_RSAllele1Allele2Freq.A1BETASEP
<chr><chr><chr><dbl><dbl><dbl><dbl>
1rs145973320CT0.05722220.2525610.04348716.33316e-09
2rs1481592 CT0.25203700.1225350.02376712.52755e-07
3rs12677258 CT0.25000000.1224210.02381382.73638e-07
4rs62048007 AG0.05620370.2263990.04447353.56828e-07
5rs115986303CT0.05611110.2221920.04426815.18775e-07
6rs7828829 GA0.25009300.1189250.02380015.82773e-07
  1. 7158432
  2. 7
0
In [ ]:
# Run in Linux
# format summary stats
/projects/bga_lab/Rameez/Tool/miniconda3/envs/ldsc/bin/python \
/projects/bga_lab/Rameez/Tool/ldsc/munge_sumstats.py \
--sumstats /scratch/silo1/rameez/ldscore/Geneweaver/sum_stat_ea_rs_sub.txt \
--merge-alleles /scratch/silo1/rameez/ldscore/analysis/reference/w_hm3.snplist \
--N 7320 --snp SNP_RS --p P --frq Freq.A1 --a1 Allele1 --a2 Allele2  \
--chunksize 50000 \
--out coga_WD_ea_V2

LD score

In [ ]:
# Run in linux
# awk '{if ($1!="SNP") {print $1} }' w_hm3.snplist > listHM3.txt
for i in {1..22}
do
/projects/bga_lab/Rameez/Tool/miniconda3/envs/ldsc/bin/python \
/projects/bga_lab/Rameez/Tool/ldsc/ldsc.py \
--l2 \
--bfile /scratch/silo1/rameez/ldscore/analysis/reference/1000G_EUR_Phase3_plink/1000G.EUR.QC.${i} \
--ld-wind-cm 1 \
--annot /scratch/silo1/rameez/ldscore/Geneweaver/J_list_withdrawal/J_list_withdrawal.${i}.annot.gz \
--thin-annot \
--out J_list_withdrawal/J_list_withdrawal.${i} \
--print-snps /scratch/silo1/rameez/ldscore/analysis/reference/listHM3.txt
done
In [ ]:

Enrishment analysis

In [ ]:
/projects/bga_lab/Rameez/Tool/miniconda3/envs/ldsc/bin/python \
/projects/bga_lab/Rameez/Tool/ldsc/ldsc.py \
--h2 /scratch/silo1/rameez/ldscore/Geneweaver/coga_WD_ea_V2.sumstats.gz \
--ref-ld-chr /scratch/silo1/rameez/ldscore/Geneweaver/J_list_withdrawal/J_list_withdrawal.,/scratch/silo1/rameez/ldscore/analysis/reference/1000G_EUR_Phase3_baseline/baseline. \
--w-ld-chr /scratch/silo1/rameez/ldscore/analysis/reference/weights_hm3_no_hla/weights. \
--overlap-annot \
--print-coefficients \
--frqfile-chr /scratch/silo1/rameez/ldscore/analysis/reference/1000G_Phase3_frq/1000G.EUR.QC. \
--out J_list_withdrawal/withdrawal
In [51]:
withdrawal <- fread("/scratch/silo1/rameez/ldscore/Geneweaver/J_list_withdrawal/withdrawal.results")
(withdrawal); dim(withdrawal)
A data.table: 54 × 10
CategoryProp._SNPsProp._h2Prop._h2_std_errorEnrichmentEnrichment_std_errorEnrichment_pCoefficientCoefficient_std_errorCoefficient_z-score
<chr><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl>
L2_0 0.066303549 0.218281000.2093234 3.2921466 3.1570460.361083627-5.505311e-084.034147e-08-1.36467789
baseL2_1 1.000000000 1.000000000.0000000 1.0000000 0.000000 NA 6.364330e-098.687129e-08 0.07326160
Coding_UCSC.bedL2_1 0.014274909-1.159832741.2932375-81.2497487 90.5951520.045083609-2.060879e-077.793727e-07-0.26442796
Coding_UCSC.extend.500.bedL2_1 0.063661781 0.260875290.6081698 4.0978321 9.5531380.739594327-2.838171e-072.453555e-07-1.15675853
Conserved_LindbladToh.bedL2_1 0.025685106-1.177045061.4939418-45.8259765 58.1637400.221462212 4.916699e-076.047812e-07 0.81297161
Conserved_LindbladToh.extend.500.bedL2_1 0.330412425 1.027426111.2243574 3.1095262 3.7055430.530615144-1.646831e-081.045623e-07-0.15749764
CTCF_Hoffman.bedL2_1 0.023866164 1.068609601.3488626 44.7750879 56.5177810.251823777-9.583511e-078.084652e-07-1.18539550
CTCF_Hoffman.extend.500.bedL2_1 0.070835722 0.088612390.8926613 1.2509563 12.6018530.984160888 3.519079e-073.623096e-07 0.97129075
DGF_ENCODE.bedL2_1 0.136005599 1.351481112.4416470 9.9369520 17.9525480.580646689-3.854111e-073.649728e-07-1.05599937
DGF_ENCODE.extend.500.bedL2_1 0.538470287 1.755831121.6600525 3.2607762 3.0829050.376932638-3.918396e-081.560364e-07-0.25112058
DHS_peaks_Trynka.bedL2_1 0.110582858-0.500654772.0605186 -4.5274175 18.6332550.760899555 4.476822e-075.018093e-07 0.89213610
DHS_Trynka.bedL2_1 0.166200566 0.126332102.2134819 0.7601183 13.3181370.985676786 1.581381e-074.687001e-07 0.33739716
DHS_Trynka.extend.500.bedL2_1 0.496042129 3.725812003.2143986 7.5110798 6.4800920.040204361-1.939950e-072.066574e-07-0.93872759
Enhancer_Andersson.bedL2_1 0.004327682 0.112215310.4567090 25.9296573105.5320210.807029332 4.688320e-071.828155e-06 0.25645094
Enhancer_Andersson.extend.500.bedL2_1 0.019035057 1.005041921.0214140 52.7995231 53.6596220.060383832-8.778708e-076.009683e-07-1.46076062
Enhancer_Hoffman.bedL2_1 0.041989150 0.611378540.9749842 14.5603933 23.2199090.527219892-3.583389e-076.041207e-07-0.59315788
Enhancer_Hoffman.extend.500.bedL2_1 0.089845112-0.174046530.9309862 -1.9371842 10.3621240.769208336 1.847844e-073.897959e-07 0.47405434
FetalDHS_Trynka.bedL2_1 0.083930826 1.504355732.2367626 17.9237570 26.6500720.430294212-4.749576e-075.535919e-07-0.85795620
FetalDHS_Trynka.extend.500.bedL2_1 0.283361843 5.246642714.6527998 18.5156994 16.4199940.001455531-4.641738e-072.135105e-07-2.17400899
H3K27ac_Hnisz.bedL2_1 0.389075849-0.305296261.0900756 -0.7846703 2.8017050.369527232 4.713283e-074.404715e-07 1.07005395
H3K27ac_Hnisz.extend.500.bedL2_1 0.420486352 0.660195060.8890565 1.5700749 2.1143530.794592427-5.222487e-074.538670e-07-1.15066462
H3K27ac_PGC2.bedL2_1 0.268777934-0.545946051.5119015 -2.0312160 5.6250950.516382297-8.815856e-083.303672e-07-0.26685023
H3K27ac_PGC2.extend.500.bedL2_1 0.335206459-1.157888291.8251734 -3.4542541 5.4449230.124209818 1.928981e-073.035453e-07 0.63548368
H3K4me1_peaks_Trynka.bedL2_1 0.169822513-1.425913332.3902636 -8.3964917 14.0750690.410911404 2.076593e-073.093751e-07 0.67122194
H3K4me1_Trynka.bedL2_1 0.423684555-2.801252323.4839930 -6.6116461 8.2230820.055231490 4.133936e-072.494190e-07 1.65742591
H3K4me1_Trynka.extend.500.bedL2_1 0.605819103-0.116598751.2302261 -0.1924646 2.0306820.429490841-3.739402e-081.875550e-07-0.19937628
H3K4me3_peaks_Trynka.bedL2_1 0.041648780 0.904073581.3064589 21.7070843 31.3684780.416490598-4.095452e-075.450936e-07-0.75132994
H3K4me3_Trynka.bedL2_1 0.133010544 0.544522111.2381423 4.0938267 9.3086030.718839790-1.435813e-073.453401e-07-0.41576793
H3K4me3_Trynka.extend.500.bedL2_1 0.255139143-0.552329521.4485726 -2.1648169 5.6775790.469349719 1.687930e-072.040657e-07 0.82715030
H3K9ac_peaks_Trynka.bedL2_1 0.038459467 0.792067441.3755193 20.5948624 35.7654270.531889423-4.277423e-076.775994e-07-0.63126133
H3K9ac_Trynka.bedL2_1 0.125412860-0.207758081.1937724 -1.6565931 9.5187400.772120186 2.970226e-073.633842e-07 0.81737893
H3K9ac_Trynka.extend.500.bedL2_1 0.229854798 0.845092141.1147587 3.6766348 4.8498390.550949564-2.506355e-072.394098e-07-1.04688899
Intron_UCSC.bedL2_1 0.387472973 1.725762101.4583891 4.4538903 3.7638470.030089573-2.644772e-061.020937e-06-2.59053355
Intron_UCSC.extend.500.bedL2_1 0.396796495 0.091411480.5307030 0.2303737 1.3374690.523260059 2.660257e-061.018845e-06 2.61105266
PromoterFlanking_Hoffman.bedL2_1 0.008308451 0.994017201.0692759119.6392863128.6973720.068633681-2.278147e-061.286475e-06-1.77084424
PromoterFlanking_Hoffman.extend.500.bedL2_10.033186499-0.089538250.6426716 -2.6980325 19.3654520.849077872 5.112516e-075.380131e-07 0.95025861
Promoter_UCSC.bedL2_1 0.030655951-0.217710750.7111599 -7.1017451 23.1981020.717591766-2.498159e-071.336904e-06-0.18686158
Promoter_UCSC.extend.500.bedL2_1 0.038062732-0.345680740.5493420 -9.0818688 14.4325430.397445275 2.261978e-071.083004e-06 0.20886148
Repressed_Hoffman.bedL2_1 0.460873297 0.858181751.6722179 1.8620774 3.6283680.805148357-5.165899e-091.336541e-07-0.03865126
Repressed_Hoffman.extend.500.bedL2_1 0.718510612 0.259328750.7479248 0.3609254 1.0409380.449589172 1.598825e-071.259217e-07 1.26969798
SuperEnhancer_Hnisz.bedL2_1 0.167209766-0.146099920.5464841 -0.8737523 3.2682550.446199990-1.050684e-061.573363e-06-0.66779486
SuperEnhancer_Hnisz.extend.500.bedL2_1 0.170382974-0.345112980.7335835 -2.0255133 4.3054970.238204568 1.047305e-061.558134e-06 0.67215311
TFBS_ENCODE.bedL2_1 0.131228172-0.651161531.8734420 -4.9620559 14.2762180.634163481 1.600636e-073.415546e-07 0.46863238
TFBS_ENCODE.extend.500.bedL2_1 0.341214519-0.406361761.7752436 -1.1909275 5.2027200.621748867 6.243273e-082.137397e-07 0.29209709
Transcribed_Hoffman.bedL2_1 0.345967789-0.142561511.4149536 -0.4120659 4.0898420.723382532 1.362173e-071.460263e-07 0.93282718
Transcribed_Hoffman.extend.500.bedL2_1 0.762095257 2.889777662.1903393 3.7918851 2.8741020.026656237-2.046861e-071.161856e-07-1.76171720
TSS_Hoffman.bedL2_1 0.017832103-1.166691051.2104825-65.4264429 67.8822100.054700028 1.648471e-061.031988e-06 1.59737423
TSS_Hoffman.extend.500.bedL2_1 0.034353387-0.444042420.8044583-12.9257247 23.4171480.449358487-4.054811e-076.777239e-07-0.59829837
UTR_3_UCSC.bedL2_1 0.011185912-0.658915480.7687616-58.9058348 68.7258720.088497629 1.299741e-067.545520e-07 1.72253362
UTR_3_UCSC.extend.500.bedL2_1 0.026455258 0.067164770.4618806 2.5388060 17.4589340.931018922-6.592648e-074.088299e-07-1.61256510
UTR_5_UCSC.bedL2_1 0.005484168-0.338434180.4328635-61.7111213 78.9296520.280133136 2.998460e-079.873255e-07 0.30369523
UTR_5_UCSC.extend.500.bedL2_1 0.026865078 0.175909620.5330835 6.5478915 19.8429920.757257734-4.763784e-073.763656e-07-1.26573314
WeakEnhancer_Hoffman.bedL2_1 0.020987194-0.181093720.9829489 -8.6287726 46.8356510.829010965-1.684035e-078.499744e-07-0.19812770
WeakEnhancer_Hoffman.extend.500.bedL2_1 0.088786593-1.396639911.7832712-15.7303018 20.0849150.125699755 3.862523e-073.018231e-07 1.27973100
  1. 54
  2. 10
In [52]:
brain <- fread("/scratch/silo1/rameez/ldscore/analysis/Brain_dir/BMI_Brain_V3.results")
(brain); dim(brain)
A data.table: 54 × 10
CategoryProp._SNPsProp._h2Prop._h2_std_errorEnrichmentEnrichment_std_errorEnrichment_pCoefficientCoefficient_std_errorCoefficient_z-score
<chr><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl>
L2_0 0.034137489 1.737011e-012.570200e-02 5.0882791107.528966e-013.509873e-07 7.719293e-082.003062e-08 3.85374721
baseL2_1 1.000000000 1.000000e+003.371086e-08 1.0000000003.371086e-08 NA-1.282026e-088.320037e-09-1.54089020
Coding_UCSC.bedL2_1 0.014274909 1.112935e-012.575637e-02 7.7964405791.804311e+002.585823e-04-2.609581e-085.687326e-08-0.45884141
Coding_UCSC.extend.500.bedL2_1 0.063661781 1.309779e-012.942784e-02 2.0574021844.622529e-012.275814e-02 2.863477e-101.605267e-08 0.01783801
Conserved_LindbladToh.bedL2_1 0.025685106 5.097874e-015.759387e-0219.8475865512.242306e+003.339592e-17 4.462136e-075.057996e-08 8.82194499
Conserved_LindbladToh.extend.500.bedL2_1 0.330412425 5.380943e-016.756744e-02 1.6285533232.044942e-011.628348e-03-2.009626e-089.539231e-09-2.10669614
CTCF_Hoffman.bedL2_1 0.023866164-3.755612e-025.043317e-02-1.5736136892.113166e+002.121497e-01-6.322330e-087.118573e-08-0.88814573
CTCF_Hoffman.extend.500.bedL2_1 0.070835722 3.753585e-034.426154e-02 0.0529899966.248478e-011.334256e-01-1.341173e-083.222909e-08-0.41613734
DGF_ENCODE.bedL2_1 0.136005599 7.527935e-021.175165e-01 0.5535018338.640563e-016.051263e-01-3.361009e-082.828253e-08-1.18836936
DGF_ENCODE.extend.500.bedL2_1 0.538470287 6.828924e-016.584020e-02 1.2682082171.222727e-012.794930e-02-4.647202e-091.276663e-08-0.36401151
DHS_peaks_Trynka.bedL2_1 0.110582858 1.264704e-019.753877e-02 1.1436712918.820424e-018.704843e-01 2.736370e-083.665474e-08 0.74652548
DHS_Trynka.bedL2_1 0.166200566 9.623251e-021.180108e-01 0.5790143227.100505e-015.543209e-01-8.032462e-083.908396e-08-2.05518098
DHS_Trynka.extend.500.bedL2_1 0.496042129 8.845357e-011.260891e-01 1.7831866542.541902e-014.338354e-03 4.152460e-082.427167e-08 1.71082575
Enhancer_Andersson.bedL2_1 0.004327682 2.309516e-041.661088e-02 0.0533661163.838287e+008.051864e-01 1.859866e-091.080266e-07 0.01721674
Enhancer_Andersson.extend.500.bedL2_1 0.019035057-4.148353e-032.506117e-02-0.2179322751.316580e+003.563578e-01-5.353376e-084.246435e-08-1.26067542
Enhancer_Hoffman.bedL2_1 0.041989150 1.755296e-015.241157e-02 4.1803555591.248217e+001.483257e-02 9.736585e-086.028014e-08 1.61522260
Enhancer_Hoffman.extend.500.bedL2_1 0.089845112 1.620008e-014.050467e-02 1.8031120564.508277e-017.378474e-02-4.501406e-083.756534e-08-1.19828705
FetalDHS_Trynka.bedL2_1 0.083930826 7.833460e-028.311579e-02 0.9333233579.902891e-019.462142e-01-3.228196e-083.587311e-08-0.89989306
FetalDHS_Trynka.extend.500.bedL2_1 0.283361843 5.605432e-018.235324e-02 1.9781888772.906292e-011.666628e-03 1.364154e-081.528772e-08 0.89232027
H3K27ac_Hnisz.bedL2_1 0.389075849 5.109179e-013.782923e-02 1.3131575319.722842e-021.347866e-03-3.111627e-092.906788e-08-0.10704694
H3K27ac_Hnisz.extend.500.bedL2_1 0.420486352 5.604768e-013.756253e-02 1.3329251688.933114e-023.244718e-04-2.283950e-092.919281e-08-0.07823672
H3K27ac_PGC2.bedL2_1 0.268777934 4.225144e-015.684544e-02 1.5719831952.114960e-017.205616e-03-1.831969e-082.689094e-08-0.68125877
H3K27ac_PGC2.extend.500.bedL2_1 0.335206459 5.516706e-016.286461e-02 1.6457637741.875400e-011.407241e-03 2.434654e-082.716433e-08 0.89626885
H3K4me1_peaks_Trynka.bedL2_1 0.169822513 3.690054e-011.066312e-01 2.1728888176.278979e-015.126437e-02 1.594400e-082.431336e-08 0.65577141
H3K4me1_Trynka.bedL2_1 0.423684555 6.640103e-018.730146e-02 1.5672281162.060530e-015.448798e-03-4.010390e-092.061281e-08-0.19455813
H3K4me1_Trynka.extend.500.bedL2_1 0.605819103 8.837305e-015.221041e-02 1.4587366538.618151e-021.602337e-06 1.120522e-081.626410e-08 0.68895422
H3K4me3_peaks_Trynka.bedL2_1 0.041648780 1.279867e-014.969608e-02 3.0730001011.193218e+009.340328e-02 1.785837e-084.123033e-08 0.43313684
H3K4me3_Trynka.bedL2_1 0.133010544 2.113338e-015.559525e-02 1.5888497434.179762e-011.534224e-01-1.550326e-082.357962e-08-0.65748562
H3K4me3_Trynka.extend.500.bedL2_1 0.255139143 3.887023e-015.151298e-02 1.5234914612.019015e-018.635816e-03 2.205715e-091.402411e-08 0.15728022
H3K9ac_peaks_Trynka.bedL2_1 0.038459467 1.832330e-015.553365e-02 4.7643140031.443953e+001.293897e-02 8.861741e-084.961087e-08 1.78624990
H3K9ac_Trynka.bedL2_1 0.125412860 1.660851e-016.596654e-02 1.3243069435.259950e-015.342114e-01-7.169069e-083.115971e-08-2.30074945
H3K9ac_Trynka.extend.500.bedL2_1 0.229854798 4.250843e-015.002531e-02 1.8493601422.176388e-011.328616e-04 2.999276e-081.855737e-08 1.61621864
Intron_UCSC.bedL2_1 0.387472973 4.146624e-013.222784e-02 1.0701712218.317441e-023.900029e-01 9.771009e-097.438871e-08 0.13135071
Intron_UCSC.extend.500.bedL2_1 0.396796495 4.868065e-013.034548e-02 1.2268417037.647617e-022.175420e-03-7.265392e-097.414270e-08-0.09799201
PromoterFlanking_Hoffman.bedL2_1 0.008308451 6.824965e-052.365012e-02 0.0082144852.846514e+007.272025e-01-3.172405e-088.312571e-08-0.38163949
PromoterFlanking_Hoffman.extend.500.bedL2_10.033186499 4.486649e-023.309289e-02 1.3519499799.971793e-017.220621e-01-4.538536e-093.785455e-08-0.11989406
Promoter_UCSC.bedL2_1 0.030655951 8.346071e-023.033557e-02 2.7224961279.895490e-017.897038e-02 1.068120e-071.006085e-07 1.06165971
Promoter_UCSC.extend.500.bedL2_1 0.038062732 6.350056e-022.409622e-02 1.6683131696.330660e-012.898825e-01-9.170193e-088.486941e-08-1.08050632
Repressed_Hoffman.bedL2_1 0.460873297 3.001334e-019.902686e-02 0.6512275702.148679e-011.041857e-01-7.585635e-091.230136e-08-0.61665039
Repressed_Hoffman.extend.500.bedL2_1 0.718510612 6.341856e-013.172564e-02 0.8826390914.415473e-027.475432e-03 1.901357e-081.102186e-08 1.72507840
SuperEnhancer_Hnisz.bedL2_1 0.167209766 2.182461e-012.006098e-02 1.3052235641.199749e-011.004277e-02-1.756935e-079.545815e-08-1.84052879
SuperEnhancer_Hnisz.extend.500.bedL2_1 0.170382974 2.462491e-012.233740e-02 1.4452682081.311011e-014.932425e-04 1.693367e-079.479321e-08 1.78638062
TFBS_ENCODE.bedL2_1 0.131228172 3.552747e-018.132474e-02 2.7073049566.197202e-017.368018e-03 6.631032e-082.705368e-08 2.45106454
TFBS_ENCODE.extend.500.bedL2_1 0.341214519 4.356006e-017.107542e-02 1.2766178852.083013e-011.891213e-01-2.462815e-081.412265e-08-1.74387551
Transcribed_Hoffman.bedL2_1 0.345967789 4.670378e-018.060897e-02 1.3499460062.329956e-011.258065e-01 1.018508e-081.029883e-08 0.98895577
Transcribed_Hoffman.extend.500.bedL2_1 0.762095257 7.741639e-015.114126e-02 1.0158361966.710612e-028.131948e-01 4.506901e-108.998866e-09 0.05008299
TSS_Hoffman.bedL2_1 0.017832103 5.101712e-022.959412e-02 2.8609704021.659598e+002.628152e-01-3.251112e-087.821692e-08-0.41565330
TSS_Hoffman.extend.500.bedL2_1 0.034353387 1.004237e-012.972526e-02 2.9232546098.652788e-012.998085e-02 3.847243e-085.463720e-08 0.70414338
UTR_3_UCSC.bedL2_1 0.011185912 6.360952e-022.203361e-02 5.6865744471.969764e+001.601510e-02 1.215887e-077.623692e-08 1.59487947
UTR_3_UCSC.extend.500.bedL2_1 0.026455258 5.594310e-022.125118e-02 2.1146307048.032877e-011.666563e-01-4.655002e-083.092685e-08-1.50516527
UTR_5_UCSC.bedL2_1 0.005484168 4.150979e-021.685567e-02 7.5690216093.073514e+003.362468e-02 1.056191e-077.722756e-08 1.36763448
UTR_5_UCSC.extend.500.bedL2_1 0.026865078 5.475160e-022.120869e-02 2.0380211067.894521e-011.904655e-01-2.903837e-082.206875e-08-1.31581404
WeakEnhancer_Hoffman.bedL2_1 0.020987194 1.150879e-014.191084e-02 5.4837221481.996972e+002.078174e-02 8.949748e-085.555126e-08 1.61107925
WeakEnhancer_Hoffman.extend.500.bedL2_1 0.088786593 2.252828e-014.583468e-02 2.5373511935.162343e-014.056402e-03 9.679550e-092.290687e-08 0.42256102
  1. 54
  2. 10
In [ ]:

List of Variable and memory space

In [45]:
var_mem <- NULL
var_name <- NULL
for (i in 1:length(ls())){
    var_mem[i] <- object.size(get(ls()[i]))
    var_name[i] <- ls()[i]
}
In [46]:
var_mem_dat <- cbind(var_name,var_mem)
var_mem_dat <- as.data.frame(var_mem_dat)
var_mem_dat$var_mem <- as.numeric(var_mem_dat$var_mem)
var_mem_dat$megabytes <- (var_mem_dat$var_mem/1000000)
var_mem_dat$gigabytes <- (var_mem_dat$var_mem/1e+9)
(var_mem_dat)
A data.frame: 12 × 4
var_namevar_memmegabytesgigabytes
<chr><dbl><dbl><dbl>
gene_37 14451552 14.4515520.014451552
gene_37_J_list_withdrawal 229208 0.2292080.000229208
grch37 538320 0.5383200.000538320
i 56 0.0000560.000000056
J_list_withdrawal 63248 0.0632480.000063248
J_list_withdrawal_ENSG 291328 0.2913280.000291328
Jason_list 988000 0.9880000.000988000
rs 572481656 572.4816560.572481656
sum_stat_ea 948584016 948.5840160.948584016
sum_stat_ea_rs 62154242966215.4242966.215424296
sum_stat_ea_rs_sub 887453720 887.4537200.887453720
var_mem 176 0.0001760.000000176
In [50]:
rm(list=ls())
In [62]:
73.302^2 - ( (1-(73.302^2))/(500-2) )
5383.9707204739
In [64]:
!plink --help
Error in eval(expr, envir, enclos): object 'plink' not found
Traceback:
In [ ]:
C:\Users\ramee\Downloads
In [70]:
dat <- fread("/projects/bga_lab/Rameez/Code/results2 (4).results")
head(dat); dim(dat)
A data.table: 6 × 10
<form action='analysis_result.php' method='get'>Job IDs: <input type='text' name='result' /><input type='submit' /></form><h1>File Exists</h1>CategoryProp._SNPsProp._h2Prop._h2_std_errorEnrichmentEnrichment_std_errorEnrichment_pCoefficientCoefficient_std_errorCoefficient_z-score
<chr><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl>
L2_0 0.034137490.128136462.535894e-02 3.75354087.428473e-013.461345e-04 4.938847e-081.997051e-08 2.47307019
baseL2_1 1.000000001.000000001.865243e-08 1.00000001.865243e-08 NA-2.825588e-089.505805e-09-2.97248669
Coding_UCSCL2_1 0.014259140.082640182.287216e-02 5.79559351.604035e+003.095458e-03 4.099255e-086.481691e-08 0.63243595
Coding_UCSC.flanking.500L2_1 0.049362880.029119732.895465e-02 0.58991145.865671e-014.839929e-01-1.645362e-081.873594e-08-0.87818506
Conserved_LindbladTohL2_1 0.024670540.275650494.698554e-0211.17326611.904520e+001.027905e-07 2.118124e-091.143017e-07 0.01853099
Conserved_LindbladToh.flanking.500L2_10.305531360.188811487.180601e-02 0.61797742.350201e-011.014975e-01-1.106304e-081.043248e-08-1.06044188
  1. 98
  2. 10
In [ ]: