Skip to content

Instantly share code, notes, and snippets.

View justincbagley's full-sized avatar
🎯
Focusing

Justin C. Bagley justincbagley

🎯
Focusing
View GitHub Profile
@justincbagley
justincbagley / How_to_Convert_Markdown_to_PDF.md
Last active April 15, 2024 19:50
How To Convert Markdown to PDF

How to convert markdown to PDF:

This post reviews several methods for converting a Markdown (.md) formatted file to PDF, from UNIX or Linux machines.

Using Pandoc:

$ pandoc How_I_got_svg-resizer_working_on_Mac_OSX.md -s -o test1.pdf
@justincbagley
justincbagley / zipper_function.md
Last active October 26, 2021 16:38
zipper - a shell function for zipping files and folders to add to your path on macOS

zipper

A useful function to add to your ~/.bash_profile or ~/.bashrc file on macOS that automates custom zipping of files and folders. This function also checks to make sure that the resulting gzipped folder has the same date as the last date of modificationf or the folder.

Add in your path as a full shell script by copying all below and saving into a file named zipper located in your $PATH (e.g. /usr/bin), or copy and paste just the function into ~/.bash_profile or ~/.bashrc then restart Terminal.

#!/bin/sh

# zipper
@justincbagley
justincbagley / unzipper_function.md
Created October 26, 2021 15:41
unzipper - a shell function for unzipping files and folders to add to your path on macOS

unzipper

A useful function to add to your ~/.bash_profile or ~/.bashrc file on macOS that automates custom unzipping of regular-zipped or gzipped files and folders on Mac.

This is a companion function/script to my zipper function posted in a Gist here.

Add in your path as a full shell script by copying all below and saving into a file named unzipper located in your $PATH (e.g. /usr/bin), or copy and paste just the function into ~/.bash_profile or ~/.bashrc then restart Terminal.

#!/bin/sh
@justincbagley
justincbagley / Markdown_rendering_quest.md
Last active August 12, 2021 00:27
The Markdown Rendering Quest Continues

The Markdown Rendering Quest Continues

GitHub Markdown

Everyone loves GitHub-flavored Markdown. A problem of interest for some time now is rendering, editing, and saving Markdown with GitHub rendering style.

This is something that has interested me since at least 2018. Indeed, I have been using grip for Markdown preview, conversion, and saving to PDF on macOS for years, as I detailed previously in one of my other popular Gists here.

Problem: GitHub API Limits

@justincbagley
justincbagley / PartitionFinder_Citations.md
Last active December 30, 2020 20:50
Curated list of citations relevant to PartitionFinder by Rob Lanfear

PartitionFinder Citations

v1.1.0 manual:

v1.1.0 software:

  • Lanfear, R., Calcott, B., Ho, S.Y. and Guindon, S., 2012. PartitionFinder: combined selection of partitioning schemes and substitution models for phylogenetic analyses. Molecular Biology and Evolution, 29(6), 1695-1701.
@justincbagley
justincbagley / Reasons_To_Prefer_CLI_Software_to_GUIs.md
Last active December 14, 2020 16:47
Reasons to Prefer Command Line Interface (CLI) Software to GUIs

Reasons to Prefer Commalind Line Interface (CLI) Software to GUIs

One common question, upon seeing someone working in a terminal is,

"Why don't you use a nice-looking, easy-to-use GUI software instead?"

And a perrenial related question discussed among developers is along the lines of,

@justincbagley
justincbagley / Method_for_Analyzing_ddRADseq_Data_in_SNAPP.md
Last active May 11, 2020 16:30
This Gist describes how to process and analyze SNPs from ddRAD tag loci in SNAPP (BEAST2)

Method for Analyzing ddRADseq Data in SNAPP (BEAST v2.4++)

Justin C. Bagley, September 11, 2017, Richmond, VA, USA

This markdown note describes how I used several software programs to process and eventually analyze SNPs from ddRAD tag loci (contigs) in SNAPP (Bryant et al. 2012), which is implemented in BEAST (Drummond et al. 2012; Bouckaert et al. 2014) and is of broad interest in evolutionary biology for inferring species trees (e.g. Demos et al. 2015; Stange et al. 2017). I provide a perspective based on my experiences analyzing data generated using Next-Generation Sequencing on ddRADseq genomic libraries prepped for several species/lineages of Neotropical freshwater fishes from the Brazilian Cerrado (Central Brazil).

My account is given in first person and represents merely one way to analyze data in SNAPP; there are other approaches, and other documents (e.g. this BFD* tutorial; L

@justincbagley
justincbagley / dDocent_utility_scripts.md
Last active May 9, 2020 14:00
Handy utility shell scripts for cleaning dDocent run folders

dDocent Utility Shell Scripts

Justin C. Bagley, Ph.D.

University of Missouri-St. Louis

This Gist provides a handful of utility shell scripts for use with dDocent, which I wrote in March 2020. Specifically, these scripts are meant to be placed in dDocent run subfolders, in order to provide means of quickly cleaning up the workspace after failed or stopped (ctrl + C) runs. They are sufficiently generic to clean any dDocent run folder, and they range from a minor clean to a deep clean (removes essentially everything generated during run).

Files

  • deep_clean_ddocent_folder.sh
@justincbagley
justincbagley / clean_raxml_gist.md
Created April 22, 2020 19:22
clean_raxml function for cleaning RAxML run directories

For those interested in running RAxML for phylogenetic inference using maximum-likelihood, here is a little function for cleaning up (within a RAxML run directory) after a failed RAxML run. Just add the following function to your ~/.bash_profile (on Mac) or ~/.bashrc (on Linux supercomputer) and do source ~/.bash_profile (or simliar) to have it on hand from the cli.

## CLEAN RAXML RUN DIR (TO CLEAN UP AFTER FAILED RUNS, BEFORE RESUBMITTING TO QUEUE)

clean_raxml () {
        rm ./*.txt; rm ./*.reduced; rm ./RAxML_info* ;
}
@justincbagley
justincbagley / Notes_on_Analyzing_RADseq_SNPs_in_SNAPP.md
Last active April 10, 2020 14:17
Notes on Analyzing ddRADseq SNP data in SNAPP (BEAST module)

Notes on Analyzing ddRADseq SNP Data in SNAPP (BEAST v2.4++)

This markdown note describes how I used several software programs to process and eventually analyze SNPs from ddRAD tag loci in SNAPP (Bryant et al. 2012). The data were generated using Next-Generation Sequencing on ddRADseq genomic libraries prepped for several species/lineages of Neotropical freshwater fishes from the Brazilian Cerrado (Central Brazil).

My account is given in first person and represents merely one way to analyze data in SNAPP; there are other approaches, and other documents (e.g. the Leaché et al. BDF* tutorial doc) also present a general approach. However, all the brief SNAPP guides and tutorials that are currently available require the user to consult the manual, A Rought Guide to SNAPP, written by Bouckaert and Bryant. Since SNAPP is amply covered by Bryant et al. (2012), Leaché et al. (2014), and other papers, I'll skip the introduction to SNAPP and assume the reader is acquainted with the details of the m