Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • inesdesantiago
    Member
    • Jan 2009
    • 44

    #1

    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:

    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...
  • dawe
    Senior Member
    • Apr 2009
    • 258

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

    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

    Comment

    • inesdesantiago
      Member
      • Jan 2009
      • 44

      #3
      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

      Comment

      Latest Articles

      Collapse

      • SEQadmin2
        Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
        by SEQadmin2



        Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

        Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
        ...
        10-14-2026, 09:55 AM
      • SEQadmin2
        New Genomics Technologies Take Aim at Long-Standing Limits
        by SEQadmin2


        Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

        We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
        ...
        09-28-2026, 10:25 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by SEQadmin2, 10-22-2026, 11:13 AM
      0 responses
      26 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 10-22-2026, 10:48 AM
      0 responses
      20 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 10-15-2026, 10:52 AM
      0 responses
      36 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 10-14-2026, 05:39 AM
      0 responses
      43 views
      0 reactions
      Last Post SEQadmin2  
      Working...