Skip to content

Instantly share code, notes, and snippets.

Avatar

Joel Nitta joelnitta

View GitHub Profile
@joelnitta
joelnitta / stop-dockerd.sh
Created Dec 23, 2020
Stop rootless docker daemon
View stop-dockerd.sh
#!/usr/bin/bash
# Kill the job using the saved ID
kill -9 `cat dockerd.pid`
rm dockerd.pid
rm dockerd.log
@joelnitta
joelnitta / start-dockerd.sh
Created Dec 23, 2020
Start rootless docker daemon
View start-dockerd.sh
#!/usr/bin/bash
# Start docker daemon in background
nohup dockerd-rootless.sh --experimental --storage-driver vfs >| dockerd.log 2>&1 &
# Save the process ID so we can kill it later
echo $! > dockerd.pid
@joelnitta
joelnitta / fastp-job.yml
Last active Nov 27, 2020
fastp (single end) cwl job
View fastp-job.yml
in1:
class: File
path: raw-sequence.fastq.gz
out1: trimmed.fastq.gz
html: report.html
json: report.json
@joelnitta
joelnitta / fastp_se.cwl
Created Nov 26, 2020
fastp (single-end) cwl tool
View fastp_se.cwl
cwlVersion: v1.0
class: CommandLineTool
hints:
DockerRequirement:
dockerPull: quay.io/biocontainers/fastp:0.20.1--h8b12597_0
baseCommand: fastp
inputs:
@joelnitta
joelnitta / resume_example.Rmd
Last active Aug 27, 2020
Formatting for Rmd resume
View resume_example.Rmd
---
title: "Resume"
output:
rmarkdown::word_document:
reference_docx: "custom-reference-2.docx"
---
##### Employer: Apple Date: 2000
@joelnitta
joelnitta / stop-dockerd.sh
Created Jun 5, 2020
Stop a docker daemon using a stored PID
View stop-dockerd.sh
#!/usr/bin/bash
# Kill the job using the saved ID
kill -9 `cat dockerd.pid`
rm dockerd.pid
rm dockerd.log
@joelnitta
joelnitta / start-dockerd.sh
Last active Jun 5, 2020
Start rootless docker daemon
View start-dockerd.sh
#!/usr/bin/bash
# Start docker daemon in background
nohup dockerd-rootless.sh --experimental --storage-driver vfs >| dockerd.log 2>&1 &
# Save the process ID so we can kill it later
echo $! > dockerd.pid
@joelnitta
joelnitta / combine_huc.R
Created May 11, 2020
combine diversity metrics from different HUCs and get area
View combine_huc.R
# Set working directory
setwd(here::here())
# Load packages and functions
source("r-code/01_start_up.R")
# Load plan
source("r-code/plan.R")
# Load cache
@joelnitta
joelnitta / i18n_remote_error.log
Created Apr 18, 2020
Log of error when trying to pull from swcarpentry-ja/i18n
View i18n_remote_error.log
joelnitta@Joels-iMac repos % git clone https://github.com/joelnitta/i18n
Cloning into 'i18n'...
remote: Enumerating objects: 1672, done.
remote: Total 1672 (delta 0), reused 0 (delta 0), pack-reused 1672
Receiving objects: 100% (1672/1672), 2.73 MiB | 2.43 MiB/s, done.
Resolving deltas: 100% (1167/1167), done.
joelnitta@Joels-iMac repos % cd i18n
joelnitta@Joels-iMac i18n % git submodule init
Submodule 'git-novice' (https://github.com/swcarpentry-i18n/git-novice.git) registered for path 'git-novice'
Submodule 'po4gitbook' (https://github.com/swcarpentry-i18n/po4gitbook.git) registered for path 'po4gitbook'
@joelnitta
joelnitta / write_fasta_files_chunked.R
Created Apr 18, 2020
Write out a list of fasta files in chunks
View write_fasta_files_chunked.R
#' Write out a list of DNA sequences in chunks
#'
#' The list will be split into a list of lists, to
#' save memory when writing out sequences.
#'
#' @param fasta_list The list of DNA sequences
#' @param chunk_size Size of chunks to split up list into.
#' @param out_dir Directory to write to
#'
#' @return List of hashes; digest of each chunk. Externally, the
You can’t perform that action at this time.