Mercurial > repos > jesse-erdmann > tapdance
view lib/convert_nr_2_annot.pl @ 3:17ce4f3bffa2 default tip
Uploaded
author | jesse-erdmann |
---|---|
date | Tue, 24 Jan 2012 18:33:41 -0500 |
parents | 1437a2df99c0 |
children |
line wrap: on
line source
#This script annotates genomic positions to genes for ingenuity analyses. #Aaron Sarver November 15, 2010 #version #1.0 $in =$ARGV[0]; $out = $ARGV[1]; @lib_list=(); %seen=(); @uniq = (); $libstring = ''; #open SOURCE, "< Med-nr-7-0.01.txt"; open SOURCE, "< $in"; open OUT, "> CIS/input.txt"; open FIN, "> $out"; while (defined($line = <SOURCE>)) { $count++; chomp $line; @field= split(/\t/, $line); $start = $field[1]-50; $stop = $field[1]+50; print OUT "$field[0]\t$start\t$stop\n"; } close OUT; system('perl lib/feature_finder.pl -i CIS/input.txt -icol 1:2:3:6:13 -f lib/mm9.bed -o CIS/input2.txt'); open SOURCE, "< CIS/input2.txt"; while (defined($line = <SOURCE>)) { $count++; chomp $line; @field= split(/\t/, $line); #print "$field[0]\n"; @genes= split(/,\s/,$field[3]); foreach $gene (@genes) { #print "$gene\n"; push (@lib_list,$gene); } } foreach $item (@lib_list) { unless ($seen{$item}) { $seen{$item}= 1; push(@uniq,$item) } } #open OUT, "> ingenuity_nr.txt"; foreach $item(@uniq) { print FIN "$item\t10\n"; } close FIN;