Skip to content

Commit

Permalink
interpretation on counts for krist testing
Browse files Browse the repository at this point in the history
  • Loading branch information
panushri25 committed Jan 19, 2022
1 parent 962c896 commit 9a87c1a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
1 change: 1 addition & 0 deletions sherlock/interpret_counts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ fi
cd chrombpnet
echo $( timestamp ): "python $PWD/src/evaluation/interpret/interpret.py --genome=$reference_fasta --regions=$regions --output_prefix=$output_prefix --model_h5=$model_h5 --profile_or_counts counts" | tee -a $logfile
python $PWD/src/evaluation/interpret/interpret.py --genome=$reference_fasta --regions=$regions --output_prefix=$output_prefix --model_h5=$model_h5 --profile_or_counts counts

10 changes: 5 additions & 5 deletions sherlock/run_atac.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@
bias_model="/scratch/groups/akundaje/anusri/chromatin_atlas/reference/bias.h5"

# choose the cet of accessions to run
#encode_ids = [line.strip() for line in open("atac_files/cell_type.txt").readlines()]
encode_ids = [line.strip() for line in open("atac_files/cell_type.txt").readlines()]
#encode_ids = [line.strip() for line in open("tissue_type.txt").readlines()]
#encode_ids = [line.strip() for line in open("atac_files/primary_cell_accession.txt").readlines()]
encode_ids = [line.strip() for line in open("atac_files/invitro_accession.tsv").readlines()]
#encode_ids = [line.strip() for line in open("atac_files/invitro_accession.tsv").readlines()]

done = []
undone = []

# only 50 GPU jobs allowed on sherlock so limit this array - an run in batches of 50
for encode_id in encode_ids:
for encode_id in encode_ids[0:1]:
if encode_id in done:
continue
if encode_id in undone:
continue
print(output_dir+"/"+encode_id)
#command = "bash start_preprocessing.sh " + encode_id + " " + output_dir + " " + metadata_tsv + " " + oak_dir
#command = "bash start_gc_matching.sh " + encode_id + " " + output_dir + " " + metadata_tsv + " " + oak_dir
command = "bash start_modeling.sh " + encode_id + " " + output_dir + " " + metadata_tsv + " " + oak_dir + " " + bias_model
#command = "bash start_modeling.sh " + encode_id + " " + output_dir + " " + metadata_tsv + " " + oak_dir + " " + bias_model
#command = "bash start_interpretation.sh " + encode_id + " " + output_dir + " " + metadata_tsv + " " + oak_dir
#command = "bash start_modisco.sh " + encode_id + " " + output_dir + " " + metadata_tsv + " " + oak_modisco_dir
#command = "bash start_interpretation_counts.sh " + encode_id + " " + output_dir + " " + metadata_tsv + " " + oak_dir
command = "bash start_interpretation_counts.sh " + encode_id + " " + output_dir + " " + metadata_tsv + " " + oak_dir
print(command)
os.system(command)
3 changes: 2 additions & 1 deletion sherlock/run_interpretation_counts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ oak_dir=$3

reference_fasta=/scratch/groups/akundaje/anusri/chromatin_atlas/reference/hg38.genome.fa
singularity exec --nv /home/groups/akundaje/anusri/simg/tf-atlas_gcp-modeling.sif nvidia-smi
singularity exec --nv /home/groups/akundaje/anusri/simg/tf-atlas_gcp-modeling.sif bash interpret_counts.sh $reference_fasta $dir/preprocessing/downloads/peaks_no_blacklist.bed.gz $dir/interpret_counts_full/$experiment $dir/chrombpnet_model/chrombpnet_wo_bias.h5
#singularity exec --nv /home/groups/akundaje/anusri/simg/tf-atlas_gcp-modeling.sif bash interpret_counts.sh $reference_fasta $dir/preprocessing/downloads/peaks_no_blacklist.bed.gz $dir/interpret_counts_full/$experiment $dir/chrombpnet_model/chrombpnet_wo_bias.h5
singularity exec --nv /home/groups/akundaje/anusri/simg/tf-atlas_gcp-modeling.sif bash interpret_counts.sh $reference_fasta $dir/preprocessing/downloads/testing.bed $dir/interpret_counts_full/$experiment $dir/chrombpnet_model/chrombpnet_wo_bias.h5
wait
cp -r $dir/interpret_counts_full $oak_dir

Expand Down
14 changes: 10 additions & 4 deletions sherlock/start_interpretation_counts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@ output_dir=$2
metadata_tsv=$3
oak_dir=$4

if [[ -d $output_dir/$experiment ]] ; then
if [[ -f $output_dir/$experiment/chrombpnet_model/chrombpnet_wo_bias.h5 ]] ; then
if [[ -f $output_dir/$experiment/interpret_counts_full/$experiment.counts_scores.h5 ]] ; then
if [[ -d $oak_dir/$experiment ]] ; then
if [[ -f $oak_dir/$experiment/chrombpnet_model/chrombpnet_wo_bias.h5 ]] ; then
if [[ -f $oak_dir/$experiment/interpret_counts_full/$experiment.counts_scores.h5 ]] ; then
echo "count interpretations already exist - skipping"
else
if [[ ! -f $output_dir/$experiment/chrombpnet_model/chrombpnet_wo_bias.h5 ]] ; then
echo "copying model form oak"
mkdir $output_dir/$experiment/chrombpnet_model/
cp $oak_dir/$experiment/chrombpnet_model/chrombpnet_wo_bias.h5 $output_dir/$experiment/chrombpnet_model/

fi
mkdir $output_dir/$experiment/interpret_counts_full/
cores=1
sbatch --export=ALL --requeue \
Expand All @@ -19,7 +25,7 @@ if [[ -d $output_dir/$experiment ]] ; then
--mem=80G \
-o $output_dir/$experiment/interpret_counts_full/interpret.log.o \
-e $output_dir/$experiment/interpret_counts_full/interpret.log.e \
run_interpretation_counts.sh $experiment $output_dir/$experiment/ $oak_dir/$experiment/chrombpnet_model/
run_interpretation_counts.sh $experiment $output_dir/$experiment/ $oak_dir/$experiment/
fi
else
echo "skipping interpretation - model not found"
Expand Down

0 comments on commit 9a87c1a

Please sign in to comment.