Skip to content

Cygwin notes

pmagwene edited this page Nov 22, 2011 · 7 revisions

Notes on Cygwin

If you're running Cygwin there are a few additional steps / things you need to be aware of to build the various source packages.

There were some major changes with the Cygwin 1.7.x series, released Dec 2009. If you have an older version of Cygwin (say the 1.5.x series) I recommend you rename your previous installation directory (e.g. cygwin --> cygwin.old), then create a new install directory and do a fresh install.

In the Cygwin setup program make sure to install the following packages:

- In "Devel"
   * gcc-core
   * gcc-g++
   * gcc-mingw-core
   * gcc-mingw-g++
   * gcc4
   * gcc4-core
   * gcc4-g++
   * make

- In "Net"
   * curl

Line Endings

You need to be aware that by default cygwin expects scripts to have the unix default line endings ("\n"; i.e. linefeed (LF)).

When you write bash scripts you should make sure they are saved with the correct line endings (see Options > Line End Characters > LF in the SciTE text editor).

Alternately, you can use the tr command to convert windows line endings to Unix line endings as so:

tr -d '\r' < inputfile > outputfile

Clustalw2

Clustalw 2.0.12 needed the older gcc compiler (3.4.4) to build successfully. I don't know if this has changed with the newer 2.1 release. If not, here's how to do it:

$ cd ~/tmp 
$ curl -O ftp://ftp.ebi.ac.uk/pub/software/clustalw2/2.1/clustalw-2.1.tar.gz
$ tar xvzf clustalw-2.1.tar.gz
$ cd clustalw-2.1
$ ./configure CC=gcc-3 CXX=g++-3
$ make
$ make install

MAFFT

MAFFT builds cleanly from source on Cygwin. Or you can install the MAFFT binaries available on the MAFFT website.

HMMER

  • HMMER builds cleanly from source on Cygwin, though 'make check' shows that one test (generic_stotrace) fails [I'll investigate this, though I don't think it's critical]

Week 12: Pipeline 1

pipeline1.sh modified for the Cygwin environment.

#!/bin/bash

# change these if these files are located somewhere else
BLASTP="/cygdrive/c/Program Files/NCBI/blast-2.2.25+/bin/blastp"
HMMSCAN=/usr/local/bin/hmmscan
PFAMDB=$HOME/tmp/Pfam-A.hmm

progname="$0" # the name of the program, we won't use this for anything
fastafile="$1" # the input fasta file
outfile="$2" # the output file for the report

# run blastp
echo "Running blastp"
"$BLASTP" -db refseq_protein -evalue 2e-10 -remote < "$fastafile" > "$outfile"

# run hmmscan and append to outfile
echo "Running hmmscan"
"$HMMSCAN" "$PFAMDB" "$fastafile" >> "$outfile"

Week 12: Pipeline 2

pipeline2.sh modified for the Cygwin environment.

#!/usr/bin/bash

TRANSLATE="c:/cygwin/${HOME}/tmp/aatranslate.py"
MAFFT=/usr/local/bin/mafft
HMMSCAN=/usr/local/bin/hmmscan
PFAMDB=${HOME}/tmp/Pfam-A.hmm

scriptargs="fastafile aafile alignfile reportfile"
E_WRONG_ARGS=85
nexpargs=4
args=$#

if [[ $args -ne $nexpargs ]]
then
    echo
    echo "Usage: 'basename $0' $scriptargs"
    echo
    exit $E_WRONG_ARGS
fi

progname="$0"
fastafile="$1"
aafile="$2"
alignfile="$3"
reportfile="$4"

echo "Translating sequences"
cat "$fastafile" | "$TRANSLATE" > "$aafile"

echo "Aligning sequences"
"$MAFFT" --auto --quiet "$aafile" > "$alignfile"

echo "Running hmmscan"
"$HMMSCAN" "$PFAMDB" "$aafile" > "$reportfile"

Clone this wiki locally