gff文件_如何提取gff文件中的基因注释信息

gff文件_如何提取gff文件中的基因注释信息原标题 如何提取 gff 文件中的基因注释信息 gff3 格式注释文件是最常见的基因注释 https archive broadinstitu org annotation argo help gff3 html 简单来说 gff3 是以 tab 分隔的文本文件 共有 9 列 对应信息如下 1 seqnameThena Typicallyach

原标题:如何提取gff文件中的基因注释信息

gff3格式注释文件是最常见的基因注释,(https://archive.broadinstitute.org/annotation/argo/help/gff3.html)

简单来说,gff3是以tab分隔的文本文件,共有9列,对应信息如下:

1、seqname

The name of the sequence. Typically a chromosome or a contig. Argo does not care what you put here. It will superimpose gff features on any sequence you like.

2、source

The program that generated this feature. Argo displays the value of this field in the inspector but does not do anything special with it.

3、feature

The name of this type of feature. The official GFF3 spec states that this should be a term from the SOFA ontology, but Argo does not do anything with this value except display it.

4、start

The starting position of the feature in the sequence. The first base is numbered 1.

5、end

The ending position of the feature (inclusive).

6、score

A score between 0 and 1000. If there is no score value, enter “.”.

7、strand

Valid entries include ‘+’, ‘-‘, or ‘.’ (for don’t know/don’t care).

8、frame

If the feature is a coding exon, frame should be a number between 0-2 that represents the reading frame of the first base. If the feature is not a coding exon, the value should be ‘.’. Argo does not do anything with this field except display its value.

9、GFF3: grouping attributes

Attribute keys and values are separated by ‘=’ signs. Values must be URI encoded.quoted. Attribute pairs are separated by semicolons. Certain, special attributes are used for grouping and identification (See below). This field is the one important difference betweenGFF flavor

(https://archive.broadinstitute.org/annotation/argo/help/gff.html).

在进行生物信息分析的时候,常需要把gene的注释信息(第9列)提取出来附加到差异基因或目的基因的表格结果中,但第9列的注释信息通常较多,且不同基因含部分注释信息不全部一致,一般我们只需要部分重要的a信息,如Dbxref、gene_biotype、deion。

本文以ncbi上发布的人类GRCh38.p7版本注释文件为示例,使用awk命令进行该操作。

(https://www.gnu.org/software/gawk/manual/gawk.html)

1、下载目的物种注释文件:

(ftp://ftp.ncbi.nlm.nih.gov/genomes/all/GCF_000001405.33_GRCh38.p7/GCF_000001405.33_GRCh38.p7_genomic.gff.gz)

然后对GCF_000001405.33_GRCh38.p7_genomic.gff.gz进行解压操作,

得到解压文GCF_000001405.33_GRCh38.p7_genomic.gff;

2、查看第9列有哪些注释信息:

$ awk ‘BEGIN{FS=OFS=”\t”} $3==”gene”{split($9, a, “;”); for(i in a){split(a[i], b, “=”); if(++c[b[1]]==1) print b[1]}}’ GCF_000001405.33_GRCh38.p7_genomic.gff

运行显示结果有:

ID、Dbxref、Name、deion

gbkey、gene、gene_biotype、pseudo、gene_synonym、partial、start_range、end_range

exception、Note

然后使用以下命令查看gff3文件中的结果:

$ awk -F “\t” ‘$3==”gene”{print $9}’ GCF_000001405.33_GRCh38.p7_genomic.gff | cat -n | less

可以看到

gff文件_如何提取gff文件中的基因注释信息

3、下面使用awk进行基因注释信息提取(以提取Dbxref、gene_biotype、deion信息为例):

$ awk ‘BEGIN{FS=OFS=”\t”} $3==”gene”{print $0}’ GCF_000001405.33_GRCh38.p7_genomic.gff |

sed ‘s/;/\t/g’ |

awk ‘BEGIN{FS=OFS=”\t”} {for(i=1; i<=NF; i++){split($i, a, “=”);

b[a[1]]=a[2]}} {print b[“Name”],b[“Dbxref”],b[“gene_biotype”],b[“deion”]}

{split(“”, b, “:”)}’

终端显示的提取信息(tab分隔,依次为Name、Dbxref、gene_biotype、deion):

gff文件_如何提取gff文件中的基因注释信息

说明:部分基因不包含某些注释信息,如LOC基因没有deion信息,则在对应列为空字符。

4、对应终端打印的提取信息,可以添加表头和生成文件,同时对应部分出现在多个染色体的基因在第1列会重复,请对3中的结果进行以下操作即可:

$ sed ‘1i Name\tDbxref\tgene_biotype\tdeion’ | awk -F “\t” ‘++a[$1]==1’返回搜狐,查看更多

责任编辑:

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/232662.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • https免费证书(终身)申请和安装教程[通俗易懂]

    https免费证书(终身)申请和安装教程[通俗易懂]目前来说,网站安装https是大势所趋,几乎每一个网站在建站之初,就会安装好https。一、https是什么“https(全称:HyperTextTransferProtocoloverSecureSocketLayer,超文本传输安全协议),是以安全为目标的HTTP通道,是HTTP的扩展(升级版),用于计算机网络的安全通信”——维基百科简单理解为:在http的基础上,增加安全套接字层(SSL),既可以变成https,作用就是让网站数据传输更加安全。如图所…

    2025年7月24日
    3
  • Java学习之struts2使用

    Java学习之struts2使用0x00前言持续记录学习内容0x01struts2使用导入ja包<dependencies><dependency><

    2021年12月13日
    45
  • TiKV 源码解析系列文章(十三)MVCC 数据读取

    TiKV 源码解析系列文章(十三)MVCC 数据读取作者:施闻轩在《TiKV源码解析系列文章(十二)分布式事务》中,我们介绍了如何在满足事务特性的要求下进行数据写入。本文将介绍数据读取的流程。由于顺序扫(ForwardScan)比较具有代表性,因此本文只介绍顺序扫的流程,而不会介绍点查或逆序扫。点查是顺序扫的简化,相信读者理解了顺序扫的流程后能自己想出点查的实现,而逆序扫与顺序扫也比较类似,主要区别在于从后向前扫,稍复杂一些,相信大家在阅…

    2022年9月23日
    4
  • Android物联网应用程序开发(智慧园区)—— 设置传感器阈值对话框界面

    Android物联网应用程序开发(智慧园区)—— 设置传感器阈值对话框界面效果图:自定义对话框布局:<?xmlversion=”1.0″encoding=”utf-8″?><LinearLayoutxmlns:android=”http://schemas.android.com/apk/res/android”android:layout_width=”350dp”android:layout_height=”wrap_content”andro

    2022年6月21日
    21
  • apache2.2 虚拟主机配置

    apache2.2 虚拟主机配置

    2021年12月10日
    48
  • 排序二叉树的实现

    排序二叉树的实现在计算机科学中,二叉树是一种重要的非线性的数据结构。每个结点的度均小于等于2,通常子树称为左子树和右子树。而排序二叉树是二叉树中的一种,其满足:1.如左子树不为空,那么左子树上的结点的值都小于其根上的值;2.如右子树不为空,那么右子树上的结点的值都大于其根上的值;3.其子树也是一个排序二叉树。下面用递归的方式来插入一个结点来满足上述的要求:typedefstructNode{

    2022年7月25日
    10

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号