comparison snpEff_2_1a/snpEff_2_1a/scripts/data/rice5/mRnaAddParent.pl @ 3:c052639fa666 default tip

Uploaded
author pcingola
date Fri, 20 Apr 2012 11:22:59 -0400
parents
children
comparison
equal deleted inserted replaced
2:8d0de9212f4f 3:c052639fa666
1 #!/usr/bin/perl
2
3 #-------------------------------------------------------------------------------
4 # Add 'Parent' option in mRNA lines
5 #
6 # Pablo Cingolani
7 #-------------------------------------------------------------------------------
8
9 while( $l = <STDIN> ) {
10 chomp $l;
11 @t = split /\t/,$l;
12
13 $type = $t[2];
14
15 # Is it an mRNA?
16 if( $type eq 'mRNA' ) {
17 # Parse ID in options
18 $opts = $t[8];
19 if( $opts =~ /ID=(.*?)-\d+;/ ) {
20 $pid = $1;
21 $pid =~ tr/t/g/;
22 # Add 'Parent' option
23 $l .= ";Parent=$pid";
24 }
25 }
26
27 print "$l\n";
28 }