File: get_FL_accs.pl

package info (click to toggle)
transdecoder 3.0.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 11,356 kB
  • ctags: 274
  • sloc: perl: 5,454; sh: 81; makefile: 51
file content (31 lines) | stat: -rwxr-xr-x 646 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env perl

use strict;
use warnings;

my $usage = "\n\n\tusage: $0 transcripts.fasta.transdecoder.gff3\n\n\n";

my $gff3_file = $ARGV[0] or die $usage;


main: {

    open (my $fh, $gff3_file) or die $usage;
    while (<$fh>) {
        unless (/\w/) { next; }
        my @x = split(/\t/);
        my $type = $x[2];
        if ($type eq 'mRNA') {
            my $info = $x[8];
            if ($info =~ /complete/) {
                $info =~ /ID=([^;]+);/ or die "Error, cannot parse ID from $info";
                my $isoform_id = $1;
                print "$isoform_id\n";
            }
        }
    }
    close $fh;

    exit(0);
}