Mercurial > repos > amadeo > amadeo
comparison Tools/Motif_search/motif_search_galaxy.pl @ 3:b30ba2b06326 draft
Uploaded
author | amadeo |
---|---|
date | Mon, 05 Sep 2016 06:01:48 -0400 |
parents | 229d36377838 |
children |
comparison
equal
deleted
inserted
replaced
2:607d7bdfb07f | 3:b30ba2b06326 |
---|---|
1 #!/usr/bin/perl -w | |
2 $|=1; | |
3 use warnings; | |
4 use strict; | |
5 | |
6 #Script that returns the lines of a gff file according to the ID motifs that we want. | |
7 | |
8 | |
9 | |
10 my $motif=" "; | |
11 my @motifs; | |
12 my $line; | |
13 my @cols; | |
14 my $motif_fimo; | |
15 | |
16 if ($ARGV[3] ne "#"){ | |
17 push @motifs, $ARGV[3]; | |
18 } | |
19 if ($ARGV[4] ne "#"){ | |
20 push @motifs, $ARGV[3]; | |
21 } | |
22 if ($ARGV[5] ne "#"){ | |
23 push @motifs, $ARGV[3]; | |
24 } | |
25 if ($ARGV[6] ne "#"){ | |
26 push @motifs, $ARGV[3]; | |
27 } | |
28 | |
29 | |
30 | |
31 | |
32 | |
33 open(FIMO, "<$ARGV[0]") || | |
34 die "File '$ARGV[0]' not found\n"; | |
35 open(OUTPUT, ">$ARGV[1]") || | |
36 die "File '>$ARGV[1]' not found\n"; | |
37 | |
38 while (<FIMO>) { | |
39 foreach my $tf (@motifs){ | |
40 $line= $_; | |
41 chomp $line; | |
42 @cols=split; | |
43 if ($line=~/^#/){ | |
44 printf OUTPUT "%s\n", " "; | |
45 } | |
46 elsif ($line!~/^##/ and $tf eq (substr $cols[8],5,8)) { | |
47 | |
48 printf OUTPUT "%s\n", $line; | |
49 | |
50 | |
51 | |
52 } | |
53 } | |
54 | |
55 | |
56 } |