comparison lib/convert_nr_2_annot.pl @ 0:1437a2df99c0

Uploaded
author jesse-erdmann
date Fri, 09 Dec 2011 11:56:56 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:1437a2df99c0
1 #This script annotates genomic positions to genes for ingenuity analyses.
2 #Aaron Sarver November 15, 2010
3 #version #1.0
4
5 $in =$ARGV[0];
6 $out = $ARGV[1];
7
8 @lib_list=();
9 %seen=();
10
11 @uniq = ();
12 $libstring = '';
13
14
15
16 #open SOURCE, "< Med-nr-7-0.01.txt";
17 open SOURCE, "< $in";
18 open OUT, "> CIS/input.txt";
19 open FIN, "> $out";
20 while (defined($line = <SOURCE>)) {
21 $count++;
22 chomp $line;
23 @field= split(/\t/, $line);
24 $start = $field[1]-50;
25 $stop = $field[1]+50;
26
27 print OUT "$field[0]\t$start\t$stop\n";
28 }
29 close OUT;
30
31 system('perl lib/feature_finder.pl -i CIS/input.txt -icol 1:2:3:6:13 -f lib/mm9.bed -o CIS/input2.txt');
32
33
34 open SOURCE, "< CIS/input2.txt";
35 while (defined($line = <SOURCE>)) {
36 $count++;
37 chomp $line;
38 @field= split(/\t/, $line);
39 #print "$field[0]\n";
40 @genes= split(/,\s/,$field[3]);
41 foreach $gene (@genes) {
42 #print "$gene\n";
43 push (@lib_list,$gene);
44 }
45 }
46
47
48 foreach $item (@lib_list) {
49 unless ($seen{$item}) {
50 $seen{$item}= 1;
51 push(@uniq,$item)
52 }
53
54 }
55
56 #open OUT, "> ingenuity_nr.txt";
57 foreach $item(@uniq) {
58
59 print FIN "$item\t10\n";
60
61 }
62 close FIN;