bigWigToBedGraph格式转换

 

!!!!记得把下载的bigWigToBedGraph 加上chmod 755 

 ./bigWigToBedGraph csd11.1_pc1.bw out.bedGraph

 

bw转bedgraph 转 bed 转其他 都可以的
http://hgdownload.soe.ucsc.edu/admin/exe/linux.x86_64/


================================================================
========   bigWigToBedGraph   ====================================
================================================================
### kent source version 400 ###
bigWigToBedGraph - Convert from bigWig to bedGraph format.
usage:
   bigWigToBedGraph in.bigWig out.bedGraph
options:
   -chrom=chr1 - if set restrict output to given chromosome
   -start=N - if set, restrict output to only that over start
   -end=N - if set, restict output to only that under end
   -udcDir=/dir/to/cache - place to put cache for remote bigBed/bigWigs

所以我们想要得到bed文件只需要提取bedGraph的前三列即可,同时注意不要第一行,利用grep -v命令

 

BED

The BED format can be found at UCSC genome browser website.

The essential columns in BED format input are the 1st column chromosome name, the 2nd start position, the 3rd end position, and the 6th, strand.

Note that, for BED format, the 6th column of strand information is required by MACS. And please pay attention that the coordinates in BED format are zero-based and half-open. See more detail at UCSC site.

grep -v track out.bedGraph | cut -f 1-3,6 > out.bed

BEDPE or BAMPE

A special mode will be triggered while the format is specified as BAMPE or BEDPE. In this way, MACS2 will process the BAM or BED files as paired-end data. Instead of building a bimodal distribution of plus and minus strand reads to predict fragment size, MACS2 will use actual insert sizes of pairs of reads to build fragment pileup.

The BAMPE format is just a BAM format containing paired-end alignment information, such as those from BWA or BOWTIE.

The BEDPE format is a simplified and more flexible BED format, which only contains the first three columns defining the chromosome name, left and right position of the fragment from Paired-end sequencing. Please note, this is NOT the same format used by BEDTOOLS, and the BEDTOOLS version of BEDPE is actually not in a standard BED format. You can use MACS2 subcommand randsample to convert a BAM file containing paired-end information to a BEDPE format file:

# Convert bedGraph to bed file
grep -v track GSM1252087_edm2-4_RNAseq.bedGraph | cut -f 1-3 > GSM1252087_edm2-4_RNAseq.bed

. bed转bam

bedtools工具提供的bedtobam命令

https://www.jianshu.com/p/4ac418a6dc75  (bedToBam 使用指南))

The full list of bedtools sub-commands.

# Change the bed file to bam file
cat GSM1252087_edm2-4_RNAseq.bed | awk '{x++; printf "%s\tread%d\n",$0,x}' | bedtools bedtobam -g Arabidopsis_genomeFile.txt -i - > GSM1252087_edm2-4_RNAseq.bam

bigWigToBedGraph in.bigWig out.bedGraph

grep -v track out.bedGraph | cut -f 1-3 > out.bed

# Build genome index file  从fasta文件的到的
samtools faidx Arabidopsis_thaliana.TAIR10.dna.toplevel.fa

# Build the genome size file
awk {'print "Chr"$1,"\t",$2'} Arabidopsis_thaliana.TAIR10.dna.toplevel.fa.fai > Arabidopsis_genomeFile.txt

# Change the bed file to bam file
cat out.bed | awk '{x++; printf "%s\tread%d\n",$0,x}' | bedtools bedtobam -g Arabidopsis_genomeFile.txt -i - > out.bam
 

https://www.jianshu.com/p/25f7a8967e8a

bedGraph,bed以及bam文件格式转换

https://www.jianshu.com/p/a2930f1ef5b8

 

https://www.jianshu.com/p/4b5e35982706

 

https://www.jianshu.com/p/2831df3a00bf?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值