run_trim_FeBY2.sh 1.1 KB

12345678910111213141516171819
  1. set -e
  2. shome=~/script/bed
  3. hg19_map=/cgdata/guocq/TEST/exac_ref/wgEncodeCrgMapabilityAlign75mer.bigWig
  4. hg19_gc=/cgdata/guocq/TEST/exac_ref/ucsc.hg19.gc5Base.bw
  5. hg19_fai=/cgdata/guocq/TEST/exac_ref/ucsc.hg19.fasta.fai
  6. prebed=FeBY2_20210902.sorted.hg19
  7. sortBed -i ${prebed}.bed |slopBed -g $hg19_fai -b 65 |mergeBed -c 4 -o distinct |awk '{print $0"\t0\t+"}' > ${prebed}.slop.bed
  8. perl $shome/dedep_bed.pl ${prebed}.slop.bed
  9. windowMaker -b ${prebed}.slop.uniq120.bed -i srcwinnum -w 120 |awk '{print $0"\t0\t+"}' > ${prebed}.uniq120.bed
  10. bigWigAverageOverBed $hg19_map ${prebed}.uniq120.bed ${prebed}.uniq120.chr_Mapability.tab -bedOut=${prebed}.uniq120.chr_Mapability.bed
  11. bigWigAverageOverBed $hg19_gc ${prebed}.uniq120.bed ${prebed}.uniq120.gc5Base.tab -bedOut=${prebed}.uniq120.gc5Base.bed
  12. perl $shome/bed_CG_Map.pl ${prebed}.uniq120.chr_Mapability.bed ${prebed}.uniq120.gc5Base.bed ${prebed}.uniq120.gcmap.bed
  13. awk -v end=0 'BEGIN{OFS="\t"}{if($2==end){$2+=1};print $0;end=$3 }' ${prebed}.uniq120.gcmap.bed \
  14. > ${prebed}.uniq120.gcmap.1.bed
  15. mv ${prebed}.uniq120.gcmap.1.bed ${prebed}.uniq120.gcmap.bed