modifygffforclc_gw.pl
#!/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: 2021/03/17 13:09 by 127.0.0.1