Goal

  • export bigwigs for Melanie and generate the logo-plots
In [1]:
import basepair
from basepair.config import get_data_dir, create_tf_session
from keras.models import load_model
from basepair.datasets import *
from basepair.datasets import sox2_oct4_peaks_sox2
from basepair import datasets
from basepair.preproc import AppendTotalCounts, transform_data, resize_interval
from basepair.plots import regression_eval
from basepair.BPNet import BPNetPredictor
from basepair.utils import write_pkl
/users/avsec/bin/anaconda3/envs/chipnexus/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
Using TensorFlow backend.

Setup BPNetPredictor

Get the model

In [2]:
create_tf_session(0)
Out[2]:
<tensorflow.python.client.session.Session at 0x7f18d632df98>
In [3]:
model = load_model("/users/avsec/workspace/basepair/basepair/../data/processed/chipnexus/exp/models/p-multi-task/seq_mutlitask_filters=32,conv1_kernel_size=21,tconv_kernel_size=25,n_dil_layers=6,use_profile=True,use_counts=True,c_task_weight=10,lr=0.004.5.h5")
WARNING:tensorflow:From /users/avsec/bin/anaconda3/envs/chipnexus/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py:497: calling conv1d (from tensorflow.python.ops.nn_ops) with data_format=NHWC is deprecated and will be removed in a future version.
Instructions for updating:
`NHWC` for data_format is deprecated, use `NWC` instead
2018-06-22 22:47:40,555 [WARNING] From /users/avsec/bin/anaconda3/envs/chipnexus/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py:497: calling conv1d (from tensorflow.python.ops.nn_ops) with data_format=NHWC is deprecated and will be removed in a future version.
Instructions for updating:
`NHWC` for data_format is deprecated, use `NWC` instead
WARNING:tensorflow:From /users/avsec/bin/anaconda3/envs/chipnexus/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/base.py:198: retry (from tensorflow.contrib.learn.python.learn.datasets.base) is deprecated and will be removed in a future version.
Instructions for updating:
Use the retry module or similar alternatives.
2018-06-22 22:47:47,227 [WARNING] From /users/avsec/bin/anaconda3/envs/chipnexus/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/base.py:198: retry (from tensorflow.contrib.learn.python.learn.datasets.base) is deprecated and will be removed in a future version.
Instructions for updating:
Use the retry module or similar alternatives.

Get the preprocessor

In [4]:
data = sox2_oct4_peaks_sox2()
In [5]:
y = data[0][1]

# rename y -> 'profile/Sox2', 'profile/Oct4
ynew = {"profile/Sox2": y["sox2"], "profile/Oct4": y["oct4"]}
In [6]:
data[2][2].iloc[1788]
Out[6]:
chr                                                      chr8
end                                                  90671044
oct4_neg    [2.0, 8.0, 0.0, 1.0, 0.0, 2.0, 3.0, 3.0, 2.0, ...
oct4_pos    [2.0, 0.0, 1.0, 1.0, 3.0, 4.0, 3.0, 1.0, 1.0, ...
sox2_neg    [1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, ...
sox2_pos    [0.0, 0.0, 0.0, 0.0, 3.0, 3.0, 3.0, 1.0, 0.0, ...
start                                                90670843
seq         TTTAAGGTCTCTCCTTTTTGCTTTGAAGTTCAAAGAAAGAGAAGAC...
seq_id                                 chr8:90670843-90671044
Name: 8449, dtype: object
In [7]:
preproc = AppendTotalCounts()
preproc.fit(ynew)
In [8]:
# Write to a file
write_pkl(preproc, 
          "/users/avsec/workspace/basepair/basepair/../data/processed/chipnexus/exp/models/p-multi-task/preproc.pkl")

Visualize the regions

In [9]:
bp = BPNetPredictor(model, 
                    "/mnt/data/pipeline_genome_data/mm10/mm10_no_alt_analysis_set_ENCODE.fasta",
                    tasks = ["Sox2", "Oct4"],
                    preproc=preproc)
In [21]:
# All required paths
#!cat /users/avsec/workspace/basepair-workflow/models/0/dataspec.yaml
bws = {task: {s: f"/users/avsec/workspace/basepair-workflow/data/{task}/5prime.counts.{s}.bw" for s in ['pos', 'neg']}
       for task in ["Sox2", "Oct4"]}
genome_file = "/mnt/data/pipeline_genome_data/mm10/mm10.chrom.sizes"
klf4_bed = "/users/avsec/workspace/basepair-workflow/data/klf4_sites_mm10.bed"
oct4_bed = "/users/avsec/workspace/basepair-workflow/data/oct4_sites_mm10.bed"
klf4_oct4_windowed_bed = "/users/avsec/workspace/basepair-workflow/data/klf4_oct4_windowed_sites_mm10.bed"
In [22]:
cat {klf4_bed} {oct4_bed} | bedtools makewindows -w 201  -b stdin -i srcwinnum >  {klf4_oct4_windowed_bed}
In [23]:
!head {klf4_oct4_windowed_bed}
chr4	55477346	55477547	KLF4-Downstream_Enhancer_E1_mm10_1
chr4	55477547	55477748	KLF4-Downstream_Enhancer_E1_mm10_2
chr4	55477748	55477760	KLF4-Downstream_Enhancer_E1_mm10_3
chr4	55475208	55475409	KLF4-Downstream_Enhancer_E2_mm10_1
chr4	55475409	55475610	KLF4-Downstream_Enhancer_E2_mm10_2
chr4	55475610	55475811	KLF4-Downstream_Enhancer_E2_mm10_3
chr4	55475811	55475900	KLF4-Downstream_Enhancer_E2_mm10_4
chr17	35503943	35504144	Distal and Proximal Oct4 Enhancers, Combined_1
chr17	35504144	35504345	Distal and Proximal Oct4 Enhancers, Combined_2
chr17	35504345	35504546	Distal and Proximal Oct4 Enhancers, Combined_3
In [4]:
cat /users/avsec/workspace/basepair-workflow/data/klf4_sites_mm10.bed
chr4	55477346	55477760	KLF4-Downstream_Enhancer_E1_mm10	0	.
chr4	55475208	55475900	KLF4-Downstream_Enhancer_E2_mm10	0	.
In [24]:
!ls /users/avsec/workspace/basepair-workflow/data/
klf4_oct4_windowed_sites_mm10.bed  merged_peaks.bed  oct4_sites_mm10.bed
klf4_sites_mm10.bed		   Oct4		     Sox2
In [25]:
bt = BedTool(klf4_bed).cat(BedTool(oct4_bed), postmerge=False)
intervals = list(bt)
bt_windowed = BedTool(klf4_oct4_windowed_bed)
intervals_windowed = [resize_interval(interval, 201) for interval in bt_windowed]
In [26]:
intervals
Out[26]:
[Interval(chr4:55477346-55477760),
 Interval(chr4:55475208-55475900),
 Interval(chr17:35503943-35506057),
 Interval(chr17:35503912-35504118),
 Interval(chr17:35504981-35505186),
 Interval(chr17:35506031-35510777)]
In [27]:
# Interval widths
[interval.stop - interval.start for interval in intervals]
Out[27]:
[414, 692, 2114, 206, 205, 4746]
In [28]:
intervals_resized = [resize_interval(interval, 201) for interval in intervals]
In [20]:
# To be still managable, I resized interval around the center to have width=201
bp.predict_plot([Interval("chr17", 35503946, 35503946+201),
                 Interval("chr17", 35503946+150, 35503946+201+150),
                ], bws=bws, 
                profile_grad='weighted',
                figsize=(20, 10))
In [20]:
# To be still managable, I resized interval around the center to have width=201
bp.predict_plot([Interval("chr17", 35503946, 35503946+201),
                 Interval("chr17", 35503946+150, 35503946+201+150),
                ], bws=bws, 
                profile_grad='weighted',
                figsize=(20, 10))
In [18]:
# To be still managable, I resized interval around the center to have width=201
bp.predict_plot([Interval("chr17", 35503946, 35503946+201),
                 Interval("chr17", 35503946+150, 35503946+201+150),
                ], bws=bws, figsize=(20, 10))
In [59]:
# To be still managable, I resized interval around the center to have width=201
bp.predict_plot(intervals_resized, bws=bws, figsize=(20, 10))

Export Klf4 and Oct4 sites to bigwig

In [30]:
[interval.stop - interval.start for interval in bt_windowed][:5]
Out[30]:
[201, 201, 12, 201, 201]
In [47]:
output_dir=f"{ddir}/www/BPNet/for_melanie/klf4_oct4_sites/"
!mkdir -p {output_dir}
bp.export_bw(intervals=list(BedTool(intervals_windowed).sort()), 
             batch_size=64,
             output_dir=output_dir)
2018-06-19 15:42:59,126 [INFO] Get model predictions and importance scores
2018-06-19 15:43:12,104 [INFO] Setup bigWigs for writing
2018-06-19 15:43:12,155 [INFO] Writing to bigWigs

  0%|          | 0/46 [00:00<?, ?it/s]
100%|██████████| 46/46 [00:00<00:00, 1737.79it/s]2018-06-19 15:43:12,187 [INFO] Done writing. Closing bigWigs
2018-06-19 15:43:12,234 [INFO] Done! Files located at: /users/avsec/workspace/basepair/basepair/../data/www/BPNet/for_melanie/klf4_oct4_sites/
In [186]:
# Save the bedtool as well
bt.saveas(f"{output_dir}/intervals.bed")
Out[186]:
<BedTool(/users/avsec/workspace/basepair/basepair/../data/www/BPNet/for_melanie/klf4_oct4_sites//intervals.bed)>
In [191]:
# Convert to the hammock file format
!basepair bed2hammock {output_dir}/intervals.bed
Using TensorFlow backend.
bed file doesn't have 10 columns. Padding with 0's
In [55]:
# Intervals
[f"{i.chrom}:{i.start}-{i.stop}  {i.name}" for i in BedTool(f"{output_dir}/intervals.bed")]
Out[55]:
['chr4:55477346-55477760  KLF4-Downstream_Enhancer_E1_mm10',
 'chr4:55475208-55475900  KLF4-Downstream_Enhancer_E2_mm10',
 'chr17:35503943-35506057  Distal and Proximal Oct4 Enhancers, Combined',
 'chr17:35503912-35504118  SOX2/OCT4 Binding Site on Distal Enhancer',
 'chr17:35504981-35505186  SOX2/OCT4 Binding Site on Proximal Enhancer',
 'chr17:35506031-35510777  OCT4(POU5F1) Gene Region']
In [3]:
!ls {ddir}/
ls: cannot access '{ddir}/': No such file or directory

Export the whole dataset to the memory

In [34]:
oct4_bed = "/users/avsec/workspace/basepair-workflow/data/Oct4/peaks.bed.gz"
In [35]:
sox2_bed = f"{BED_DIR}//Sox2_123b_1_ppr.IDR0.05.filt.summit_centered_200bp.narrowPeak"
In [36]:
!wc -l {sox2_bed}
9396 /users/avsec/workspace/basepair/basepair/../data/raw/chipnexus/scratch_jzeitlinger_collab/meme_chip_analysis//Sox2_123b_1_ppr.IDR0.05.filt.summit_centered_200bp.narrowPeak
In [37]:
!head {sox2_bed}
chr17	17408871	17409072	.	899	.	23.14292	-1.00000	-0.11892	168
chr5	110284652	110284853	.	567	.	23.18326	-1.00000	-0.11992	168
chr1	57780110	57780311	.	1000	.	23.32034	-1.00000	-0.12406	168
chr6	94183931	94184132	.	1000	.	23.35388	-1.00000	-0.12534	168
chr5	121537340	121537541	.	817	.	23.35671	-1.00000	-0.12541	168
chr8	67966522	67966723	.	585	.	23.41701	-1.00000	-0.12709	168
chr11	68348387	68348588	.	1000	.	23.53622	-1.00000	-0.13079	168
chr1	9955253	9955454	.	1000	.	23.66639	-1.00000	-0.13534	168
chr10	123087061	123087262	.	830	.	23.75985	-1.00000	-0.13821	168
chr2	18567730	18567931	.	1000	.	23.80058	-1.00000	-0.13973	168
In [38]:
btm = BedTool(oct4_bed).cat(sox2_bed, postmerge=False).sort()
In [39]:
btm.fn
Out[39]:
'/tmp/pybedtools.1vtwgtnb.tmp'
In [40]:
btm_windowed = "/tmp/pybedtools.w_g5cabn_n.tmp"
In [41]:
!bedtools makewindows -w 201  -b {btm.fn} -i srcwinnum >  {btm_windowed}
In [42]:
intervals = [resize_interval(i, 201) for i in BedTool(btm_windowed).sort()]
In [43]:
len(intervals)
Out[43]:
31237
In [44]:
pd.Series([i.stop-i.start for i in intervals]).unique()
Out[44]:
array([201])
In [47]:
intervals = list(BedTool(intervals + intervals_windowed).sort())
In [62]:
output_dir=f"{ddir}/www/BPNet/for_melanie/all_sox2_oct4_sites_weighted_scaled/"
!mkdir -p {output_dir}
bp.export_bw(intervals=intervals, 
             batch_size=32,
             profile_grad='weighted',
             scale_importance=True,
             output_dir=output_dir)
2018-06-22 23:05:09,980 [INFO] Get model predictions and importance scores
2018-06-22 23:05:36,812 [INFO] Setup bigWigs for writing
2018-06-22 23:05:36,932 [INFO] Writing to bigWigs
 46%|████▌     | 14379/31283 [00:07<00:08, 2025.15it/s]2018-06-22 23:05:44,135 [ERROR] interval.stop - interval.start (201)!= len(arr) (243)
2018-06-22 23:05:44,136 [ERROR] Skipping the entry: chr18	77932865	77933066	_1

2018-06-22 23:05:44,137 [ERROR] interval.stop - interval.start (201)!= len(arr) (243)
2018-06-22 23:05:44,138 [ERROR] Skipping the entry: chr18	77932865	77933066	_1

2018-06-22 23:05:44,139 [ERROR] interval.stop - interval.start (201)!= len(arr) (243)
2018-06-22 23:05:44,140 [ERROR] Skipping the entry: chr18	77932865	77933066	_1

2018-06-22 23:05:44,141 [ERROR] interval.stop - interval.start (201)!= len(arr) (243)
2018-06-22 23:05:44,141 [ERROR] Skipping the entry: chr18	77932865	77933066	_1

100%|█████████▉| 31191/31283 [00:15<00:00, 1966.66it/s]2018-06-22 23:05:52,837 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,837 [ERROR] Skipping the entry: chrY	90805034	90805235	_1

2018-06-22 23:05:52,838 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,839 [ERROR] Skipping the entry: chrY	90805034	90805235	_1

2018-06-22 23:05:52,840 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,840 [ERROR] Skipping the entry: chrY	90805034	90805235	_1

2018-06-22 23:05:52,841 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,842 [ERROR] Skipping the entry: chrY	90805034	90805235	_1

2018-06-22 23:05:52,843 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,843 [ERROR] Skipping the entry: chrY	90807391	90807592	_1

2018-06-22 23:05:52,844 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,845 [ERROR] Skipping the entry: chrY	90807391	90807592	_1

2018-06-22 23:05:52,846 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,846 [ERROR] Skipping the entry: chrY	90807391	90807592	_1

2018-06-22 23:05:52,847 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,848 [ERROR] Skipping the entry: chrY	90807391	90807592	_1

2018-06-22 23:05:52,849 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,849 [ERROR] Skipping the entry: chrY	90808750	90808951	_1

2018-06-22 23:05:52,851 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,851 [ERROR] Skipping the entry: chrY	90808750	90808951	_1

2018-06-22 23:05:52,852 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,853 [ERROR] Skipping the entry: chrY	90808750	90808951	_1

2018-06-22 23:05:52,854 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,855 [ERROR] Skipping the entry: chrY	90808750	90808951	_1

2018-06-22 23:05:52,856 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,856 [ERROR] Skipping the entry: chrY	90810659	90810860	_1

2018-06-22 23:05:52,857 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,858 [ERROR] Skipping the entry: chrY	90810659	90810860	_1

2018-06-22 23:05:52,859 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,859 [ERROR] Skipping the entry: chrY	90810659	90810860	_1

2018-06-22 23:05:52,860 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,861 [ERROR] Skipping the entry: chrY	90810659	90810860	_1

2018-06-22 23:05:52,862 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,862 [ERROR] Skipping the entry: chrY	90811017	90811218	_1

2018-06-22 23:05:52,863 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,864 [ERROR] Skipping the entry: chrY	90811017	90811218	_1

2018-06-22 23:05:52,864 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,865 [ERROR] Skipping the entry: chrY	90811017	90811218	_1

2018-06-22 23:05:52,866 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,866 [ERROR] Skipping the entry: chrY	90811017	90811218	_1

2018-06-22 23:05:52,867 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,868 [ERROR] Skipping the entry: chrY	90812366	90812567	_1

2018-06-22 23:05:52,868 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,869 [ERROR] Skipping the entry: chrY	90812366	90812567	_1

2018-06-22 23:05:52,870 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,871 [ERROR] Skipping the entry: chrY	90812366	90812567	_1

2018-06-22 23:05:52,872 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,873 [ERROR] Skipping the entry: chrY	90812366	90812567	_1

2018-06-22 23:05:52,874 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,874 [ERROR] Skipping the entry: chrY	90812810	90813011	_1

2018-06-22 23:05:52,875 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,876 [ERROR] Skipping the entry: chrY	90812810	90813011	_1

2018-06-22 23:05:52,877 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,877 [ERROR] Skipping the entry: chrY	90812810	90813011	_1

2018-06-22 23:05:52,878 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,879 [ERROR] Skipping the entry: chrY	90812810	90813011	_1

2018-06-22 23:05:52,879 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,880 [ERROR] Skipping the entry: chrY	90813518	90813719	_1

2018-06-22 23:05:52,881 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,881 [ERROR] Skipping the entry: chrY	90813518	90813719	_1

2018-06-22 23:05:52,882 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,883 [ERROR] Skipping the entry: chrY	90813518	90813719	_1

2018-06-22 23:05:52,883 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,884 [ERROR] Skipping the entry: chrY	90813518	90813719	_1

2018-06-22 23:05:52,885 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,885 [ERROR] Skipping the entry: chrY	90825242	90825443	_1

2018-06-22 23:05:52,886 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,887 [ERROR] Skipping the entry: chrY	90825242	90825443	_1

2018-06-22 23:05:52,887 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,888 [ERROR] Skipping the entry: chrY	90825242	90825443	_1

2018-06-22 23:05:52,889 [ERROR] interval.stop - interval.start (201)!= len(arr) (804)
2018-06-22 23:05:52,889 [ERROR] Skipping the entry: chrY	90825242	90825443	_1

100%|██████████| 31283/31283 [00:15<00:00, 1960.68it/s]
2018-06-22 23:05:52,891 [INFO] Done writing. Closing bigWigs
2018-06-22 23:06:12,146 [INFO] Done! Files located at: /users/avsec/workspace/basepair/basepair/../data/www/BPNet/for_melanie/all_sox2_oct4_sites_weighted/
In [ ]:
from basepair.cli.washu import write_washu_config
In [53]:
BedTool(intervals).saveas(f"{output_dir}/intervals.bed")
Out[53]:
<BedTool(/users/avsec/workspace/basepair/basepair/../data/www/BPNet/for_melanie/all_sox2_oct4_sites_weighted/intervals.bed)>
In [48]:
!basepair bed2hammock {output_dir}/intervals.bed
Using TensorFlow backend.
bed file doesn't have 10 columns. Padding with 0's
In [55]:
ls {output_dir}/*.bw
/users/avsec/workspace/basepair/basepair/../data/www/BPNet/for_melanie/all_sox2_oct4_sites_weighted//Oct4.importance.counts.bw
/users/avsec/workspace/basepair/basepair/../data/www/BPNet/for_melanie/all_sox2_oct4_sites_weighted//Oct4.importance.profile.bw
/users/avsec/workspace/basepair/basepair/../data/www/BPNet/for_melanie/all_sox2_oct4_sites_weighted//Oct4.preds.neg.bw
/users/avsec/workspace/basepair/basepair/../data/www/BPNet/for_melanie/all_sox2_oct4_sites_weighted//Oct4.preds.pos.bw
/users/avsec/workspace/basepair/basepair/../data/www/BPNet/for_melanie/all_sox2_oct4_sites_weighted//Sox2.importance.counts.bw
/users/avsec/workspace/basepair/basepair/../data/www/BPNet/for_melanie/all_sox2_oct4_sites_weighted//Sox2.importance.profile.bw
/users/avsec/workspace/basepair/basepair/../data/www/BPNet/for_melanie/all_sox2_oct4_sites_weighted//Sox2.preds.neg.bw
/users/avsec/workspace/basepair/basepair/../data/www/BPNet/for_melanie/all_sox2_oct4_sites_weighted//Sox2.preds.pos.bw
In [56]:
tasks = ['Oct4', 'Sox2']
features = ['preds.pos', 'preds.neg', 'importance.counts', 'importance.profile']
In [57]:
filespec = [
    {"name": feat,
     "path": f"{task}.{feat}.bw",
     "type": "bigwig"}
    for task in tasks for feat in features
]
In [58]:
filespec += [{"name": "peaks", "path": "peaks.hammock.gz", "type": "hammock"}]
In [59]:
filespec
Out[59]:
[{'name': 'preds.pos', 'path': 'Oct4.preds.pos.bw', 'type': 'bigwig'},
 {'name': 'preds.neg', 'path': 'Oct4.preds.neg.bw', 'type': 'bigwig'},
 {'name': 'importance.counts',
  'path': 'Oct4.importance.counts.bw',
  'type': 'bigwig'},
 {'name': 'importance.profile',
  'path': 'Oct4.importance.profile.bw',
  'type': 'bigwig'},
 {'name': 'preds.pos', 'path': 'Sox2.preds.pos.bw', 'type': 'bigwig'},
 {'name': 'preds.neg', 'path': 'Sox2.preds.neg.bw', 'type': 'bigwig'},
 {'name': 'importance.counts',
  'path': 'Sox2.importance.counts.bw',
  'type': 'bigwig'},
 {'name': 'importance.profile',
  'path': 'Sox2.importance.profile.bw',
  'type': 'bigwig'},
 {'name': 'peaks', 'path': 'peaks.hammock.gz', 'type': 'hammock'}]
In [60]:
!wc -l {output_dir}/intervals.bed
31283 /users/avsec/workspace/basepair/basepair/../data/www/BPNet/for_melanie/all_sox2_oct4_sites_weighted//intervals.bed
In [63]:
write_washu_config(filespec, 
                   output_dir, 
                   "http://mitra.stanford.edu/kundaje/avsec/chipnexus/BPNet/for_melanie/all_sox2_oct4_sites_weighted_scaled/", 
                   "mm10")
----------------------------------------
Navigate to: https://epigenomegateway.wustl.edu/browser/?genome=mm10&datahub=http://mitra.stanford.edu/kundaje/avsec/chipnexus/BPNet/for_melanie/all_sox2_oct4_sites_weighted_scaled//washu.json

Screenshots

KLF4-Downstream_Enhancer_E1_mm10

interval1

KLF4-Downstream_Enhancer_E2_mm10

KLF4-Downstream_Enhancer_E2_mm10

Distal and Proximal Oct4 Enhancers, Combined

Distal and Proximal Oct4 Enhancers, Combined