Monday, December 08, 2008

Adding a tag in subversion through subclipse

In order to create a tag (or branch) select “Branch/Tag...” from the Team menu. In the “Copy Branch/Tag” dialog, in the “Copy to URL” field, make sure that the correct folder, branches, or tags were the snapshot wants to be put is displayed in the path by either browsing or typing it, for example: “https:///users/afgane/OptionView/tags/0.2”. “Browse” button can be used here to navigate to the branch or tag folder where the branch or tag would like to be created. If you would like to create a special folder which designates a version, then you can simply append a new folder to the end of the To URL (i.e. tags/0.2, in above example). This will then be created for you. Select the revision which you would like to copy (i.e. “Head revision in the repository”, “Specific revision in the repository”, or “Working copy”.
Create a message in the branch/tag comment area. If you would like to continue to work in your current working copy then leave the “Switch working copy to new branch/tag” checkbox clear. If you would like to switch so that you can make additional modifications to the branch/tag without changing the current working copy then select this checkbox.
Click OK in order to create the branch or tag.

Friday, December 05, 2008

Adding a computer to subversion repository (through subclipse)

All of this is done through Eclipse using Subclipse Project.


Assume there is a subversion repository already in place with documents in it. The repository was established with a certain version of documents from computer ONE. At the same time, computer TWO has a copy of those documents and it is not connected to the repository. Documents on computer TWO are edited before connecting the computer to the repository. Now, I would like to create a connection from computer TWO to the repository but I cannot simply issue a 'checkout' command because documents on computer TWO are the more recent version of the ones that are in the repository. While one would think this is a simple task (for a beginner w.r.t. subverion at least), it is not!
In order to achieve desired functionality, the following can be done (all of these are done on computer TWO):
1. From Windows Explored, move entire contents of the project directory to some temporary directory
2. From Eclipse (i.e., subclipse), checkout the desired project (go to SVN Repository Exploring perspective, browse to the desired project, right-click on trunk, tag (or similar) directory that wants to be checked out within the browser, and select Checkout)
3. Follow the checkout wizard and chose to 'Check out as a project in the workspace' and give it the name that matches the desired project name. After clicking Finish, it will tell you that the specified project exists and contents will be deleted. Click OK.
4. After checking out the documents has completed, go back to the Windows Explorer and copy contents of the temporary directory into the project directory
5. Refresh the project tree view in Eclipse. Right-click project name in Eclipse and select Team->'Synchronize with Repository'. This will open Team Synchronizing perspective (or ask you to do so) and show you differences from the new document versions with the ones in the repository.
6. Commit the new version into the repository by selecting documents, right-clicking and choosing Commit command.

From now on, both of the computers should be able to update/commit changes as needed.


If anyone reads this and knows a better way of doing it, please leave a comment explaining how because, in my current opinion, whoever designed document repositories to have the interface different from that of a simple drag&drop is an idiot.

Wednesday, September 10, 2008

Installing kinship library for R

Download the library from: http://cran.r-project.org/src/contrib/kinship_1.1.0-21.tar.gz
Save it anywhere.
From the directory where the library was saved, issue command: R CMD INSTALL kinship_1.1.0-21.tar.gz
Upon completion, you can type R to start the application and then issue command: library(kinship)

Note, for a system wide installation where one does not have access to installation paths for R, additional steps are needed:
Create a directory where extra libraries will be saved (e.g., extraLibs in $HOME)
Then, set the R_LIBS var in ~/.bashrc and you should be set.

Friday, August 29, 2008

Installing R

1. Download R from http://www.r-project.org/.
2. Untar the downloaded archive using command: $ tar -xvzf [R-version.tar.gz]
This will create a new directory named ./[R-version] in the current directory.
3. Enter newly created directory: cd [R-version]
4. Issue command: ./configure --prefix=/path/to/install (e.g., /home/afgane/R/[R-version])
In order to link BLAS and CLApack libraries, the following set of commands can be used (the export statements specify desired compiler, also make sure library paths are edited to match current resource):
export CC=icc
export CXX=icpc
./configure --prefix=/store/R/R-2.7.2 --enable-threads=posix --with-blas="-L/opt/intel/cmkl/10.0.011/lib/em64t -lmkl -lguide -lpthread" --with-lapack="-L/opt/intel/cmkl/10.0.011/lib/em64t -lmkl_lapack"

5. Type tow following commands to make and install:
$ make
$ make check
$ make install

Setting up SSH keys for authentication without passwords

1. Log into machine ONE
2. Issue command: ssh-keygen –t rsa
3. Change into ~/.ssh directory
4. Copy contents of file id_rsa.pub from machine ONE to file ~/.ssh/authorized_keys on machine TWO. Note, if this file already exists, simply add a new line to the bottom of it. Furthermore, make sure that the key being copied is all on one line.
5. Change permissions of ~/.ssh/authorized_keys on machine TWO to 700
6. Now, you are able to log in from machine TWO to machine ONE without a password

Monday, June 16, 2008

Getting BioPerf to execute

