Jobs currently on the SGE queue

qstat <- read_qstat()
qstat
# # A tibble: 2,119 x 13
#    job_number prio.x name             owner state.x submission_time     slots tasks.x prio.y state.y
#         <dbl>  <dbl> <chr>            <chr> <chr>   <dttm>              <int> <chr>    <dbl> <chr>  
#  1     198026  0.65  wt_D842Z_Z845D.1 owne… qw      2021-06-11 19:34:47     3 NA          NA NA     
#  2     198027  0.5   wt_D842Z_Z845D.2 owne… qw      2021-06-11 19:34:47     3 NA          NA NA     
#  3     198028  0.41  wt_D842Z_Z845D.3 owne… qw      2021-06-11 19:34:47     3 NA          NA NA     
#  4    3050724  0.365 relioncpu        owne… Eqw     2021-04-11 00:22:52   100 NA          NA NA     
#  5     127221  0.232 relion4GPU-11G   owne… Eqw     2021-06-06 17:46:46     4 NA          NA NA     
#  6     245277  0.200 singularity-run… owne… qw      2021-06-15 09:28:30     4 NA          NA NA     
#  7    2316670  0.171 run_phylophlan3… owne… Eqw     2021-03-09 17:11:46    24 NA          NA NA     
#  8    1125632  0.128 blast_abortus.sh owne… Eqw     2021-01-12 16:59:26     4 NA          NA NA     
#  9      77151  0.126 genomegenerate   owne… Eqw     2021-06-04 12:27:36     5 NA          NA NA     
# 10    1280060  0.108 atac.sh          owne… qw      2020-04-23 12:27:00     8 NA          NA NA     
# # … with 2,109 more rows, and 3 more variables: start_time <dttm>, queue_name <chr>, tasks.y <chr>
nusers <- length(unique(qstat$owner))
period <- range(qstat$submission_time)
start <- range(qstat$start_time, na.rm = TRUE)
cat(sprintf("Number of jobs including job-array tasks: %d\n", nrow(qstat)))
cat(sprintf("Submission time range: %s - %s\n", period[1], period[2]))
cat(sprintf("Start time range: %s - %s\n", start[1], start[2]))
cat(sprintf("Number of unique users: %d\n", nusers))
# Number of jobs including job-array tasks: 2119
# Submission time range: 2019-04-02 10:17:14 - 2021-06-16 23:12:02
# Start time range: 2021-05-28 13:50:56 - 2021-06-16 23:14:16
# Number of unique users: 24
table(qstat$state.x)
# 
#  Eqw  hqw   qw 
#  11  513 1595

table(qstat$state.y)
#
#    r   Rr    t 
# 1549    2    3 
library(dplyr)
running <- filter(qstat, !is.na(start_time))
select(running, job_number, state.x, submission_time, start_time, slots)
# # A tibble: 1,554 x 5
#    job_number state.x submission_time     start_time          slots
#         <dbl> <chr>   <dttm>              <dttm>              <int>
#  1      57150 qw      2021-05-11 12:18:21 2021-05-28 13:50:56     1
#  2      57150 qw      2021-05-11 12:18:21 2021-05-28 16:03:55     1
#  3      57150 qw      2021-05-11 12:18:21 2021-05-28 16:19:56     1
#  4      57150 qw      2021-05-11 12:18:21 2021-05-28 16:26:55     1
#  5      57150 qw      2021-05-11 12:18:21 2021-05-28 16:46:55     1
#  6      57150 qw      2021-05-11 12:18:21 2021-05-28 17:23:56     1
#  7      57150 qw      2021-05-11 12:18:21 2021-05-28 17:24:55     1
#  8      57150 qw      2021-05-11 12:18:21 2021-05-28 17:26:55     1
#  9      57150 qw      2021-05-11 12:18:21 2021-05-28 17:28:56     1
# 10      57150 qw      2021-05-11 12:18:21 2021-05-28 17:53:55     1