awk -F "\t" 'BEGIN {OFS="\t"}$3=="gene" {print $1,$4,$5,$9}' final_sorted_with_promoter.change.gff3 >final_sorted_with_promoter.change.gene
bedtools intersect -a region.xls -b final_sorted_with_promoter.change.gene -wa -wb | awk -F ";" '{print $1}'> EAR_SR3.gene.name
注意,region.xls和 final_sorted_with_promoter.change.gene文件均為bed格式。
bed格式前3列為必須有的,分別為染色體,起始位置,終止位置。

image.png
由于 region.xls 我在excel表格整理出來的,格式是dos系統(tǒng)的,會(huì)報(bào)錯(cuò)。因此需要在linux下打開后用set ff=unix改成linux系統(tǒng)的。