Created
October 17, 2012 15:54
-
-
Save ChemicalJames/3906331 to your computer and use it in GitHub Desktop.
HW3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!bin/perl | |
use strict; | |
# number of 3'UTR | |
open(IN, "grep -c 'three_prime' ath_chr1.gff | ") || die $!; | |
while(my $count = <IN>) { | |
open(my $outfh => "UTR.txt") || die $!; | |
print $outfh "$count\n"; | |
} | |
# number of introns | |
my $fh = "ath_chr1.gff"; | |
open(my $fh => 'ath_chr1.gff') || die $!; | |
while (<$fh>) { | |
chomp; | |
my @cols = split("\t",$_), $fh; | |
my ( $l, $r ) = ( 0, 0 ); | |
for ( $l = 0 ; $l <= $#cols ;) { | |
for ( $r = 0 ; $r <= $#cols ;) { | |
open(my $outfh => "intron.txt") || die $!; | |
print $outfh "$cols[$l] - $cols[$r], "\n""; | |
} | |
} | |
} | |
# avg length of genes | |
#still working on this one | |
cat UTR.txt intron.txt length.txt > ath_chr1_stats.txt | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment