Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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...

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


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

      • seqadmin
        Current Approaches to Protein Sequencing
        by seqadmin


        Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
        04-04-2024, 04:25 PM
      • seqadmin
        Strategies for Sequencing Challenging Samples
        by seqadmin


        Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
        03-22-2024, 06:39 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by seqadmin, 04-11-2024, 12:08 PM
      0 responses
      24 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-10-2024, 10:19 PM
      0 responses
      25 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-10-2024, 09:21 AM
      0 responses
      21 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-04-2024, 09:00 AM
      0 responses
      52 views
      0 likes
      Last Post seqadmin  
      Working...
      X