Mercurial > repos > pcingola > snpeff
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/snpEff_2_1a/snpEff_2_1a/scripts/data/rice5/mRnaAddParent.pl Fri Apr 20 11:22:59 2012 -0400 @@ -0,0 +1,28 @@ +#!/usr/bin/perl + +#------------------------------------------------------------------------------- +# Add 'Parent' option in mRNA lines +# +# Pablo Cingolani +#------------------------------------------------------------------------------- + +while( $l = <STDIN> ) { + chomp $l; + @t = split /\t/,$l; + + $type = $t[2]; + + # Is it an mRNA? + if( $type eq 'mRNA' ) { + # Parse ID in options + $opts = $t[8]; + if( $opts =~ /ID=(.*?)-\d+;/ ) { + $pid = $1; + $pid =~ tr/t/g/; + # Add 'Parent' option + $l .= ";Parent=$pid"; + } + } + + print "$l\n"; +}