(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf
:
# Quick conversion from latitude/longitude formats ("degrees decimal minutes" or "degrees minutes seconds") to decimal coordinates. | |
# This conversion needs to be verified since I know little of geodesy | |
# Load the list data | |
LL <- read.delim("~/Dropbox/POLAR GRADIENTS/latitude_longitude.tsv", quote="") | |
library(sp) | |
as.numeric(char2dms(as.character(LL$Latitude), chd="d", chm = "'", chs = "\"")) | |
as.numeric(char2dms(as.character(LL$Longitude), chd="d", chm = "'", chs = "\"")) |
# Run me first to count the lengths of sequences in FASTQ files in the directory. | |
# This script is linebreak dependent, therefore no interleaving is allowed. | |
# NR%4==2 means print every 4th line starting from 2nd | |
# NR%2==0 means print every 2nd line starting from 2st (note the 0) | |
for i in *.fastq; do | |
cat $i | awk '{if(NR%4==2) print length($1)}' > ${i}.readslength.txt | |
done | |
for i in *.fasta; do |
# This is an exercise in 16S rRNA gene sequence processing in R | |
library(phyloseq) | |
library(dada2) | |
library(Biostrings) | |
# Load OTU table generated by USEARCH with phyloseq | |
# Load the "classic" OTU table converted from .uc to .txt via uc2otutab.py | |
otuFile <- read.delim("example_readmap.txt", header=TRUE, row.names=1) | |
otu <- otu_table(otuFile,taxa_are_rows = TRUE) |
mv ./*/**/*(.D) ./ |
# In order to using the plotting script in `compare_alpha_diversity.py` we need to convert the output from `alpha_diversity.py` | |
# to resemble that coming out of `collate_alpha.py`, which involves transposing the column of sample name and ouput to rows. | |
# In theory, we will have only two rows, one for site names and one for the alpha diversity. | |
# Here's the transposition workflow for my own reproducibility purposes: | |
awk ' | |
{ | |
for (i=1; i<=NF; i++) { | |
a[NR,i] = $i |
#!/bin/zsh | |
# Load OTU table generated by fastq2biom into phyloseq | |
# I'm converting from HDF5 to JSON format because otherwise phyloseq would drop low abundance OTU for me | |
biom convert -i ${project}_tax.biom -o ${project}_tax.json --to-json | |
# I have problem where the "id" and "type" field values are malformed: | |
# My conversion output: "b'No Table ID'" & "b'OTU table'" | |
# Should be: "No Table ID" & "OTU table" | |
# Fixing this with sed: | |
sed -i "s/b'//g; s/'//g" ${project}_tax.json |
su | |
systemctl enable vboxservice | |
systemctl start vboxservice | |
groupadd vboxsf | |
gpasswd -a $USER vboxsf | |
exit | |
sudo usermod -aG vboxsf $(whoami) | |
# Log off & log back in |
# https://www.biostars.org/p/49820/ | |
# https://github.com/mdshw5/pyfaidx can be used as a drop-in replacement | |
xargs samtools faidx test.fa < names.txt |
# Port forwarding using miniUPNP client | |
# Use crontab to automate upon reboot | |
# https://superuser.com/questions/634628/is-there-a-script-to-add-port-forwarding-rule-in-home-router | |
upnpc -a `ifconfig wlan0 | grep "inet addr" | cut -d : -f 2 | cut -d " " -f 1` 22 22 TCP | |
upnpc -a `ifconfig wlan0 | grep "inet addr" | cut -d : -f 2 | cut -d " " -f 1` 5900 5900 TCP | |
upnpc -a `ifconfig wlan0 | grep "inet addr" | cut -d : -f 2 | cut -d " " -f 1` 9091 9091 TCP |