Advertisement

gff3转换

阅读量:

由gmap软件生成的gff3格式文件无法直接作为gffcompare工具的输入数据,因此必须进行格式转换。转换过程较为简单,仅需移除其中的target字段即可完成。

复制代码
    #!/usr/bin/env python
    # -*- coding: utf-8 -*- 
    __author__ = 'shengwei ma'
    __author_email__ = 'shengweima@icloud.com'
    
    with open('LYL_5A.gff3', 'r') as f:
    for line in f:
        line1 = line.strip().split('\t')
        if line1[2] == 'gene':
            print line,
        if line1[2] == 'mRNA':
            print line,
        if line1[2] == 'exon':
            new = line1[8].split(';')
            print '%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s;%s;%s\n' %(line1[0], line1[1], line1[2],l

全部评论 (0)

还没有任何评论哟~