-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeme.pl
62 lines (54 loc) · 1.48 KB
/
meme.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/perl
######## FuzzyAPP #####################
# Developed by SARAVANAN VIJAYAKUMAR
# Centre for Bioinformatics, Pondicherry University
# Date: 14-2-2013
#
######Required Modules
####
my $PATH_EXE = "/home/user/Documents/Softwares/FuzzyApp-master/";
my $Seq_In = @ARGV[0];
$Seq_In=~s/\s//g;
#End !
#Path setting for MEME_OUT and others in temp
$meme_out_path = $PATH_EXE.&generate_random_string(8);
$meme_out_path1 = $meme_out_path.'/query';
##Create directory for memeout
`mkdir $meme_out_path`;
####End!
###Save sequence
open(TTT,">$meme_out_path1");
print TTT ">test\n$Seq_In";
close(TTT);
####End!
#####Run MAST
$trig = $PATH_EXE.'meme/src/mast';
$trigmast = $PATH_EXE."meme.txt";
$trig=~s/\n//g;
$M_O = `$trig $trigmast $meme_out_path1 -oc $meme_out_path -hit_list`;
#open(TTT,"$meme_out_path/mast.txt");
#my @MAST_OUT = <TTT>;
#my $M_O = join('',@MAST_OUT);
#$M_O=~s/\n/\@/g;
#$M_O =~m/\*\@\@\@test(.*)\*/g;
#$M_O= $1;
#$M_O=~s/\@/\n/g;
print $M_O;
`rm -rf $meme_out_path`;
#End!
#Random Fiel name generator
sub generate_random_string
{
my $length_of_randomstring=shift;# the length of
# the random string to generate
my @chars=('a'..'z','A'..'Z','0'..'9');
my $random_string;
foreach (1..$length_of_randomstring)
{
# rand @chars will generate a random
# number between 0 and scalar @chars
$random_string.=$chars[rand @chars];
}
return $random_string;
}