Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
lee212 committed Feb 11, 2016
1 parent 944fe5c commit f99341f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
18 changes: 12 additions & 6 deletions mgescan/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import os, sys
from docopt import docopt
from multiprocessing import Process
from subprocess import Popen, PIPE
from subprocess import check_call, Popen, PIPE
from mgescan import utils
from mgescan.split import Split
import shutil
Expand Down Expand Up @@ -195,11 +195,17 @@ def run_cmd(self, cmd):
cmd = cmd % vars(self)
if self.debug:
print (cmd)
p = Popen(cmd.split(), stdout=PIPE, stderr=PIPE)
std_msgs = p.communicate()
if self.debug:
print std_msgs
return p
#p = Popen(cmd.split(), stdin=PIPE, stdout=PIPE, stderr=PIPE)
#std_msgs = p.communicate()
try:
retcode = check_call(cmd.split())
if retcode < 0:
print >>sys.stderr, "%s was terminated by signal" % cmd, -retcode
else:
print >>sys.stderr, "Returned", retcode
except OSError as e:
print >>sys.stderr, "Failed:", e
return retcode

def main():
arguments = docopt(__doc__, version='MGEScan 0.0.3')
Expand Down
2 changes: 1 addition & 1 deletion mgescan/ltr/toGFF.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

if len(sys.argv) < 3:
print sys.argv[0], "LTRout new-GFF-file"
sys.exit()
sys.exit()

infile = open(sys.argv[1], "r")
outfile = open(sys.argv[2], "w")
Expand Down
6 changes: 0 additions & 6 deletions mgescan/nonltr/post_process2.pl
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,6 @@ sub get_domain_dna_seq{
#system("hmmsearch --noali --domtblout ".$hmm_dir."tbl ".$_[1]."3 ".$_[0]." > /dev/null");
my $command = ("hmmsearch --noali --domtblout ".$tmpfile." ".$_[1]."3 ".$_[0]." > /dev/null");
print $command if ($debug);
if ($debug && not prompt_yn("Continue?")) {
exit;
}
system($command);
#my $hmm_command = "cat ".$hmm_dir."tbl";
#my $hmm_result = `$hmm_command`;
Expand Down Expand Up @@ -472,9 +469,6 @@ sub vote_hmmsearch{
my $command = ("hmmsearch --noali --domtblout ".$tmpfile." ".$_[1].$line[$i].".".$_[2].".hmm3 ".$_[0]." > /dev/null");
system($command);
print $command if ($debug);
if ($debug && not prompt_yn("Continue?")) {
exit;
}
#my $command = "cat ".$hmm_dir."tbl";
#my $hmm_result = `$command`;
local $/ = undef;
Expand Down
8 changes: 8 additions & 0 deletions mgescan/nonltr/run_hmm.pl
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@
# MGEScan -m ./hmm/chr.hmm -s ./aaa/NC_003070.9.fa -r ./test/f/pos/NC_003070.9.fa.rt.pos -a ./test/f/pos/NC_003070.9.fa.ape.pos -o ./test/f/out1/NC_003070.9.fa -p ./ -d ./test/f/out1/ -v 3
$command = $pdir."hmm/MGEScan -m ".$pdir."hmm/chr.hmm -s ".$dna_file." -r ".$domain_rt_pos_file." -a ".$domain_ape_pos_file." -o ".$out_file." -p ".$pdir." -d ".$out1_dir." -v ".$hmmerv;
print $command."\n" if ($debug);
if ($debug && not prompt_yn("Continue?")) {
exit;
}
system($command);
}

Expand Down Expand Up @@ -117,6 +120,11 @@ sub get_signal_domain{
if ($hmmerv == 3){
#system("hmmconvert ".${$_[1]}." > ".${$_[1]}."c");
my $hmm_command = "hmmsearch -E 0.00001 --noali --domtblout ".$tmpfile." ".${$_[1]}."3 ".${$_[0]}." > /dev/null";
print $hmm_command if ($debug);
if ($debug && not prompt_yn("Continue?")) {
exit;
}

system($hmm_command);
#$hmm_command = "cat ".$tmpfile;
local $/ = undef;
Expand Down

0 comments on commit f99341f

Please sign in to comment.