Skip to content

Instantly share code, notes, and snippets.

@sahilseth
Last active May 5, 2018 21:21
Show Gist options
  • Save sahilseth/ad69c010f9ad2ae6f571 to your computer and use it in GitHub Desktop.
Save sahilseth/ad69c010f9ad2ae6f571 to your computer and use it in GitHub Desktop.
bioawk/flowr tutorial
# install this cool tools from Heng Li (https://github.com/lh3/bioawk)
brew install bioawk
# information regarding exit_code:
# - NA: not started yet
# show lines where job started and had errors
bioawk -tc hdr '{if($exit_code!=0 && $started=="TRUE") print $jobname, $cmd, $exit_code}' flow_details.txt
# show lines which did not start
bioawk -tc hdr '{if($started=="FALSE") print $jobname, $cmd, $exit_code}' flow_details.txt
# started, but have not finished yet (no exit status yet)
bioawk -tc hdr '{if($started=="TRUE" && $exit_code==-1) print $jobname, $cmd, $exit_code}' flow_details.txt
# get the 3rd column, cut -f3 and re-submit the jobs
jobs=$(bioawk -tc hdr '{if($exit_code!=0 && $started=="TRUE") print $jobname, $cmd, $exit_code}' flow_details.txt | cut -f2)
echo $jobs
# this will work, provided there were no pre requisite jobs
for j in $jobs; do bsub < $j; done
# END
@sahilseth
Copy link
Author

# resubmission ex
 bsub -M 60384 -R rusage[mem=60384] < cnt_cmd_66.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment