Created
October 17, 2025 15:23
-
-
Save samuell/1bd3f10cd92873ea594f5f0101deaad1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| hours=$1; | |
| files=${@:2}; | |
| if [[ -z ${hours} || -z ${files} ]]; then | |
| echo "Usage: reads_for_seqtime <hours> <files>"; | |
| return; | |
| fi; | |
| seqkit fx2tab ${files} \ | |
| | sort -k 8,8 \ | |
| | awk '{ split($8, dt, "[=T:Z-]"); ts=mktime(dt[2]" "dt[3]" "dt[4]" "dt[5]" "dt[6]" "dt[7]); } NR==1 { start=ts } { seqtime=ts-start; print(seqtime"\t"$0) }' \ | |
| | awk '( $1 <= '${hours}'*3600 )' \ | |
| | cut -d$'\t' -f 2- \ | |
| | seqkit tab2fx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment