diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Tools/Motif_search/motif_search_galaxy.pl	Mon Sep 05 06:01:48 2016 -0400
@@ -0,0 +1,56 @@
+#!/usr/bin/perl -w
+$|=1;
+use warnings;
+use strict;
+
+#Script that returns the lines of a gff file according to the ID motifs that we want.
+
+
+
+my $motif=" ";
+my @motifs;
+my $line;
+my @cols;
+my $motif_fimo;
+
+if ($ARGV[3] ne "#"){
+    push  @motifs, $ARGV[3];
+}
+if ($ARGV[4] ne "#"){
+    push  @motifs, $ARGV[3];
+}
+if ($ARGV[5] ne "#"){
+    push  @motifs, $ARGV[3];
+}
+if ($ARGV[6] ne "#"){
+    push  @motifs, $ARGV[3];
+}
+
+
+
+
+
+open(FIMO, "<$ARGV[0]") ||
+    die "File '$ARGV[0]' not found\n";
+open(OUTPUT, ">$ARGV[1]") ||
+    die "File '>$ARGV[1]' not found\n";
+
+while (<FIMO>) {
+    foreach my $tf (@motifs){
+    $line= $_;
+    chomp $line;
+    @cols=split;
+    if ($line=~/^#/){
+        printf OUTPUT "%s\n", " ";
+    }
+    elsif ($line!~/^##/ and $tf eq (substr $cols[8],5,8)) {
+        
+            printf OUTPUT "%s\n", $line;
+        
+        
+        
+    }
+    }
+    
+    
+}
\ No newline at end of file