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 revisionPrevious revision
Next revision
Previous revision
modifygffforclc_gw.pl [2017/01/24 11:36] hyjeongmodifygffforclc_gw.pl [2021/03/17 13:09] (current) – external edit 127.0.0.1
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 
 +  }
  
 +