SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem submitting job to queue seq_newbie Bioinformatics 2 07-13-2011 05:47 AM
GATK Queue and options kasthuri Bioinformatics 2 06-10-2011 08:57 AM
Cufflinks, BWA and MACS on SGE Rachelly Bioinformatics 0 04-07-2011 03:12 AM
BFAST submission to SGE script rdeborja Bioinformatics 6 03-01-2011 10:14 AM
Galaxy configuration with SGE cluster mpiro Bioinformatics 2 11-18-2010 10:34 AM

Reply
 
Thread Tools
Old 12-04-2009, 05:38 PM   #1
inesdesantiago
Member
 
Location: LONDON, UNITED KINGDOM

Join Date: Jan 2009
Posts: 44
Default RNA-MATE in an SGE queue manager

Hello
I am trying to use RNA-MATE in a computer cluster with an SGE queue manager. In RNA-MATE v1.1 user guide, the user is instructed to change a couple of things in the RNA-mapping.pm perl script.

But I can't understand what I am supposed to change.
citing the user guide:

Quote:
line 325 which reads:
Code:
print OUT $comm;
should be changed to include the “#$/bin/sh” line, and a newline after the actual command needs
to be inserted.
But what does this mean exactly in terms of changing the script?
Where should one include the “#$/bin/sh” line? Before the 325 line? And what is the right syntax, what should one write in the script to include “#$/bin/sh”?

I am posting also part of the script (from line 296 to 338)
Code:
sub mapping{
	my ($argv, $tag_file_name,$map_para, $f_genome) = @_;
       #check the log file before run mapping
        if( $toolobj->check_died() < 0 ){ return -1 }
	my $str = substr($f_genome,rindex($f_genome,'/')+1);
	my ($lib_name,$str1) = split(/\./,$str); 

        # check input file,if input file is zero size, we jump over the mapping process and create an zero size output file.
	my $tag_file = $argv->{'outdir'} . $tag_file_name;
        if( !(-e $tag_file) ){ $toolobj->Log_DIED("file: $tag_file, is not exist! \n"); return -1   }
	my $output = $argv->{outdir}. "$lib_name.$tag_file_name.ma.$map_para->[0].$map_para->[1]";
        if($map_para->[2] == 1) { $output .= ".adj_valid" }
        elsif($map_para->[2] == 2) {$output .= ".adj_all" }

        if( -z $tag_file ){
                $toolobj->Log_WARNING("no tag for genome mapping in $tag_file!\n");
                #create empty files
                open(IN, ">$output");
                close(IN);
                return 1;
        }

        #call mapread program
        my $mymask =  substr($argv->{mask},0,$map_para->[0]);
        my $comm = "$argv->{f2m} -program $argv->{mapreads}  -g  $f_genome ";
        $comm .= "-r $tag_file -d $argv->{outdir} -t $map_para->[0] ";
        $comm .= "-e $map_para->[1] -z $argv->{max_hits} -p $mymask -a $map_para->[2] ";
        my $mysh = "$output.sh";
        open(OUT,">$mysh") or $toolobj->Log_DIED("can't open file $mysh");
        print OUT $comm;
        close(OUT);

        my $success_file = "$output.success";

	#debug
	#$comm = "sh $mysh";
       	$comm = "qsub -l walltime=48:00:00 -o $mysh.out -e $mysh.err $mysh > $mysh.id ";

        my $rc = system($comm);
        my %hash = ($success_file => $rc);

        return %hash;
}
Thank you for your help!
I don't know much about perl, so please remmember this when replying to me...
inesdesantiago is offline   Reply With Quote
Old 12-05-2009, 04:08 AM   #2
dawe
Senior Member
 
Location: 45°30'25.22"N / 9°15'53.00"E

Join Date: Apr 2009
Posts: 258
Default

Hello there,
Never used RNA-MATE but...

Quote:
Originally Posted by inesdesantiago View Post

Code:
        my $comm = "$argv->{f2m} -program $argv->{mapreads}  -g  $f_genome ";
        $comm .= "-r $tag_file -d $argv->{outdir} -t $map_para->[0] ";
        $comm .= "-e $map_para->[1] -z $argv->{max_hits} -p $mymask -a $map_para->[2] ";
        my $mysh = "$output.sh";
        open(OUT,">$mysh") or $toolobj->Log_DIED("can't open file $mysh");
        print OUT $comm;
        close(OUT);

        my $success_file = "$output.success";

	#debug
	#$comm = "sh $mysh";
       	$comm = "qsub -l walltime=48:00:00 -o $mysh.out -e $mysh.err $mysh > $mysh.id ";

        my $rc = system($comm);
The perl code builds a bash script to be queued in SGE. the variable $comm contains all the instructions to run RNA-MATE. You may either add this line before 325:

Code:
print OUT "#$/bin/sh\n\n";
or modify the $comm construction to have "#$/bin/sh" at the beginning of the string.
Also, I don't know which SGE version you are using, but AFAIK the correct syntax to specify SGE shell is not the one suggested. I believe the correct patch should be:

Code:
print OUT "#$ -S /bin/sh\n\n";
For the same reason you may also make the whole thing work not adding that line at all but simply modifying the "exec" line below like this:


Code:
       	$comm = "qsub -S /bin/sh -l walltime=48:00:00 -o $mysh.out -e $mysh.err $mysh > $mysh.id ";
which is much more clear to me :-)


HTH
d
dawe is offline   Reply With Quote
Old 12-14-2009, 05:01 PM   #3
inesdesantiago
Member
 
Location: LONDON, UNITED KINGDOM

Join Date: Jan 2009
Posts: 44
Default

Hi dawe!
Thanks for the reply! I tried with your last suggestions

Code:
$comm = "qsub -S /bin/sh -l walltime=48:00:00 -o $mysh.out -e $mysh.err $mysh > $mysh.id ";
and it worked perfectly. I would never be able to think about the -S thing by myself, so thank you!

Just a small note for whoever reads this post:
for SGE systems the "walltime=48:00:00" has to be changed as well (this is refered in the user guide and has to be changed to "s_rt=48:00:00"), i.e, the full line I used and that worked was:

Code:
$comm = "qsub -S /bin/sh -l s_rt=48:00:00 -o $mysh.out -e $mysh.err $mysh > $mysh.id ";
Thanks!
Ines
inesdesantiago is offline   Reply With Quote
Reply

Tags
rna-mate sge

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 04:29 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO