001、
[b20223040323@admin1 test]$ ls ## 测试gff文件 exons_only.gff [b20223040323@admin1 test]$ gff2bed <exons_only.gff > exons_only.bed ## gff2bed模块转换 Warning: If your Wiggle data is a significant portion of available system memory, use the --max-mem and --sort-tmpdir options, or use --do-not-sort to disable post-conversion sorting. See --help for more information. [b20223040323@admin1 test]$ ls ## 转换结果 exons_only.bed exons_only.gff [b20223040323@admin1 test]$ awk -F "\t" '{OFS = "\t"; print $1, $4 - 1, $5, $6, $8, $7, $2, $3, ".", $NF}' exons_only.gff > tem.gff ## 列的重排, [b20223040323@admin1 test]$ cut -f 1 tem.gff | sort | uniq | while read i; do grep $i tem.gff | sort -k 2n -k 3n >> result.bed; done ## 排序 [b20223040323@admin1 test]$ ls ## 结果文件 exons_only.bed exons_only.gff result.bed tem.gff [b20223040323@admin1 test]$ diff exons_only.bed result.bed ## 比较gff2bed模块和shell脚本的结果, 有一行差异?? 54392c54392 < NC_052532.1 67271350 67271351 . . - Gnomon exon .ID=exon-XM_015290272.4-6;Parent=rna-XM_015290272.4;Dbxref=GeneID:418207,Genbank:XM_015290272.4,CGNC:10484;experiment=COORDINATES: cap analysis [ECO:0007248] and polyA evidence [ECO:0006239];gbkey=mRNA;gene=KRAS;product=KRAS proto-oncogene%2C GTPase%2C transcript variant X3;transcript_id=XM_015290272.4;zero_length_insertion=True --- > NC_052532.1 67271350 67271351 . . - Gnomon exon .ID=exon-XM_015290272.4-6;Parent=rna-XM_015290272.4;Dbxref=GeneID:418207,Genbank:XM_015290272.4,CGNC:10484;experiment=COORDINATES: cap analysis [ECO:0007248] and polyA evidence [ECO:0006239];gbkey=mRNA;gene=KRAS;product=KRAS proto-oncogene%2C GTPase%2C transcript variant X3;transcript_id=XM_015290272.4
原文地址:http://www.cnblogs.com/liujiaxin2018/p/16884190.html
1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!
2. 分享目的仅供大家学习和交流,请务用于商业用途!
3. 如果你也有好源码或者教程,可以到用户中心发布,分享有积分奖励和额外收入!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 如遇到加密压缩包,默认解压密码为"gltf",如遇到无法解压的请联系管理员!
8. 因为资源和程序源码均为可复制品,所以不支持任何理由的退款兑现,请斟酌后支付下载
声明:如果标题没有注明"已测试"或者"测试可用"等字样的资源源码均未经过站长测试.特别注意没有标注的源码不保证任何可用性