Thursday, June 21, 2007

Using my code with Java packages

1. After having created Java packages, copy over the entire directory structure to desired machine (e.g., source files are in /home/afgane/dBLAST/src/com/dBLAST/util).
2. In order to compile the code, in base dir (e.g., /home/afgane/dBLAST), execute
javac -d bin/ src/com/dBLAST/util/*.java
The -d option specifies where to store class files. It will create all the package subdirectories from the specified folder (e.g., by specifying bin/, it will create bin/com/dBLAST/util/ and put all class files there).
3. In order to execute the code, first you must export directory where class files are. This can be done either by editing .bashrc file and adding a line such as the following one to it
export CLASSPATH=/home/afgane/dBLAST/bin/:$CLASSPATH
Alternatively, you can do it manually and executing that same line for each login session.
4. Finally, run the code by executing java com.dBLAST.util.DynamicBLAST_6 props.properties, for example from any directory.

Dynamic BLAST installation and execution requirements (v0.6)

Dynamic BLAST (v0.6)

Required libraries (these must be specified in CLASSPATH)
drmaa.jar (located in $dBLAST_LOCATION/lib)
JSAP-21.jar (located in $dBLAST_LOCATION/lib)
mysql-connector-java-5.0.7-bin.jar (located in $dBLAST_LOCATION/lib)

Required source files (package com.dBLAST.util)
DynamicBLAST_6.java
ReadProperties.java

Properties files
propsLS.properties
analysis.properties
[props.properties] (pre-configured properties file for BLAST runs)

External applications/scripts
analyze.pl
runCat.pl
runGWHOST.pl
querySplittingOnly_v2.pl

Input files
first100.fas


Compiling the application
While in base directory (e.g., /home/afgane/dBLAST), execute:
javac -d bin/ src/com/dBLAST/util/*.java
(-d option specifies where to store class files. It will create all the package subdirectories from the specified folder (e.g., by specifying bin/, it will
create bin/com/dBLAST/util/ and put all class files there))
There is also a compile.sh script that automates above process.

Invoking the application
Must first execute (if not provided in .bashrc):
export dBLAST_LOCATION=/home/afgane/dBLAST
export CLASSPATH=$dBLAST_LOCATION/bin/:$dBLAST_LOCATION/lib/JSAP-2.1.jar:$CLASSPATH
Usage: java com.dBLAST.util.DynamicBLAST_6 [(-p|--propertiesFile) ] [-g|--modeGrid] [(-q|--queryFile) ] [(-d|--database) ] [-f ] [-c|--clean] [-h|--help]

[(-p|--propertiesFile) ]
Propeties file provding job arguments and options. (default:
propsLS.properties)

[-g|--modeGrid]
If switch present, analysis and fragmentation are performed on GRID
resources rather than using LOCAL resource.

[(-q|--queryFile) ]
Query input file to be used for the job (if another value is present in
the job properties file, value associated with this switch overrides
it).

[(-d|--database) ]
Query input file to be used for the job (if another value is present in
the job properties file, value associated with this switch overrides
it).

[-f ]
Defines number of fragments to be created. Once created, they are
randomly distributed to chose resources.

[-c|--clean]
Clean temporary files (most of them).

[-h|--help]
Displays this help.

Porting EndNote references from ver. 7 to ver. 8

The source of the problem is that EndNote 8 and later export the data as a UTF-8 Unicode document, not as traditional ANSI text. Reference Manager, ProCite, and earlier versions of EndNote are not Unicode compatible, so they need the document to be plain ANSI text. To resolve this problem, do the following:

1. Export the EndNote 8 or later library to a plain text file (.txt) using the Refer Export format:
a. Open the library in EndNote 8 or later and make sure all references are showing.Select "Refer Export" as the output style by going to Edit->Output Styles (if Refer Export is not available, add it by clicking on Open Style Manager and selecting it for edit. Then, instead of editing it, just exit that form)
b. Select File->Export..., enter a file name, and save the file to a convenient location such as your desktop as plain .txt file.

2. Open the text file you exported from EndNote in Microsoft Word. When Word prompts you for the encoding option, select "Other Encoding" and "Unicode (UTF-8)" as the options.

3. In Word select "File > Save As" and save the document with a new name as plain text with Windows-default as the encoding option.

4. Import the Refer Export text file into the earlier version of EndNote:
a. In the older version of EndNote create a new library or open an existing one. Select File->Import. Click the "Choose File" button and select the text file you just created. Under "Import Option" select "Refer/BibIX"
b. Click the "Import" button.

More documentation available here and here.

Tuesday, June 19, 2007

Installing Mozart Oz and Cygwin on Windows XP

1. Mozart-Oz needs to be installed using typical Windows installation procedure
2. Cygwin needs to be installed using typical Windows installation (this is bare bones, so install packages such as vi and gcc - also, 'more' command does not work in cygwin so create alias in .bashrc file to use 'less' command then typing 'more'). Windows drives can be accessed from cygwin by going to /cygdrive directory.
3. Emacs needs to be installed. Install Windows version (not the cygwin package).
4. Run addpm.exe in emacs bin subdirectory from windows explorer. This will integrate/install emacs into the Windows environment.
5. Create symbolic link in /usr/bin to point to emacs (e.g., ls -s /cygdrive/c/Program\ Files/emacs/bin/emacs.exe emacs)
6. Define environment variable OZEMACS in Windows (Ctlr Panel->System->Advanced->Env. Var) to point to emacs.exe.
7. Start cygwin and type oz to get going...

Thursday, May 10, 2007

Add second y axis on a chart in Excel

In Excel 2007:
Plot two sets of data on a single chart.
Then, you must select data series you wish to plot on the second axis by either clicking on it on the chart or selecting it from a drop down menu in top left corner under Layout tab. Then click 'Format Selection' under Layout tab and select "Plot on Secondary Axis".

In Excel 2003 and earlier:
Select chart, press Ctrl+1 and proceed with data selection...

Note: that not all charts support this feature.

Wednesday, May 09, 2007

Format elapsed time in excel

I have a set of times saved in seconds and fractions of a second. I want to be able to transpose that into something that can be understood easily, such as hours:minutes:seconds
Because Excel does not provide automatic support to measure elapsed time, this unfortunately needs to be done by hand.
Sample input data set (in columns A1-A4):
4508.507
4452.111
4423.425
4592.724

Sample output:
1:15:8.507
1:14:12.111
1:13:43.425
1:16:32.724

Formula (for first value only (i.e., in cell A1)
=INT(A1/3600)&":"&RIGHT("00"&MOD(INT(A1/60),60),2)&":"&ROUND(MOD(A1, 60),3)

Cell value (e.g., A1) can be replaced with things such as SUM (cell range), AVERAGE (cell range), MAX (cell range) to get formatting of the result of processing a range of cell values.

Sunday, February 25, 2007

Formatting database for BLAST

Unformatted databases can be downloaded from ftp://ftp.ncbi.nlm.nih.gov/blast/db/FASTA/, while formatted ones from ftp://ftp.ncbi.nlm.nih.gov/blast/db/.
Command to use to format a database:
formatdb -i input_db -p F -o T for nucleotide
formatdb -i input_db -p T -o T for protein

For yeast.nt use: formatdb -i yeast.nt -p T -o T
For nr use: formatdb -i nr -p T -o T

Wednesday, February 21, 2007

Trying to submit a simple job to new installation of Globus, I got the following error:

globusrun-ws -F wave.cis.uab.edu -submit -s -c /bin/date
Delegating user credentials...Done.
Submitting job...Done.
Job ID: uuid:a8109b36-c203-11db-a449-00123f2a7564
Termination time: 02/22/2007 23:31 GMT
Current job state: Failed
Destroying job...Done.
Cleaning up any delegated credentials...Done.
globusrun-ws: Job failed: Error code: 201
Script stderr:
sudo: sorry, you must have a tty to run sudo


If sudoers file has properly been edited and contains necessary lines and this happend, it is due to default Fedora sudoers setup. Edit sudoers file (Command: /usr/sbin/visudo -f /etc/sudoers) and comment out the following line:
Defaults requiretty

Wednesday, January 31, 2007

Installing Globus Toolkit (4.0.3) Gotchas

After following the installation documentation for installing GT 4.0.3 from source, I kept getting the following error during the make part of installation: db.c:40:17: error: sql.h: No such file or directory

(all this as root, except GT install of course)
This required installing iODBC driver (including driver manager RPM and RPM Developers Kit) from here (use command: rpm -ivv rpmName).
Also, psqlODBC driver needs to be installed. Download the source and follow the standard installation procedure:

tar xvzf psqlodbc-[version].tar.gz
cd psqlodbc-[version]
./configure --with-iodbc --enable-pthreads
make
make install

Then, run globus related ./configure and make

Monday, January 29, 2007

MediaWiki - changing sidebar menu

Found solution here by Tom Sherman.

Gist of it is the following though (in case original page moves):
"On the off chance that you’re here because you actually want to modify your wiki’s navigation links (and not just read my complaining), I recommend that you modify the existing MediaWiki URLs and not try to create new ones. That’s what I did. Simple instructions:

1. Go to Special:Allmessages.
2. Choose a link you’ll modify. I decided I didn’t want the “Community portal” link, so that meant I would modify the:
* portal page [MediaWiki:portal] (do an in-page find on the Special:Allmessages page). Modify the existing text to change what will be rendered in the menu as the link text.
* portal-url page [MediaWiki:portal-url]. Modify the existing text to change what will be rendered in the menu as the link URL (can be internal wiki page or external URL).
3. After you’ve edited, make sure to do a full-refresh of your the page or clear your browser cache. MediaWiki is very finicky about this.

Remember, you have the choice of any of the existing links to modify. Here they are:
link text | link URL
mainpage | mainpage
portal | portal-url
currentevents | currentevents-url
recentchanges | recentchanges-url
randompage | randompage-url
help | helppage
sitesupport | sitesupport-url

Even though the pages I modified were “portal” and “portal-url,” they now have nothing to do with that topic. Those are simply the references in the database."

Saturday, December 02, 2006

Acces MySQL on titanic

Most of my databases are stored under user mpiblast. To access one, type mysql -d (e.g., test)

Thursday, November 30, 2006

Manual proxy config for undergrad labs for Internet access

In Firefox: Under Tools->Options, General Tab, click Connection Settings and select Manual Proxy Configuration. Put in 138.26.65.1 for HTTP Proxy and 3128 for port number. Check "Use this proxy server for all protocols" and off to the Internet I go...

Tuesday, November 28, 2006

Trusting UAB CA on a UABGrid resource

There are four (4) things that need to be changed on every resource to get the UAB CA certificate where given resource can be used for job submission and as a job submission source (NOTE: all the steps except step 3 need to be done for every user on every resource):
  1. Download userkey.pem and usercert.pem from http://uabgrid.uab.edu (click on Other Tools -> Manage Certificates)
  2. Save these two files to given resource in ~/.globus directory and change userkey.pem permissions to read only.
  3. As root, save the 56498486.signing_policy and UAB-root.crt
    to /etc/grid-security/certificates directory on given resource.
    Those files can be obtained with the following set of commands:
    cd /etc/grid-security/certificates
    wget http://webapp.lab.ac.uab.edu/UAB-root.crt
    wget https://www.pki.virginia.edu/nmi-bridge/certs/56498486.signing_policy
    ln -s UAB-root.crt 56498486.0
  4. As root, add an entry to grid-mapfile - this entry can be obtained by executing grid-proxy-info by particular user (after the previous steps have been completed) and then copy the issuer line into grid-mapfile (e.g.: /C=US/ST=Alabama/L=Birmingham/O=University of Alabama at Birmingham/OU=UABgrid/CN=afgane/emailAddress=afgane@uab.edu)

Submit a simple WS-GT4 job

Must have valid proxy and execute the following command: globusrun-ws -s -submit -F olympus.cis.uab.edu -c /bin/date

Setting up GT4 MDS hierarchy

As user globus, edit file $GLOBUS_LOCATION/etc/globus_wsrf_mds_index/hierarchy.xml
to include the line with the server higher up in the hierarchy (i.e., below ...upstream... element). For example, to have olympus as head of the hierarchy, add the following line on everest:
https://olympus.cis.uab.edu:8443/wsrf/services/DefaultIndexService
This needs to be done on every machine you want to have register with the higher level resource.
There is also an option to register resources from higher levels and not have to edit files on all individual resources but rather only in one place. To use this option, add the following line (i.e., below ...downstream... element in above stated file) to the machine acting as the head of hierarchy (e.g., olympus): https://everest.cis.uab.edu:8443/wsrf/services/DefaultIndexService

Once the hierarchy file has been updated, globus needs to be restarted on that machine. To restart globus, as root, execute: /etc/init.d/globus-4.0.2 restart


To check if everything works, execute: wsrf-query -s https://olympus.cis.uab.edu:8443/wsrf/services/DefaultIndexService '/*' grep 138.26.64.200 wc -l7 as regular user from any machine (e.g., as user afgane - Note that grid-proxy must be valid to work!). Above command checks for everest's MDS report through olympus.

To check if WebMDS works too, as globus start tomcat on olympus: $CATALINA_HOME/bin/startup.sh and point the browser to: http://olympus.cis.uab.edu:8080/webmds/

Full information on how do to this can be obtained form here.

Monday, November 27, 2006

GridWay 5 installation procedure complement

Good instruction on installing GridWay 5 can be obtained from http://www.gridway.org/documentation/stable/installconfguide/

When executing 'globus-makefile-header -flavor gcc32dbg globus_gram_client \ globus_ftp_client globus_gass_copy > makefile-header' use the 'gcc64dbgpthr' flavor by executing the following command (on everest): 'globus-makefile-header -flavor gcc64dbgpthr globus_gram_client globus_ftp_client globus_gass_copy > makefile-header'

Once I got to the 'make' part, I got an error saying something about '...recompile with -fPIC flag...'. To correct this, I changed the Makefile where CFLAGS is defined to include -fPIC flag. The line should look like this: 'CFLAGS = -fPIC -Wall -g $(CFLAGS_SUNOS) $(DB4_FLAGS) $(DEBUG_FLAGS)'