notes on evolutionary biology papers/programs and other stuff: a non-frequent approach

Monday, June 18, 2007

rename it with a script

Although there are nice little programs for OSX that rename file names and extensions, like Renamer4Mac, NameChanger and FileSorter, it's always good to have something simple handy, like a script.

in AppleScript: Nem

in Perl: here and here (Linux)

my favorite is a loop in Unix to rename file extensions:

1) if you know what your extensions are:


#!/bin/bash

for i in *fasta
do
mv "$i" "`echo $i | sed -e 's/fasta/fas/'`"
done

for i in *fas
do
cat "$i" | sed -e 's/\.fasta\"/\.fas\"/g' > out
mv out "$i"
done


2) if you prefer an interactive script that will ask you what extension names you want to change from/to:


#!/bin/bash

echo -n "enter old: "
read old
echo -n "enter new: "
read new

for i in *.$old
do
mv "$i" "`echo $i | sed -e "s/$old/$new/"`"
done


The shell scripts were kindly written by my friend Ricardo Baratto

Saturday, June 16, 2007

Automation and evaluation of NCPA

Following up on the previous posting on two programs that automate the inference process of Nested Clade Phylogeographic Analysis (NCPA), Panchal & Beaumont create a framework of automated NCPA. Their simulations show that NCPA has a high tendency for false positives. More research is needed, of course, on real-life data.

Panchal M, Beaumont MA. (2007) The automation and evaluation of Nested Clade Phylogeographic Analysis. Evolution 61(6):1466-1480.