I was wondering how can I convert bed file to wig file.
I have several bed files which look like
head EE88324.shortlong.frag.bed
chr1 10003 10117 1
chr1 10003 10138 1
chr1 10003 10146 1
chr1 10008 10152 1
chr1 10009 10129 1
chr1 10009 10130 1
chr1 10025 10169 1
chr1 10026 10145 1
chr1 10030 10172 1
chr1 10052 10245 1
Now I want convert this bed file to wig file, which should look like this, (this toy bed and wig samples are different)
head -n 50 S9U_ZKDN240002406-1A_H5VMFDSXC_L1_bwaM_readCounts.w1000k.wig
fixedStep chrom=chr1 start=1 step=1000000 span=1000000
2682
8134
7087
6923
5585
5579
7056
5953
6174
7058
6606
6682
5630
4705
5432
6755
9442
6563
5891
6427
6033
6871
6360
6574
What I tried so far,
#bed to wig conversion
chromsizes="~/mapF/GRCh38_chr.txt"
bedGraphToBigWig="~/KentUtils/exe/linux.x86_64/bedGraphToBigWig"
bigWigToWig="~/KentUtils/exe/linux.x86_64/bigWigToWig"
conda activate bedops_env
bedops --partition EE88324.shortlong.frag.bed |
bedmap --echo --mean --delim '\t' --window 1000000 --fixed 1000000 - EE88324.shortlong.frag.bed |
$bedGraphToBigWig - $chromsizes |
$bigWigToWig - EE88324.shortlong.diff.partition.map.1MB.wig