Skip to content

Instantly share code, notes, and snippets.

View marekborowiec's full-sized avatar

Marek marekborowiec

View GitHub Profile
#! /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 23:42
R script using ape to get data on clade monophyly
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*")
@marekborowiec
marekborowiec / non-interleave-fasta.py
Last active March 29, 2016 17:23
make fasta file with one line per taxon name and one line per sequence using AMAS
#! /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)