0

I am trying to obtain time stamps for each run analysis am doing on my samples for a jar program. It is a bioinformatics tool and I am using it to run on my samples however the time statistics are not showing up in the log. I have made use of the same command for running shell or bash programs and obtains the time statistics but with the jar my program is running but it is not giving the time frames for the different stamps I intend to obtain. Below is the piece of chunk am using, can anyone tell me how to make changes to obtain the the time statistics?

#!/bin/sh
#
#$ -N tigar2_run3
#$ -cwd
#$ -e err_tigar2_run3.txt
#$ -o out_tigar2_run3.txt
#$ -S /bin/sh
#$ -M vXXXXX.XX@xxx.com
#$ -m bea
#$ -l h_vmem=25G


REF_GENOME=/my_path/genomes/Homo_sapiens/NCBI_spiked/GRCh38/Sequence/RSEM.STAR/transcriptome.idx.fa
TIGAR2_LOC=/my_path/softwares/tigar2-master
TIGAR_OUT=/my_path/benchmark/QT/tigar
BAM_LOC=/my_path/benchmark/BAM/star.rsem

tf="\n%E elapsed,\n%U user,\n%S system, \n %P CPU, \n%M max-mem footprint in KB, \n%t avg-mem footprint in KB, \n%K Average total (data+stack+text) memory,\n%F major page faults, \n%I file system inputs by the process, \n%O file system outputs by the process, \n%r socket messages received, \n%s socket messages sent, \n%x status"

/my_path/softwares/time -f "$tf" java -Xmx14G -jar $TIGAR2_LOC/Tigar2_1.jar --thread_num 8 $REF_GENOME $BAM_LOC/AJ80.transcript.sorted.bam --is_paired --alpha_zero 0.1 $TIGAR_OUT/AJ80_out.txt

echo "done"

I am getting the output files but not the time statistics in my log

ivivek_ngs
  • 917
  • 3
  • 10
  • 28
  • Related? [Is there a way to redirect time output to file in Linux](http://stackoverflow.com/q/13356628/1983854) – fedorqui Aug 04 '15 at 10:49
  • it says to wrap the time command with the command line for unix and that is what I did but still cannot find any time stamps in my log file, does the time command does not wrap with jar command line? but it should since the execution is through bash – ivivek_ngs Aug 04 '15 at 11:03
  • It says to use `{ time sleep 1 ; } 2> time.txt`. Are you using that? – fedorqui Aug 04 '15 at 11:05
  • I am not using the redirection of the time to any output file but I am using the .txt as the run log for output and error which should capture what runs in the console if you are runnning interactively, so it captures all the log except the time statistics – ivivek_ngs Aug 04 '15 at 11:08
  • Basically out_tigar2_run3.txt should also capture the time statistics if it is capturing console run commands in the log – ivivek_ngs Aug 04 '15 at 11:09
  • Again: the output of `time` is not caught by either stdout or stderr, you have to use the `{ }` trick to be able to capture it. – fedorqui Aug 04 '15 at 11:11
  • ah ok.. thanks a lot. – ivivek_ngs Aug 04 '15 at 11:15
  • but how do I use it in my command to have it in the output log while the jar program is running? – ivivek_ngs Aug 04 '15 at 11:21
  • no worries, it is working, I am getting the time stamp in the err_* file am generating, thanks a lot – ivivek_ngs Aug 04 '15 at 11:23
  • 1
    `{ /my_path/softwares/time -f "$tf" java -Xmx14G -jar $TIGAR2_LOC/Tigar2_1.jar --thread_num 8 $REF_GENOME $BAM_LOC/AJ80.transcript.sorted.bam --is_paired --alpha_zero 0.1 $TIGAR_OUT/AJ80_out.txt; } &>your_output` should suffice. This will redirect stdout and stderr to `your_output` file. – fedorqui Aug 04 '15 at 11:23

0 Answers0