Skip to content

Commit

Permalink
Sigma_beta optimization and rerun
Browse files Browse the repository at this point in the history
  • Loading branch information
banskt committed Feb 9, 2020
1 parent 6118451 commit e0a3552
Show file tree
Hide file tree
Showing 69 changed files with 1,966 additions and 544 deletions.
26 changes: 11 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,21 @@
jobsubs
.ipynb_checkpoints
__pycache__
analysis/jupyter/cardiogenics_mono_macro
analysis/jupyter/*.pkl
main/archive
analysis/jupyter/archive
preprocess/gtex/archive
*.pkl
analysis/external/DHS_Index_and_Vocabulary_hg38_WM20190703.txt*
analysis/external/multi-tissue.master.ntypes.simple.hg19*
analysis/external/multi-tissue.master.ntypes.simple.hg38_hglft_genome_620db_fada10*
analysis/external/multi-tissue.master.ntypes.simple.*
analysis/external/human_protein_coding_genes_gencode_v26.txt
analysis/external/tissue_specific_TFs
main/tissue_table.txt
main/01a_resubmit_tejaas_rand.sh
main/00b_copy_expression.sh
main/tmp_postprocess
analysis/external/segway_encyclopedia
analysis/external/roadmap_chromhmm
analysis/plots
preprocess/gtex/slurmfiles/add_DSentry_*
analysis/cis-eGene_biotype_enrichment
analysis/cre_enrichment
analysis/dhs_enrichment
analysis/distance_from_pcgenes
analysis/distance_from_transcription_factor
analysis/cre_enrichment
analysis/external/human_protein_coding_genes_gencode_v26.txt
analysis/external/segway_encyclopedia
analysis/external/roadmap_chromhmm
analysis/roadmap*
analysis/segway_with_lines_01.txt
analysis/gencode_annotation_enrichment
analysis/tfdist_enrichment_wrt_genes.py
10 changes: 9 additions & 1 deletion analysis/cre_enrichment_tissue_specific_chromhmm_withpval.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ def parse_args():
metavar='DIR',
help='name of the result directory')


parser.add_argument('--resfile',
type=str,
dest='resfile',
metavar='FILE',
help='name of the result file (without directory path)')

parser.add_argument('--match',
type=str,
dest='matchfile',
Expand Down Expand Up @@ -209,6 +216,7 @@ def empr_overlap(rand_dicts, dhsdir, eidlist, labeldict, outdir):
if __name__ == '__main__':
opts = parse_args()
resdir = opts.resdir
resfile = opts.resfile
dhsdir = opts.dhsdir
matchfile = opts.matchfile
eidfile = opts.eidfile
Expand All @@ -222,7 +230,7 @@ def empr_overlap(rand_dicts, dhsdir, eidlist, labeldict, outdir):

tissue = opts.tissuename

resfilename = os.path.join(resdir, tissue, 'trans_eqtls.txt')
resfilename = os.path.join(resdir, tissue, resfile)
print("Reading trans-eQTL results.")
transeqtls = read_tejaas_results.transeqtls(resfilename)
nteqtl = len(transeqtls)
Expand Down
11 changes: 11 additions & 0 deletions analysis/dhs_enrichment.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,23 @@ def generate_empirical_dhs_enrichment(dirname, dhs_file, dhs_frac_rand):
print(f'Fraction of DHS overlap for randomly selected SNPs: {dhs_frac_rand :7.4f}')
enrichment_rand = generate_empirical_dhs_enrichment(random_snp_dir, dhsfile, dhs_frac_rand)

#import pickle
##filehandler = open('dhs_frac_rand.pkl', 'wb')
##pickle.dump(dhs_frac_rand, filehandler)
##print(dhs_frac_rand)
##filehandler = open('enrichment_rand.pkl', 'wb')
##pickle.dump(enrichment_rand, filehandler)
#dhs_frac_rand = pickle.load( open( "dhs_frac_rand.pkl", "rb" ) )
#enrichment_rand = pickle.load( open( "enrichment_rand.pkl", "rb" ) )
#print(f'Fraction of DHS overlap for randomly selected SNPs: {dhs_frac_rand :7.4f}')

fout = open(outfile, 'w')
fout.write(f'TISSUE\tN_TRANSEQTLS\tDHS_FRAC\tENRICHMENT\tP_VALUE\n')

for tissue in tissuelist:

resfilename = os.path.join(resdir, tissue, 'trans_eqtls.txt')
#resfilename = os.path.join(resdir, tissue, 'trans_eqtls_mod_ld1.txt')
transeqtls = read_tejaas_results.transeqtls(resfilename)
print(f'{tissue}: {len(transeqtls)} trans-eQTLs')
nteqtl = len(transeqtls)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
},
{
"cell_type": "code",
"execution_count": 209,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -1138,7 +1138,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.7.5"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion analysis/jupyter/archive/MWE_knn.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"#plt.switch_backend('agg')\n",
"import matplotlib\n",
"import sys\n",
"sys.path.append('../')\n",
"sys.path.append('../../')\n",
"from utils import mpl_stylesheet\n",
"mpl_stylesheet.banskt_presentation(fontfamily = 'latex-clearsans', fontsize = 18, colors = 'banskt', dpi = 72)"
]
Expand Down
2 changes: 1 addition & 1 deletion analysis/jupyter/archive/check_Qmean_Qstd.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.7.5"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.7.5"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.7.5"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion analysis/jupyter/archive/norm_is_the_problem.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.7.5"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.7.5"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion analysis/jupyter/distance_from_human_TFs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.7.5"
}
},
"nbformat": 4,
Expand Down

Large diffs are not rendered by default.

78 changes: 62 additions & 16 deletions analysis/jupyter/manhattan_plot.ipynb

Large diffs are not rendered by default.

202 changes: 202 additions & 0 deletions analysis/jupyter/plot_Qscore_vs_pvalue.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions analysis/jupyter/plot_cistf_enrichment.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
" ax1.text(xpos, ypos, f'{significance[i]}', ha='left', va='center')\n",
"\n",
"fig.canvas.draw()\n",
"xticklabels = [f'{x.get_position()[0] + 1 :3.1f}' for x in ax1.get_xticklabels()]\n",
"xticklabels = [f'{x.get_position()[0]:3.1f}' for x in ax1.get_xticklabels()]\n",
"ax1.set_xticklabels(xticklabels)\n",
"\n",
"#plt.savefig(outfile, bbox_inches='tight')\n",
Expand Down Expand Up @@ -205,7 +205,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.7.5"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion analysis/jupyter/plot_dhs_enrichment.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.7.5"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.7.5"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion analysis/jupyter/plot_numbers_only.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.7.5"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion analysis/jupyter/plot_tissue_specific_cre.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.7.5"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion analysis/jupyter/plot_transeqtls_overlap.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.7.5"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit e0a3552

Please sign in to comment.