Skip to content

Instantly share code, notes, and snippets.

Avatar

Marek marekborowiec

View GitHub Profile
@marekborowiec
marekborowiec / non-interleave-fasta.py
Last active Mar 29, 2016
make fasta file with one line per taxon name and one line per sequence using AMAS
View non-interleave-fasta.py
#! /usr/bin/env python3
from amas import AMAS
from glob import glob
# glob all fasta files into a list
in_fs = glob('*.fasta')
# get a list of alignments in
meta_aln = AMAS.MetaAlignment(in_files=in_fs, data_type="dna",in_format="fasta", cores=1)
View convert-miltons-numbers.py
#! /usr/bin/env python3
with open('miltons-numbers') as f:
records = f.readlines()
for record in records:
if '.' not in record:
first, sep, tail = record.partition('-')
last, sep2, tail2 = tail.partition(' ')
digits = len(last)
to_prefix = first[:len(first) - digits]
@marekborowiec
marekborowiec / monophyly_tests.R
Created May 17, 2016
R script using ape to get data on clade monophyly
View monophyly_tests.R
library("ape")
library("data.table")
### SET WORKING DIRECTORY ###
setwd("/home/mlb/Dropbox/Misof_et_al_Science/Supplementary_Archive_2/aa_final_alignments/trees")
### READ IN TREE FILES ###
tree_files <- dir(pattern="*bipartitions.EOG*")
You can’t perform that action at this time.