Generate stage-specific (averaged across replicates) tracks from Daugherty et al., 2017 processed signal...


In [1]:
%run ~/relmapping/annot/notebooks/__init__.ipynb


/mnt/home3/jj374/anaconda36/lib/python3.6/site-packages/statsmodels/compat/pandas.py:56: FutureWarning: The pandas.core.datetools module is deprecated and will be removed in a future version. Please use the pandas.tseries module instead.
  from pandas.core import datetools
os.getcwd(): /mnt/beegfs/scratch_copy/ahringer/jj374/lab/relmapping

In [2]:
fp_ = '~/lab/raw_data/201801.Daugherty2017tracks/Celegans_ATAC_tracks/enrichmentOverGDNA/EE_L3_YA_IndividRepsABC.adjusted.insertSites.singleBP.log2EnrichOverGDNA.meanIn10bpWindows.bed.gz'
names_ = ['chrom', 'start', 'end', 
          'EE_repA', 'EE_repB', 'EE_repC', 
          'L3_repA', 'L3_repB', 'L3_repC',
          'YA_repA', 'YA_repB', 'YA_repC',
]
#df_ = pd.read_csv(os.path.expanduser(fp_), nrows=1000000, sep='\t', names=names_).sort_values(['chrom', 'start', 'end'])
df_ = pd.read_csv(os.path.expanduser(fp_), sep='\t', names=names_).sort_values(['chrom', 'start', 'end'])
df_['EE_mean'] = df_[['EE_repA', 'EE_repB', 'EE_repC']].mean(axis=1)
df_['L3_mean'] = df_[['L3_repA', 'L3_repB', 'L3_repC']].mean(axis=1)
df_['YA_mean'] = df_[['YA_repA', 'YA_repB', 'YA_repC']].mean(axis=1)

In [3]:
def wp(fp): return os.path.join('annot_ce10_eLife_rev', 'Rev3Q3', fp)

df_[['chrom', 'start', 'end', 'EE_repA']].to_csv(wp('Daugherty2017_EE_25bp_repA.bedGraph'), sep='\t', index=None, header=None)
df_[['chrom', 'start', 'end', 'EE_repB']].to_csv(wp('Daugherty2017_EE_25bp_repB.bedGraph'), sep='\t', index=None, header=None)
df_[['chrom', 'start', 'end', 'EE_repC']].to_csv(wp('Daugherty2017_EE_25bp_repC.bedGraph'), sep='\t', index=None, header=None)

df_[['chrom', 'start', 'end', 'L3_repA']].to_csv(wp('Daugherty2017_L3_25bp_repA.bedGraph'), sep='\t', index=None, header=None)
df_[['chrom', 'start', 'end', 'L3_repB']].to_csv(wp('Daugherty2017_L3_25bp_repB.bedGraph'), sep='\t', index=None, header=None)
df_[['chrom', 'start', 'end', 'L3_repC']].to_csv(wp('Daugherty2017_L3_25bp_repC.bedGraph'), sep='\t', index=None, header=None)

df_[['chrom', 'start', 'end', 'YA_repA']].to_csv(wp('Daugherty2017_YA_25bp_repA.bedGraph'), sep='\t', index=None, header=None)
df_[['chrom', 'start', 'end', 'YA_repB']].to_csv(wp('Daugherty2017_YA_25bp_repB.bedGraph'), sep='\t', index=None, header=None)
df_[['chrom', 'start', 'end', 'YA_repC']].to_csv(wp('Daugherty2017_YA_25bp_repC.bedGraph'), sep='\t', index=None, header=None)

In [4]:
!bedGraphToBigWig {wp('Daugherty2017_EE_25bp_repA.bedGraph')} shared/ce10.chroms {wp('Daugherty2017_EE_25bp_repA.bw')}
!bedGraphToBigWig {wp('Daugherty2017_EE_25bp_repB.bedGraph')} shared/ce10.chroms {wp('Daugherty2017_EE_25bp_repB.bw')}
!bedGraphToBigWig {wp('Daugherty2017_EE_25bp_repC.bedGraph')} shared/ce10.chroms {wp('Daugherty2017_EE_25bp_repC.bw')}

!bedGraphToBigWig {wp('Daugherty2017_L3_25bp_repA.bedGraph')} shared/ce10.chroms {wp('Daugherty2017_L3_25bp_repA.bw')}
!bedGraphToBigWig {wp('Daugherty2017_L3_25bp_repB.bedGraph')} shared/ce10.chroms {wp('Daugherty2017_L3_25bp_repB.bw')}
!bedGraphToBigWig {wp('Daugherty2017_L3_25bp_repC.bedGraph')} shared/ce10.chroms {wp('Daugherty2017_L3_25bp_repC.bw')}

!bedGraphToBigWig {wp('Daugherty2017_YA_25bp_repA.bedGraph')} shared/ce10.chroms {wp('Daugherty2017_YA_25bp_repA.bw')}
!bedGraphToBigWig {wp('Daugherty2017_YA_25bp_repB.bedGraph')} shared/ce10.chroms {wp('Daugherty2017_YA_25bp_repB.bw')}
!bedGraphToBigWig {wp('Daugherty2017_YA_25bp_repC.bedGraph')} shared/ce10.chroms {wp('Daugherty2017_YA_25bp_repC.bw')}

In [ ]:


In [ ]:
df_[['chrom', 'start', 'end', 'EE_mean']].to_csv('annot/FigA_overlaps/bw_files/Daugherty2017_EE_25bp_mean.bedGraph', sep='\t', index=None, header=None)
df_[['chrom', 'start', 'end', 'L3_mean']].to_csv('annot/FigA_overlaps/bw_files/Daugherty2017_L3_25bp_mean.bedGraph', sep='\t', index=None, header=None)
df_[['chrom', 'start', 'end', 'YA_mean']].to_csv('annot/FigA_overlaps/bw_files/Daugherty2017_YA_25bp_mean.bedGraph', sep='\t', index=None, header=None)

In [ ]:
!bedGraphToBigWig annot/FigA_overlaps/bw_files/Daugherty2017_EE_25bp_mean.bedGraph shared/ce10.chroms annot/FigA_overlaps/bw_files/Daugherty2017_EE_25bp_mean.bw
!bedGraphToBigWig annot/FigA_overlaps/bw_files/Daugherty2017_L3_25bp_mean.bedGraph shared/ce10.chroms annot/FigA_overlaps/bw_files/Daugherty2017_L3_25bp_mean.bw
!bedGraphToBigWig annot/FigA_overlaps/bw_files/Daugherty2017_YA_25bp_mean.bedGraph shared/ce10.chroms annot/FigA_overlaps/bw_files/Daugherty2017_YA_25bp_mean.bw