-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2837ae5
commit b9d29a6
Showing
12 changed files
with
293 additions
and
33 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
python run_train_test_making_bias.py | ||
python run_conversion_bias.py | ||
|
67 changes: 67 additions & 0 deletions
67
upload_jsons/upload_scripts/dnase_run_train_test_making_bias.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import pandas as pd | ||
import os | ||
|
||
#model_atac = pd.read_csv("/mnt/lab_data2/anusri/chrombpnet/logs/checkpoint/JAN_02_2023/model_dir_atac.csv",sep=",", header=None) | ||
#model_atac = pd.read_csv("/mnt/lab_data2/anusri/chrombpnet/logs/checkpoint/JAN_02_2023/model_dir_dnase.csv",sep=",", header=None) | ||
#model_atac=pd.read_csv("bias_models_atlas.csv", sep=',', header=None) | ||
model_atac=pd.read_csv("model_dir_dnase_v2.1_bias.csv", sep=',', header=None) | ||
|
||
|
||
|
||
|
||
encode_id = {"K562": "ENCSR868FGK", | ||
"GM12878": "ENCSR637XSC", | ||
"HEPG2": "ENCSR291GJU", | ||
"IMR90": "ENCSR200OML", | ||
"H1ESC": "ENCDUMMY"} | ||
|
||
encode_id = {"K562": "ENCSR000EOT", | ||
"GM12878": "ENCSR000EMT", | ||
"HEPG2": "ENCSR149XIL", | ||
"IMR90": "ENCSR477RTP", | ||
"H1ESC": "ENCSR000EMU"} | ||
|
||
|
||
for i,r in model_atac.iterrows(): | ||
fold = r[0] | ||
name = r[1] | ||
model_path = r[2] | ||
|
||
#input_peaks=os.path.join(model_path,"chrombpnet_model/filtered.peaks.bed") | ||
input_nonpeaks=os.path.join(model_path,"bias_model/filtered.bias_nonpeaks.bed") | ||
#test_nonpeaks="/oak/stanford/groups/akundaje/projects/chromatin-atlas-2022/DNASE/"+encode_id[name]+"/negatives_data/test/test."+fold+".filtered.negatives_with_summit.bed" | ||
fold="/mnt/lab_data2/anusri/chrombpnet/splits/"+fold+".json" | ||
output_path=os.path.join(model_path,"train_test_regions_bias_may_7_2024/") | ||
|
||
if not os.path.isfile(input_nonpeaks): | ||
cellline=input_nonpeaks.split("/")[10] | ||
biasth=input_nonpeaks.split("/")[11].split("_")[6] | ||
foldn=input_nonpeaks.split("/")[11].split("_")[8] | ||
#print(cellline,biasth,foldn) | ||
if cellline in ["K562", "HEPG2"]: | ||
ddatype="DNASE_PE" | ||
elif cellline in ["H1ESC"]: | ||
ddatype="DNASE_SE" | ||
else: | ||
print(cellline) | ||
break | ||
outputdir=os.path.join(model_path,"bias_model/newgen/") | ||
if not os.path.isfile(os.path.join(model_path,"bias_model/newgen/filtered.bias_nonpeaks.bed")): | ||
os.makedirs(outputdir, exist_ok=True) | ||
print(outputdir) | ||
command = "bash make_missing_bed_regions.sh "+cellline+" "+biasth+" "+foldn+" "+outputdir+" "+ddatype | ||
os.system(command) | ||
print(command) | ||
input_nonpeaks=os.path.join(model_path,"bias_model/newgen/filtered.bias_nonpeaks.bed") | ||
else: | ||
input_nonpeaks=os.path.join(model_path,"bias_model/newgen/filtered.bias_nonpeaks.bed") | ||
|
||
if not os.path.isfile(output_path+"nonpeaks.validationset.bed.gz"): | ||
print(output_path) | ||
os.makedirs(output_path, exist_ok=True) | ||
command=["python get_train_test_regions_bias.py "]+["-inp"]+[input_nonpeaks]+["-f"]+[fold]+["-o"]+[output_path] | ||
command = " ".join(command) | ||
print(command) | ||
os.system(command) | ||
else: | ||
print(output_path) |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
cellline=$1 | ||
biasth=$2 | ||
foldn=$3 | ||
outputdir=$4 | ||
ddatype=$5 | ||
echo "python /mnt/lab_data2/anusri/chrombpnet/src/helpers/hyperparameters/find_bias_hyperparams.py \\ | ||
--genome=/mnt/lab_data2/anusri/chrombpnet/reference/hg38.genome.fa \\ | ||
--bigwig=/mnt/lab_data2/anusri/chrombpnet/results/chrombpnet/$ddatype/$cellline/data/$cellline"_unstranded.bw" \\ | ||
--peaks=/mnt/lab_data2/anusri/chrombpnet/results/chrombpnet/$ddatype/$cellline/data/peaks_no_blacklist.bed \\ | ||
--nonpeaks=/mnt/lab_data2/anusri/chrombpnet/results/chrombpnet/$ddatype/$cellline/negatives_data_$foldn/negatives_with_summit.be> | ||
--outlier_threshold=0.99 \\ | ||
--chr_fold_path=/mnt/lab_data2/anusri/chrombpnet/splits/fold_$foldn.json \\ | ||
--inputlen=2114 \\ | ||
--outputlen=1000 \\ | ||
--max_jitter=0 \\ | ||
--filters=128 \\ | ||
--n_dilation_layers=4 \\ | ||
--bias_threshold_factor=$biasth \\ | ||
--output_dir $outputdir" | ||
|
||
python /mnt/lab_data2/anusri/chrombpnet/src/helpers/hyperparameters/find_bias_hyperparams.py \ | ||
--genome=/mnt/lab_data2/anusri/chrombpnet/reference/hg38.genome.fa \ | ||
--bigwig=/mnt/lab_data2/anusri/chrombpnet/results/chrombpnet/$ddatype/$cellline/data/$cellline"_unstranded.bw" \ | ||
--peaks=/mnt/lab_data2/anusri/chrombpnet/results/chrombpnet/$ddatype/$cellline/data/peaks_no_blacklist.bed \ | ||
--nonpeaks=/mnt/lab_data2/anusri/chrombpnet/results/chrombpnet/$ddatype/$cellline/negatives_data_$foldn/negatives_with_summit.bed \ | ||
--outlier_threshold=0.99 \ | ||
--chr_fold_path=/mnt/lab_data2/anusri/chrombpnet/splits/fold_$foldn.json \ | ||
--inputlen=2114 \ | ||
--outputlen=1000 \ | ||
--max_jitter=0 \ | ||
--filters=128 \ | ||
--n_dilation_layers=4 \ | ||
--bias_threshold_factor=$biasth \ | ||
--output_dir $outputdir | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
fold_0,K562,/mnt/lab_data2/anusri/chrombpnet/results/chrombpnet/DNASE_PE/K562/nautilus_runs_may18/K562_05.13.2022_bias_128_4_1234_0.5_fold_0/ | ||
fold_1,K562,/oak/stanford/groups/akundaje/projects/chromatin-atlas-2022/chrombpnet/folds/DNASE/K562/K562_07.17.2022_bias_128_4_1234_0.4_fold_1_data_type_DNASE_PE/ | ||
fold_2,K562,/oak/stanford/groups/akundaje/projects/chromatin-atlas-2022/chrombpnet/folds/DNASE/K562/K562_07.07.2022_bias_128_4_1234_0.5_fold_2_data_type_DNASE_PE/ | ||
fold_3,K562,/oak/stanford/groups/akundaje/projects/chromatin-atlas-2022/chrombpnet/folds/DNASE/K562/K562_07.07.2022_bias_128_4_1234_0.5_fold_3_data_type_DNASE_PE/ | ||
fold_4,K562,/oak/stanford/groups/akundaje/projects/chromatin-atlas-2022/chrombpnet/folds/DNASE/K562/K562_07.07.2022_bias_128_4_1234_0.5_fold_4_data_type_DNASE_PE/ | ||
fold_0,HEPG2,/mnt/lab_data2/anusri/chrombpnet/results/chrombpnet/DNASE_PE/HEPG2/copy_HEPG2_06.08.2022_bias_128_4_1234_0.8_fold_0/ | ||
fold_1,HEPG2,/oak/stanford/groups/akundaje/projects/chromatin-atlas-2022/chrombpnet/folds/DNASE/HEPG2/HEPG2_07.13.2022_bias_128_4_1234_0.8_fold_1_data_type_DNASE_PE/ | ||
fold_2,HEPG2,/oak/stanford/groups/akundaje/projects/chromatin-atlas-2022/chrombpnet/folds/DNASE/HEPG2/HEPG2_07.07.2022_bias_128_4_1234_0.8_fold_2_data_type_DNASE_PE/ | ||
fold_3,HEPG2,/oak/stanford/groups/akundaje/projects/chromatin-atlas-2022/chrombpnet/folds/DNASE/HEPG2/HEPG2_07.07.2022_bias_128_4_1234_0.8_fold_3_data_type_DNASE_PE/ | ||
fold_4,HEPG2,/oak/stanford/groups/akundaje/projects/chromatin-atlas-2022/chrombpnet/folds/DNASE/HEPG2/HEPG2_07.07.2022_bias_128_4_1234_0.8_fold_4_data_type_DNASE_PE/ | ||
fold_0,H1ESC,/mnt/lab_data2/anusri/chrombpnet/results/chrombpnet/DNASE_SE/H1ESC/nautilus_runs_apr12/H1ESC_04.09.2022_bias_128_4_1234_0.8_fold_0/ | ||
fold_1,H1ESC,/oak/stanford/groups/akundaje/projects/chromatin-atlas-2022/chrombpnet/folds/DNASE/H1ESC/H1ESC_07.07.2022_bias_128_4_1234_0.8_fold_1_data_type_DNASE_SE/ | ||
fold_2,H1ESC,/oak/stanford/groups/akundaje/projects/chromatin-atlas-2022/chrombpnet/folds/DNASE/H1ESC/H1ESC_07.07.2022_bias_128_4_1234_0.8_fold_2_data_type_DNASE_SE/ | ||
fold_3,H1ESC,/oak/stanford/groups/akundaje/projects/chromatin-atlas-2022/chrombpnet/folds/DNASE/H1ESC/H1ESC_07.07.2022_bias_128_4_1234_0.8_fold_3_data_type_DNASE_SE/ | ||
fold_4,H1ESC,/oak/stanford/groups/akundaje/projects/chromatin-atlas-2022/chrombpnet/folds/DNASE/H1ESC/H1ESC_07.07.2022_bias_128_4_1234_0.8_fold_4_data_type_DNASE_SE/ | ||
|
||
|
||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import pandas as pd | ||
import os | ||
|
||
#model_atac = pd.read_csv("/mnt/lab_data2/anusri/chrombpnet/logs/checkpoint/JAN_02_2023/model_dir_atac.csv",sep=",", header=None) | ||
#model_atac = pd.read_csv("/mnt/lab_data2/anusri/chrombpnet/logs/checkpoint/JAN_02_2023/model_dir_dnase.csv",sep=",", header=None) | ||
model_atac = pd.read_csv("/mnt/lab_data2/anusri/chrombpnet/logs/checkpoint/JAN_02_2023/v1/model_dir_dnase_v2.2.csv",sep=",",header=None) | ||
|
||
#encode_id = {"K562": "ENCSR868FGK", | ||
# "GM12878": "ENCSR637XSC", | ||
# "HEPG2": "ENCSR291GJU", | ||
# "IMR90": "ENCSR200OML", | ||
# "H1ESC": "ENCDUMMY"} | ||
|
||
encode_id = {"K562": "ENCSR000EOT", | ||
"GM12878": "ENCSR000EMT", | ||
"HEPG2": "ENCSR149XIL", | ||
"IMR90": "ENCSR477RTP", | ||
"H1ESC": "ENCSR000EMU"} | ||
|
||
|
||
for i,r in model_atac.iterrows(): | ||
fold = r[0] | ||
name = r[1] | ||
model_path = r[2] | ||
|
||
input_peaks=os.path.join(model_path,"filtered.peaks.bed") | ||
input_nonpeaks=os.path.join(model_path,"filtered.nonpeaks.bed") | ||
test_nonpeaks="/oak/stanford/groups/akundaje/projects/chromatin-atlas-2022/ATAC/"+encode_id[name]+"/negatives_data/test/test."+fold+".filtered.negatives_with_summit.bed" | ||
fold="/mnt/lab_data2/anusri/chrombpnet/splits/"+fold+".json" | ||
output_path=os.path.join(model_path,"train_test_regions_may_7_2024/") | ||
|
||
if not os.path.isfile(output_path+"nonpeaks.validationset.bed.gz"): | ||
os.makedirs(output_path, exist_ok=True) | ||
command=["python get_train_test_regions.py -ip"]+[input_peaks]+["-inp"]+[input_nonpeaks]+["-inpt"]+[test_nonpeaks]+["-f"]+[fold]+["-o"]+[output_path] | ||
command = " ".join(command) | ||
print(command) | ||
os.system(command) | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,46 @@ | ||
import pandas as pd | ||
import os | ||
|
||
model_atac = pd.read_csv("/mnt/lab_data2/anusri/chrombpnet/logs/checkpoint/JAN_02_2023/model_dir_atac.csv",sep=",",header=None) | ||
#model_atac = pd.read_csv("/mnt/lab_data2/anusri/chrombpnet/logs/checkpoint/JAN_02_2023/model_dir_atac.csv",sep=",",header=None) | ||
#model_atac = pd.read_csv("/mnt/lab_data2/anusri/chrombpnet/logs/checkpoint/JAN_02_2023/model_dir_dnase.csv",sep=",",header=None) | ||
#model_atac = pd.read_csv("/mnt/lab_data2/anusri/chrombpnet/logs/checkpoint/JAN_02_2023/v1/model_dir_dnase_v2.1.csv",sep=",",header=None) | ||
#model_atac = pd.read_csv("/mnt/lab_data2/anusri/chrombpnet/logs/checkpoint/JAN_02_2023/v1/model_dir_subsample_atac.csv",sep=",",header=None) | ||
model_atac = pd.read_csv("/mnt/lab_data2/anusri/chrombpnet/upload_jsons/upload_scripts/model_dir_dnase_v2.1_bias.csv", sep=",", header=None) | ||
|
||
|
||
|
||
for i,r in model_atac.iterrows(): | ||
fold = r[0] | ||
name = r[1] | ||
#model_path = r[3] | ||
model_path = r[2] | ||
|
||
input_path=os.path.join(model_path,"chrombpnet_model/chrombpnet.h5") | ||
output_path=os.path.join(model_path,"chrombpnet_model/new_model_formats/chrombpnet") | ||
output_path=os.path.join(model_path,"chrombpnet_model/new_model_formats_may_7_24/chrombpnet") | ||
output_dir=os.path.join(model_path,"chrombpnet_model/new_model_formats_may_7_24/") | ||
print(output_path) | ||
if not os.path.isfile(output_path+".tar"): | ||
|
||
os.makedirs(os.path.join(model_path,"chrombpnet_model/new_model_formats/"), exist_ok=True) | ||
command = "CUDA_VISIBLE_DEVICES=5 python get_new_tf_model_format.py -i "+input_path+" -o "+output_path | ||
os.makedirs(os.path.join(model_path,"chrombpnet_model/new_model_formats_may_7_24/"), exist_ok=True) | ||
command = "CUDA_VISIBLE_DEVICES=1 python get_new_tf_model_format.py -i "+input_path+" -o "+output_dir+" -f chrombpnet" | ||
print(command) | ||
os.system(command) | ||
|
||
input_path=os.path.join(model_path,"chrombpnet_model/chrombpnet_wo_bias.h5") | ||
output_path=os.path.join(model_path,"chrombpnet_model/new_model_formats/chrombpnet_wo_bias") | ||
output_path=os.path.join(model_path,"chrombpnet_model/new_model_formats_may_7_24/chrombpnet_wo_bias") | ||
|
||
if not os.path.isfile(output_path+".tar"): | ||
os.makedirs(os.path.join(model_path,"chrombpnet_model/new_model_formats/"), exist_ok=True) | ||
command = "CUDA_VISIBLE_DEVICES=5 python get_new_tf_model_format.py -i "+input_path+" -o "+output_path | ||
os.makedirs(os.path.join(model_path,"chrombpnet_model/new_model_formats_may_7_24/"), exist_ok=True) | ||
command = "CUDA_VISIBLE_DEVICES=1 python get_new_tf_model_format.py -i "+input_path+" -o "+output_dir+" -f chrombpnet_wo_bias" | ||
print(command) | ||
os.system(command) | ||
|
||
input_path=os.path.join(model_path,"chrombpnet_model/bias_model_scaled.h5") | ||
output_path=os.path.join(model_path,"chrombpnet_model/new_model_formats/bias_model_scaled") | ||
output_path=os.path.join(model_path,"chrombpnet_model/new_model_formats_may_7_24/bias_model_scaled") | ||
|
||
if not os.path.isfile(output_path+".tar"): | ||
os.makedirs(os.path.join(model_path,"chrombpnet_model/new_model_formats/"), exist_ok=True) | ||
command = "CUDA_VISIBLE_DEVICES=5 python get_new_tf_model_format.py -i "+input_path+" -o "+output_path | ||
os.makedirs(os.path.join(model_path,"chrombpnet_model/new_model_formats_may_7_24/"), exist_ok=True) | ||
command = "CUDA_VISIBLE_DEVICES=1 python get_new_tf_model_format.py -i "+input_path+" -o "+output_dir+" -f bias_model_scaled" | ||
print(command) | ||
os.system(command) | ||
|
||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import pandas as pd | ||
import os | ||
|
||
#model_atac = pd.read_csv("/mnt/lab_data2/anusri/chrombpnet/logs/checkpoint/JAN_02_2023/model_dir_atac.csv",sep=",",header=None) | ||
#model_atac = pd.read_csv("/mnt/lab_data2/anusri/chrombpnet/logs/checkpoint/JAN_02_2023/model_dir_dnase.csv",sep=",",header=None) | ||
|
||
#model_atac = pd.read_csv("/mnt/lab_data2/anusri/chrombpnet/logs/checkpoint/JAN_02_2023/v1/model_dir_dnase_v2.2.csv",sep=",",header=None) | ||
model_atac = pd.read_csv("/mnt/lab_data2/anusri/chrombpnet/upload_jsons/upload_scripts/model_dir_dnase_v2.1_bias.csv", sep=",", header=None) | ||
|
||
for i,r in model_atac.iterrows(): | ||
fold = r[0] | ||
name = r[1] | ||
model_path = r[2] | ||
#input_path=os.path.join(model_path,"new_model_formats_may_7_24/chrombpnet/") | ||
#input_path=os.path.join(model_path,"chrombpnet/") | ||
input_path=os.path.join(model_path,"chrombpnet_model/chrombpnet.h5") | ||
|
||
output_path=os.path.join(model_path,"new_model_formats_may_7_24_vf/chrombpnet") | ||
output_dir=os.path.join(model_path,"new_model_formats_may_7_24_vf/") | ||
print(output_path) | ||
if not os.path.isfile(output_path+".tar"): | ||
|
||
os.makedirs(os.path.join(model_path,"new_model_formats_may_7_24_vf/"), exist_ok=True) | ||
command = "CUDA_VISIBLE_DEVICES=1 python get_new_tf_model_format.py -i "+input_path+" -o "+output_dir+" -f chrombpnet" | ||
print(command) | ||
os.system(command) | ||
|
||
#input_path=os.path.join(model_path,"chrombpnet_wo_bias.h5") | ||
input_path=os.path.join(model_path,"chrombpnet_model/chrombpnet_wo_bias.h5") | ||
|
||
output_path=os.path.join(model_path,"new_model_formats_may_7_24_vf/chrombpnet_wo_bias") | ||
|
||
if not os.path.isfile(output_path+".tar"): | ||
os.makedirs(os.path.join(model_path,"new_model_formats_may_7_24_vf/"), exist_ok=True) | ||
command = "CUDA_VISIBLE_DEVICES=1 python get_new_tf_model_format.py -i "+input_path+" -o "+output_dir+" -f chrombpnet_wo_bias" | ||
print(command) | ||
os.system(command) | ||
|
||
#input_path=os.path.join(model_path,"bias_model_scaled.h5") | ||
input_path=os.path.join(model_path,"chrombpnet_model/bias_model_scaled.h5") | ||
|
||
output_path=os.path.join(model_path,"new_model_formats_may_7_24_vf/bias_model_scaled") | ||
|
||
if not os.path.isfile(output_path+".tar"): | ||
os.makedirs(os.path.join(model_path,"new_model_formats_may_7_24_vf/"), exist_ok=True) | ||
command = "CUDA_VISIBLE_DEVICES=1 python get_new_tf_model_format.py -i "+input_path+" -o "+output_dir+" -f bias_model_scaled" | ||
print(command) | ||
os.system(command) | ||
|
||
|
Oops, something went wrong.