PFinderUCE-SWSC-EN

Description

According to the page of PFinderUCE-SWSC-EN, this package implements the SWSC-EN (Sliding-Window Site Characteristics - Entropy) method for automatic partitioning of UCE (Ultra-Conserved Elements) alignments. The method uses entropy to divide each UCE into 3 parts (conserved core region and two variable flanking regions), which can be used as input for PartitionFinder.

Available Versions

  • pfinderuce-swsc-en/1.0.0 (default)

Loading the Module

# Load module
module load pfinderuce-swsc-en/1.0.0

# Available variables
echo $PFinderUCE_SWSC_EN

Important

It is necessary to create symbolic links to the Python scripts before running:

ln -s $PFinderUCE_SWSC_EN/SWSCEN.py SWSCEN.py
ln -s $PFinderUCE_SWSC_EN/utilities.py utilities.py
ln -s $PFinderUCE_SWSC_EN/functions_metrics.py functions_metrics.py

Job Submission

submit_pfinder.sh
#!/bin/bash
#SBATCH -J pfinder
#SBATCH -N 1
#SBATCH -n 1
#SBATCH -t 23:00:00
#SBATCH --mem=8G

module load pfinderuce-swsc-en/1.0.0

# Create symbolic links
ln -s $PFinderUCE_SWSC_EN/SWSCEN.py SWSCEN.py
ln -s $PFinderUCE_SWSC_EN/utilities.py utilities.py
ln -s $PFinderUCE_SWSC_EN/functions_metrics.py functions_metrics.py

export WORK_DIR=$PWD
export INPUT="$WORK_DIR/example_dataset.nex"
export OUTPUT="*"

job-nanny python SWSCEN.py $WORK_DIR/example_dataset.nex

Important

Important points:

  • The WORK_DIR variable must be set to the current directory

  • The full path to the input file (.nex) is required

  • The symbolic links are essential to locate the Python scripts

Job Array for Multiple Alignments

submit_pfinder_array.sh
#!/bin/bash
#SBATCH -J pfinder_array
#SBATCH --array=1-20
#SBATCH -N 1
#SBATCH -n 1
#SBATCH -t 24:00:00
#SBATCH --mem=8G

FILES=($(ls *.nex))
FILE=${FILES[$SLURM_ARRAY_TASK_ID-1]}

module load pfinderuce-swsc-en/1.0.0

ln -s $PFinderUCE_SWSC_EN/SWSCEN.py SWSCEN.py
ln -s $PFinderUCE_SWSC_EN/utilities.py utilities.py
ln -s $PFinderUCE_SWSC_EN/functions_metrics.py functions_metrics.py

export WORK_DIR=$PWD
export INPUT="$WORK_DIR/$FILE"
export OUTPUT="${FILE%.nex}_output/"

mkdir -p ${FILE%.nex}_output
cd ${FILE%.nex}_output
cp ../$FILE .

python ../SWSCEN.py $WORK_DIR/$FILE > swscen.log 2>&1

Input File Format (NEXUS)

example_dataset.nex
#NEXUS

BEGIN TAXA;
    DIMENSIONS NTAX=4;
    TAXLABELS
        Taxa1
        Taxa2
        Taxa3
        Taxa4
    ;
END;

BEGIN CHARACTERS;
    DIMENSIONS NCHAR=1000;
    FORMAT DATATYPE=DNA MISSING=N GAP=-;
    MATRIX
        Taxa1 ATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCG...
        Taxa2 ATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCG...
        Taxa3 ATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCG...
        Taxa4 ATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCG...
    ;
END;

BEGIN ASSUMPTIONS;
    OPTIONS DEFTYPE=unord;
END;

Processing with PartitionFinder

After running SWSC-EN, the results can be used in PartitionFinder:

run_partitionfinder.sh
#!/bin/bash
#SBATCH -J run_pf
#SBATCH -N 1
#SBATCH -n 1
#SBATCH -t 24:00:00
#SBATCH --mem=8G

module load partitionfinder/2.1.1

# Create configuration file for PartitionFinder
cat > partition_finder.cfg << EOF
## ALIGNMENT FILE ##
alignment = swscen_output.nex;

## BRANCHLENGTHS ##
branchlengths = linked;

## MODELS OF EVOLUTION ##
models = all;

## MODEL SELECCTION ##
model_selection = aicc;

## DATA BLOCKS ##
[data_blocks]
$(cat blocks.txt)

## SCHEMES ##
[schemes]
scheme1 = $(cat schemes.txt)

## USER SCHEMES ##
[user schemes]
EOF

python $PartitionFinder . > pf_output.log

References

See also