User Tools

Site Tools


modifygffforclc_gw.pl

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
modifygffforclc_gw.pl [2017/01/24 11:36]
hyjeong
modifygffforclc_gw.pl [2017/01/24 18:00] (current)
hyjeong
Line 1: Line 1:
 +  #​!/​usr/​bin/​perl
 +  # 
 +  # This script assumes that the input GFF file has only CDS/​tRNA/​rRNA/​tmRNA ​
 +  # features. It adds gene features to all of them, and also adds "​mRNA"​ features
 +  # to each CDSs.
 +  #
 +  #
 +  while (<>) {
 +    chomp;
 +    print $_, "​\n"​ if /^#/;
 +    last if /^##FASTA/ || /^>/;
 +  ​
 +    my @data = split /\t/, $_;
 +     
 +    if ($data[2] =~ /​(CDS|rRNA|tRNA|tmRNA)/​) {  # skip e.g. repeat_region
 +        $type = $1;
 +        $data[2] = '​gene';​
 +        print join "​\t",​ @data; print "​\n"; ​    # add gene feature
 +        ​
 +        if ($type eq '​CDS'​) {
 +            $data[2] = '​mRNA';​
 +            print join "​\t",​ @data; print "​\n";​
 +        }
 +    }
 +    print $_, "​\n"; ​  # print the original line 
 +  }
  
 +  ​
modifygffforclc_gw.pl.txt ยท Last modified: 2017/01/24 18:00 by hyjeong