Upon executing script to start BioPerf, the following error came up:
$ ./use-bioperf.sh
You can do the following:
[R] Run BioPerf
[I] Install BioPerf on your architecture
(if your architecture is not PowerPc, x86)
[C] Clean outputs in $HOME/BioPerf/Outputs
[D] Display all versions of the installed codes
R
Please specify your architecture
[A] Alpha
[P] PowerPC
[X] x86
[H] Custom. (If you have already ran the install-codes.sh successfully
to completion, you can choose this option to run the binaries installed
on your system)
X
$HOME/BioPerf/Scripts/Run-scripts/run-bioperf.sh: line 21: syntax error near unexpected token `('
$HOME/BioPerf/Scripts/Run-scripts/run-bioperf.sh: line 21: ` echo There is no directory named $HOSTNAME-Binaries (created by install-codes.sh) in $BIOPERF/Binaries '


In order to get passed this, file $HOME/BioPerf/Scripts/Run-scripts/run-bioperf.sh should be edited on line 21 to replace parentheses with curly brackets (or similar or escaped). The same should be done on line 26 because parentheses are used there as well and are not escaped.

Thursday, June 12, 2008

Add color to bash

In order to get syntax highlighting in bash when 'ls' command is executed, add the following line to (bottom of) ~/.bashrc file:
. /etc/profile.d/colorls.sh

Note: Make sure pointed file exists. Below is an example of one:

$ more colorls.sh
# color-ls initialization

alias ll='ls -l' 2>/dev/null
alias l.='ls -d .*' 2>/dev/null

COLORS=/etc/DIR_COLORS
[ -e "/etc/DIR_COLORS.$TERM" ] && COLORS="/etc/DIR_COLORS.$TERM"
[ -e "$HOME/.dircolors" ] && COLORS="$HOME/.dircolors"
[ -e "$HOME/.dircolors.$TERM" ] && COLORS="$HOME/.dircolors.$TERM"
[ -e "$HOME/.dir_colors" ] && COLORS="$HOME/.dir_colors"
[ -e "$HOME/.dir_colors.$TERM" ] && COLORS="$HOME/.dir_colors.$TERM"
[ -e "$COLORS" ] || return

eval `dircolors --sh "$COLORS"`
[ -z "$LS_COLORS" ] && return

if ! egrep -qi "^COLOR.*none" $COLORS >/dev/null 2>/dev/null ; then
alias ll='ls -l --color=tty' 2>/dev/null
alias l.='ls -d .* --color=tty' 2>/dev/null
alias ls='ls --color=tty' 2>/dev/null
fi

Tuesday, June 10, 2008

Setting Eclipse Keyboard Shortcut: Ctrl+Tab

Go to:
Window / Preferences / General / Keys

Scroll all the way down to the bottom. About 12th from the BOTTOM you will see category "Next Editor".
Double Click that line. The modify screen for that action will open up.
Set focus to the Key Sequence section, and hit CTRL-TAB, then click the ADD button. You should now see TWO commands for "Next Editor". You can now select the original one, and click Delete. (from here)

Wednesday, February 20, 2008

Get rid of horizontal line in Word 2007

"This line is actually... Wait for it...! A border! Don't ask me how it got there, but all you need to do is highlight the section around the line (just left mouse, and pull a nice big block round the area, provided there are no tables nearby where you want to preserve a border). Then just go up to the border-line selection icon in the toolbar and choose the one that clears all borders."
From http://word-tips-world.blogspot.com/2007/06/get-rid-of-that-annoying-horizontal.html

Tuesday, February 05, 2008

BLAST performance analysis configuration

All the files needed for BLAST performance testing (e.g., perl scripts, databases, different versions of BLAST software, ...) are located under my account on everest under ~/BLASTanalysis.
In order to run a BLAST test, a properties file (e.g., propertyFile) needs to be edited/provided. Properties file specifies the following data: database, input file, program, I/O params are specified, number of fragments and threads, and execution host.
Once configured, run run.pl script. This script will split the input file into specified number of fragments, generate LRM scripts, and submit the job:
perl run.pl {properties file}

Add multiple linux timing results (output in seconds)

If there are multiple files with timing results resulting from Linux 'time' command:
$ cat outputFile* | grep real
real 4m5.047s
real 2m51.264s
real 2m52.414s
real 2m52.293s

And these timings need to be converted into seconds and added into a single number (e.g., 761.018), use the following command:
cat outputFile* | grep real | cut -f 2 | sed 's/m/*60+/' | sed 's/s//g' | bc | awk '{ printf "%s", $0 "+" }' | sed '$s/.$/\n/' | bc

Convert output of linux 'time' command to show seconds only

After executing Linux 'time' command, the following output is obtained:
real 2m52.293s
user 1m39.670s
sys 0m4.370s

Use the following command to extract value for 'real' time only and convert the output to seconds only (i.e., convert 2m52.293s into 172.293):
cat outputFile* | grep real | cut -f 2 | sed 's/m/*60+/' | sed 's/s//g' | bc

Tuesday, January 15, 2008

Running JaCoP

From command prompt, while residing in the same directory as all the JaCoP java files, compile all java files using the following command:
C:\Documents and Settings\afgane\My Documents\Enis\Projects\JaCoP>java
c -classpath ".;C:\Documents and Settings\afgane\My Documents\Enis\Projects\JaCo
P\JaCoP.jar" *.java

Run any of the files using the following command, for example:
C:\Documents and Settings\afgane\My Documents\Enis\Projects\JaCoP>java
-classpath ".;C:\Documents and Settings\afgane\My Documents\Enis\Projects\JaCoP
\JaCoP.jar" Queens

After compiling it from command line, it can be run directly from Eclipse too.