# HG changeset patch # User Steve Losh # Date 1721245886 14400 # Node ID 8e22b36e5cbadeeb9625c249306524af73a70bde # Parent eb9f31c299b822002afaeb92a4e8865ce9281bc0 More diff -r eb9f31c299b8 -r 8e22b36e5cba bin/trst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/trst Wed Jul 17 15:51:26 2024 -0400 @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -euo pipefail + +tr ' ' $'\t' diff -r eb9f31c299b8 -r 8e22b36e5cba remote/bin/trst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/remote/bin/trst Wed Jul 17 15:51:26 2024 -0400 @@ -0,0 +1,1 @@ +../../bin/trst \ No newline at end of file diff -r eb9f31c299b8 -r 8e22b36e5cba stumpwm/igv.lisp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stumpwm/igv.lisp Wed Jul 17 15:51:26 2024 -0400 @@ -0,0 +1,72 @@ +(in-package :stumpwm-user) + +(defun send-igv-command (string &key want-resp) + (usocket:with-client-socket (socket stream "127.0.0.1" 60151) + ;; Do this here instead of passing :timeout above because that only sets + ;; *read* timeout and we don't want to permahang stump when IGV hangs and + ;; can't read. + (setf (sb-impl::fd-stream-timeout (usocket:socket-stream socket)) 5.0f0) + (unwind-protect (progn (write-line string stream) + (force-output stream) + (when want-resp + (read-line stream))) + (usocket:socket-close socket)))) + +(defun send-igv-batch-file (path) + (send-igv-command (alexandria:read-file-into-string path))) + +(defun igv-alignment-tracks () + (str:split #\, (send-igv-command "alignmentTrackNames ," :want-resp t))) + +(defvar *igv/supplementary-alignments* t) + +(defun igv/select-reads% () + (dolist (track-name (igv-alignment-tracks)) + (let ((read-names (ppcre:all-matches-as-strings + "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}" + (pbpaste)))) + (send-igv-command (format nil "selectByName ~A ~A ," track-name (str:join "," read-names))) + (echo (format nil "Selected ~D read~:P." (length read-names)))))) + +(defun igv/goto% () + (ppcre:register-groups-bind (chr start end) + ("(chr[A-Za-z0-9_]+)\\s+(\\d+)(?:\\s+)?(\\d+)?" (pbpaste)) + (send-igv-command (format nil "goto ~A:~A~@[-~A~]" chr start end)))) + +(defun igv/clear-read-selections% () + (dolist (track-name (igv-alignment-tracks)) + (send-igv-command (format nil "clearSelections ~A" track-name)))) + +(defcommand igv/toggle-supplementary-alignments () () + (callf *igv/supplementary-alignments* #'not) + (send-igv-command + (format nil "preference SAM.FILTER_SUPPLEMENTARY_ALIGNMENTS ~A" + (if *igv/supplementary-alignments* "FALSE" "TRUE"))) + (echo (if *igv/supplementary-alignments* + "Supplementary alignments now on." + "Supplementary alignments now off."))) + +(defcommand igv/supplementary-on () () + (send-igv-command "preference SAM.FILTER_SUPPLEMENTARY_ALIGNMENTS FALSE") + (echo "Supplementary alignments now on.")) + +(defcommand igv/supplementary-off () () + (send-igv-command "preference SAM.FILTER_SUPPLEMENTARY_ALIGNMENTS TRUE") + (echo "Supplementary alignments now off.")) + +(defcommand igv/clear-read-selections () () + (igv/clear-read-selections%)) + +(defcommand igv/select-reads () () + (igv/select-reads%)) + +(defcommand igv/goto () () + (igv/goto%)) + +(defcommand igv/goto-read () () + (igv/clear-read-selections%) + (igv/goto%) + (igv/select-reads%)) + +(defcommand igv/init () () + (send-igv-batch-file "/home/sjl/bin/igv.batch")) diff -r eb9f31c299b8 -r 8e22b36e5cba stumpwm/key-mapping.lisp --- a/stumpwm/key-mapping.lisp Tue Jul 02 10:03:59 2024 -0400 +++ b/stumpwm/key-mapping.lisp Wed Jul 17 15:51:26 2024 -0400 @@ -38,6 +38,7 @@ ("S-F26" "next") ("H-q" "exec lock-screen") ("H-y" "screenshot") + ("H-Y" "delayed-screenshot") ("H-f" "save-fucked-screenshot") ("H-F" "delete-fucked-screenshot") ("H-r" "rain") @@ -162,7 +163,13 @@ (defvar *keymap/igv* (make-sparse-keymap)) -(define-key *keymap/igv* (kbd "s") "igv/toggle-supplementary-alignments") +(define-key *keymap/igv* (kbd "s") "igv/supplementary-on") +(define-key *keymap/igv* (kbd "S") "igv/supplementary-off") +(define-key *keymap/igv* (kbd "r") "igv/select-reads") +(define-key *keymap/igv* (kbd "R") "igv/clear-read-selections") +(define-key *keymap/igv* (kbd "g") "igv/goto") +(define-key *keymap/igv* (kbd "G") "igv/goto-read") +(define-key *keymap/igv* (kbd "i") "igv/init") (define-top-keys ;; alternate maps ("H-i" *keymap/igv*)) diff -r eb9f31c299b8 -r 8e22b36e5cba stumpwm/miscellaneous.lisp --- a/stumpwm/miscellaneous.lisp Tue Jul 02 10:03:59 2024 -0400 +++ b/stumpwm/miscellaneous.lisp Wed Jul 17 15:51:26 2024 -0400 @@ -79,20 +79,3 @@ (echo "Starting VM.") (run-shell-command "/home/sjl/vms/run")) - -(defun send-igv-command (string) - (usocket:with-client-socket (socket stream "127.0.0.1" 60151) - (unwind-protect (progn (write-line string stream) - (force-output stream)) - (usocket:socket-close socket)))) - -(defvar *igv/supplementary-alignments* t) - -(defcommand igv/toggle-supplementary-alignments () () - (callf *igv/supplementary-alignments* #'not) - (send-igv-command - (format nil "preference SAM.FILTER_SUPPLEMENTARY_ALIGNMENTS ~A" - (if *igv/supplementary-alignments* "FALSE" "TRUE"))) - (echo (if *igv/supplementary-alignments* - "Supplementary alignments now on." - "Supplementary alignments now off."))) diff -r eb9f31c299b8 -r 8e22b36e5cba stumpwm/screenshots.lisp --- a/stumpwm/screenshots.lisp Tue Jul 02 10:03:59 2024 -0400 +++ b/stumpwm/screenshots.lisp Wed Jul 17 15:51:26 2024 -0400 @@ -1,5 +1,8 @@ (in-package :stumpwm-user) +(defcommand delayed-screenshot () () + (run-shell-command "sleep 10 && screenshot")) + (defcommand screenshot () () (run-shell-command "screenshot")) diff -r eb9f31c299b8 -r 8e22b36e5cba stumpwm/stumpconfig.asd --- a/stumpwm/stumpconfig.asd Tue Jul 02 10:03:59 2024 -0400 +++ b/stumpwm/stumpconfig.asd Wed Jul 17 15:51:26 2024 -0400 @@ -34,4 +34,5 @@ (:file "vlime") (:file "external-screens") (:file "miscellaneous") + (:file "igv") (:file "key-mapping"))) diff -r eb9f31c299b8 -r 8e22b36e5cba vim/custom-dictionary.utf-8.add --- a/vim/custom-dictionary.utf-8.add Tue Jul 02 10:03:59 2024 -0400 +++ b/vim/custom-dictionary.utf-8.add Wed Jul 17 15:51:26 2024 -0400 @@ -487,3 +487,12 @@ Ansible SMaHT NOP +unboxing +NUCs +Torrin's +Margit +hederas +auth +MinKNOW +MinION +deduplicate