Skip to content

Instantly share code, notes, and snippets.

View cecileane's full-sized avatar

Cécile Ané cecileane

View GitHub Profile
@cecileane
cecileane / outgroup-reroot.jl
Created December 9, 2021 01:59
manipulations of trees and networks: outgroup rerooting, and identification of outgroup (on phylogenies that might be missing some species)
#=
to use the functions in this file, read it within julia with:
include("path/to/outgroup-reroot.jl");
but replace 'path/to/' by the actual path to this file on your machine.
main function defined in this file:
rootgenetrees
rootgenetree!
outgrouplabels
@cecileane
cecileane / calcD.jl
Last active May 17, 2022 20:12
Julia script to calculate the D statistics with locus-bootstrapping for significance. used in Blair & Ané (2020, https://doi.org/10.1093/sysbio/syz056)
#=
inspired from evobiR::CalcD (https://github.com/coleoguy/evobir/blob/master/R/CalcD.R)
used in [Blair & Ané 2020](https://doi.org/10.1093/sysbio/syz056)
=#
using BioSymbols
using BioSequences
using FASTX
using PhyloNetworks
using Random
@cecileane
cecileane / concatenate_phylip_alignments.jl
Created January 24, 2019 19:14
Julia script to concatenate a bunch of alignments in phylip format
# concatenate several phylip alignments
# asssumptions:
# - the current directory contains all the alignments
# (uncomment and modify the first line of code otherwise)
# - alignments are those files ending with ".phy"
# (beware: after running the script, the concatenated file will also end
# in .phy and will be in same folder: do don't re-run the script)
# - in each alignment, first line = header (no blank line before)
# - each taxon is sampled across all alignments: