其他分享
首页 > 其他分享> > gwas分析中根据显著性p值筛选上下游10k位点

gwas分析中根据显著性p值筛选上下游10k位点

作者:互联网

 

001、awk 实现

root@DESKTOP-1N42TVH:/home/test5/test# ls
pvalue.bed
root@DESKTOP-1N42TVH:/home/test5/test# cat pvalue.bed  ## 第一列染色体, 二列pos, 三列p
Chr1    1570052 3.6112E-10
Chr1    5188622 5.6283E-8
Chr1    5188673 4.6785E-8
Chr5    3646289 6.8643E-8
Chr5    3646322 7.3506E-8
Chr5    3646326 5.6297E-8
Chr8    26818268        2.1217E-11
Chr8    26818278        4.1958E-11
Chr8    26825376        5.9121E-13
root@DESKTOP-1N42TVH:/home/test5/test# awk '{print $1, $2 - 1 - 10000, $2 - 1, $3; print $1, $2 + 1, $2 + 1 + 10000, $3}' pvalue.bed
Chr1 1560051 1570051 3.6112E-10        ## 提取上下游10k
Chr1 1570053 1580053 3.6112E-10
Chr1 5178621 5188621 5.6283E-8
Chr1 5188623 5198623 5.6283E-8
Chr1 5178672 5188672 4.6785E-8
Chr1 5188674 5198674 4.6785E-8
Chr5 3636288 3646288 6.8643E-8
Chr5 3646290 3656290 6.8643E-8
Chr5 3636321 3646321 7.3506E-8
Chr5 3646323 3656323 7.3506E-8
Chr5 3636325 3646325 5.6297E-8
Chr5 3646327 3656327 5.6297E-8
Chr8 26808267 26818267 2.1217E-11
Chr8 26818269 26828269 2.1217E-11
Chr8 26808277 26818277 4.1958E-11
Chr8 26818279 26828279 4.1958E-11
Chr8 26815375 26825375 5.9121E-13
Chr8 26825377 26835377 5.9121E-13

 

002、bedtools实现

root@DESKTOP-1N42TVH:/home/test5/test# ls
all.con.fa.fai  pvalue.bed
root@DESKTOP-1N42TVH:/home/test5/test# cat pvalue.bed  ## 第一列染色体,二列pos,三列pos,四列p值
Chr1    1570052 1570052 3.6112E-10
Chr1    5188622 5188622 5.6283E-8
Chr1    5188673 5188673 4.6785E-8
Chr5    3646289 3646289 6.8643E-8
Chr5    3646322 3646322 7.3506E-8
Chr5    3646326 3646326 5.6297E-8
Chr8    26818268        26818268        2.1217E-11
Chr8    26818278        26818278        4.1958E-11
Chr8    26825376        26825376        5.9121E-13
root@DESKTOP-1N42TVH:/home/test5/test# cat all.con.fa.fai   ## samtools faidx file.fasta 生成
Chr1    43270923        6       50      51
Chr2    35937250        44136354        50      51
Chr3    36413819        80792356        50      51
Chr4    35502694        117934458       50      51
Chr5    29958434        154147212       50      51
Chr6    31248787        184704821       50      51
Chr7    29697621        216578590       50      51
Chr8    28443022        246870170       50      51
Chr9    23012720        275882059       50      51
Chr10   23207287        299355041       50      51
Chr11   29021106        323026481       50      51
Chr12   27531856        352628017       50      51
ChrUn   633585  380710518       60      61
ChrSy   592136  381354670       60      61
root@DESKTOP-1N42TVH:/home/test5/test# bedtools flank  -i pvalue.bed  -b 10000  -g all.con.fa.fai
Chr1    1560051 1570051 3.6112E-10       ## 提取上下游 10k
Chr1    1570053 1580053 3.6112E-10
Chr1    5178621 5188621 5.6283E-8
Chr1    5188623 5198623 5.6283E-8
Chr1    5178672 5188672 4.6785E-8
Chr1    5188674 5198674 4.6785E-8
Chr5    3636288 3646288 6.8643E-8
Chr5    3646290 3656290 6.8643E-8
Chr5    3636321 3646321 7.3506E-8
Chr5    3646323 3656323 7.3506E-8
Chr5    3636325 3646325 5.6297E-8
Chr5    3646327 3656327 5.6297E-8
Chr8    26808267        26818267        2.1217E-11
Chr8    26818269        26828269        2.1217E-11
Chr8    26808277        26818277        4.1958E-11
Chr8    26818279        26828279        4.1958E-11
Chr8    26815375        26825375        5.9121E-13
Chr8    26825377        26835377        5.9121E-13

 

标签:11,10k,gwas,显著性,Chr1,51,Chr5,Chr8,50
来源: https://www.cnblogs.com/liujiaxin2018/p/16491549.html