This file contains 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
library(tidyverse) | |
dat <- tibble(var = c("a_b", "c_d")) | |
split_vec_to_df <- function(x) { | |
tibble( | |
var_1 = str_split(x, "_")[[1]][[1]], | |
var_2 = str_split(x, "_")[[1]][[2]] | |
) | |
} |
This file contains 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
#' Write out a geography file in PHYLIP format for BioGeoBears | |
#' | |
#' @param data Dataframe; species distributions in regions, with one row per | |
#' region per species. Must have columns 'species' and 'region' | |
#' @param output_file Path to write outputfile | |
#' | |
#' @author Joel Nitta | |
#' | |
#' @return The the path to `output_file`. | |
#' |
This file contains 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
# Go from genbank accession numbers to taxonomic data from the NCBI database | |
# `accs` is a (long) list of genbank accession numbers | |
# can only search max ca. 200 at a time because of NCBI limits | |
gb_acc <- rentrez::entrez_search(db = "nuccore", term = paste(accs[1:200], collapse = "|"), use_history = TRUE, retmax=200) | |
# For each accession, link to the taxonomy database | |
gb_tax_links <- rentrez::entrez_link(dbfrom = "nuccore", db = "taxonomy", id = gb_acc$ids) | |
# Query the taxonomy database using the IDs in the links. Output is XML |
This file contains 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
# How to print bootstrap support values with ggtree | |
library(ape) | |
library(ggtree) | |
library(tibble) | |
# phy is a list of class 'phylo' as defined in ape, with node labels | |
# as typically obtained after running ape::read.tree() on a tree in newick format | |
# (here, filmy ferns from Moorea, French Polynesia) | |
phy <- read.tree("https://gist.githubusercontent.com/joelnitta/11b80d76cc44b7d0492cc6f7fe0acaa8/raw") |
This file contains 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
[Filmy ferns (family hymenophyllaceae) from Moorea, French Polynesia] | |
[extracted from original tree file 'data_and_scripts/Phylo_Analysis/data/RAxML_bipartitions.all_broad.reduced'] | |
[from Nitta 2017 https://doi.org/10.5061/dryad.df59g] | |
((Hymenophyllum_pallidum:37.640917,(Hymenophyllum_digitatum:34.732943,(Hymenophyllum_javanicum:34.626438,(Hymenophyllum_polyanthos:27.555333,Hymenophyllum_multifidum:27.555334)72:7.071105)12:0.106504)28:2.907974)40:180.075944,(Callistopteris_apiifolia:184.754946,(Abrodictyum_dentatum:176.779987,((Polyphlebium_borbonicum:43.831809,Polyphlebium_endlicherianum:43.831809)59:120.99542,(Didymoglossum_tahitense:158.642039,(Vandenboschia_maxima:150.345143,((Crepidomanes_minutum1:19.391489,(Crepidomanes_minutum3:14.96513,Crepidomanes_minutum2:14.96513)70:4.426359)99:60.813946,(Crepidomanes_humile:49.60898,(Crepidomanes_kurzii:18.703906,Crepidomanes_bipunctatum:18.703906)26:30.905073)94:30.596454)88:70.139707)73:8.296898)69:6.18519)98:11.952757)20:7.974959)98:32.961915)100; |
This file contains 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
Alice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do: once or twice she had peeped into the book her sister was reading, but it had no pictures or conversations in it, “and what is the use of a book,” thought Alice “without pictures or conversations?” | |
So she was considering in her own mind (as well as she could, for the hot day made her feel very sleepy and stupid), whether the pleasure of making a daisy-chain would be worth the trouble of getting up and picking the daisies, when suddenly a White Rabbit with pink eyes ran close by her. | |
There was nothing so very remarkable in that; nor did Alice think it so very much out of the way to hear the Rabbit say to itself, “Oh dear! Oh dear! I shall be late!” (when she thought it over afterwards, it occurred to her that she ought to have wondered at this, but at the time it all seemed quite natural); but when the Rabbit actually took a watch out of its waistcoat-pocket, and looked at it, and then hurried on, Alice s |
This file contains 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
#!/usr/bin/bash | |
# Kill the job using the saved ID | |
kill -9 `cat dockerd.pid` | |
rm dockerd.pid | |
rm dockerd.log |
This file contains 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
#!/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 |
This file contains 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
in1: | |
class: File | |
path: raw-sequence.fastq.gz | |
out1: trimmed.fastq.gz | |
html: report.html | |
json: report.json |
This file contains 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
cwlVersion: v1.0 | |
class: CommandLineTool | |
hints: | |
DockerRequirement: | |
dockerPull: quay.io/biocontainers/fastp:0.20.1--h8b12597_0 | |
baseCommand: fastp | |
inputs: |