Tuesday, September 11, 2012

Stand alone Blast Search for Mac OSX


Quick instruction for setting up standalone BLAST search
MAC OS 10.6.8, Terminal "bash"

1. Go to NCBI website (Note: Safari has problem with downloading database files, use FireFox instead)

2. Click "NCBI FTP Site".  You can find the link at bottom right on the page. (Note: select "Guest" in case you are asked for user ID and password)



3. Go to “BLAST Basic Local Alignment Search Tool” and then click the link.  You will see list of files and folders.

4. Open a folder "executables", go to "LATEST", and then double click "ncbi-blast-2.2.26+-universal-macosx.tar.gz" or latest version.  Download starts automatically.  You can find the blast folder in the folder “Downloads”

5. Rename the downloaded folder to "blast", and then move it into "Home Directly" (the one with the icon of house, where folders “Desktop”, “Documents”, “Downloads” are stored).


6. Before setting up stand alone blast, let’s review some basic commands in Linux

Start "Terminal" and then try following command:

Note: You can find the program “Terminal” in “Utilities” folder in “Applications”

Show your current directly (folder)
pwd

List all the files in a directly (folder) (hidden files included)
ls -a

Move to a different folder (change directly)
cd [folder name]
cd [folder]/[folder]

Back to Home Directly
cd

Create or edit a file
vi [file_name]
example) vi .bash_profile
type "a" to enter "edit mode"
hit "esc" to exit edit mode
hit "ZZ" (shift+z twice) to save and back to normal window

Delete an existing file (remove)
rm [file_name]
example) rm .bash_profile

Look content of a file
more [file_name]
example) more output.txt
(hit "q" to quit the command)

7.
Create .bash_profile (Look Step 6) in your “Home Directory”.  Here are commands to create a new file for setting a PATH.


vi .bash_profile [hit enter]  (this creates a file named “.bash_profile”)

[hit "a"]  (this is to enter edit mode)
export PATH=/Users/[name of your home directly]/blast/bin:$PATH


[hit "esc"] (exit edit mode)

[hit "ZZ"]  (save file and then back to terminal)

Restart Terminal (this is needed to activate the path).

Note: Why we need to set PATH?
The program "Terminal" looks for command programs stored in certain folders (folders can be visualized by typing "$PATH").  All the commands listed above (ls, more) are stored as program files in one of the folders listed below.

/Users/tomokurobe/blast/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin: No such file or directory

This means...
Terminal looks following folders to find programs:
/Users/tomokurobe/blast/bin
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin
/usr/X11/bin
or  return a message "No such file or directory"

In the default setting, "Terminal" doesn't look the newly added folder "blast", so that we need to set PATH.  Otherwise Terminal cannot find blast programs stored in the new folder.  In worst case, we can move blast programs in one of the folders above, but not recommended as you will be asked for password every time you make change.  Those folders contain important files for running OSX so it’s designed that users cannot make changes easily.

8.
8-1) Go to the NCBI FTP site and download database file in FASTA format (double click fasta file you want to use).  For test purpose, choose small database like "yeast.aa". "nr" database is large, even the compressed file is bigger than 10 Gb.  It takes very long time to run search program.  For this tutorial, you can download fasta file for “yeast.aa”


8-2) Now fasta file is downloaded in folder “Downloads”.  Create a new folder "db" in "blast" folder and then move the FASTA file “yeast.aa” in it.


8-3) In Terminal, type “pwd” to see your current location.  You should be in your Home Directly.  Type “ls” and make sure that there is a folder “blast”.  Type "cd blast/db" to reach the database folder.  Type “ls” to see there is the fasta file, “yeast.aa”.


8-4) To format database, type following command
makeblastdb -in yeast.aa -dbtype prot -parse_seqids (-parse_seqids is not necessary!)



This command creates 8 files (.phr .pin .pnd .pni .pog .psd .psi .psq).  All the files are needed for running blast search.


9. Run blast search

Note: we don't have to specify the database file created in the previous step.  Simply type database name and don't add any file extension.  Here is the instruction.

9-1) Prepare test sequence(s) in fasta format and then name it “test.fasta”

9-2) Stay in the "db" folder and then type in the following command:

blastp -query test.fasta -db yeast.aa -out output.txt
(Note: this command creates output file “output.txt” and you see result in regular output format, 50 hits)

more test.txt (to look your result)


blastp -query test.fasta -db yeast.aa -out output.txt -max_target_seqs 1  -outfmt '7 std sseqid sgi'
(Note: tubular format with comments, 1 hit.  -outfmt ‘[number] [std(standard)] [other info you want to add]’)

blastp -query test.fasta -db yeast.aa -out output.txt -max_target_seqs 1  -outfmt '6 sgi'
(Note: tubular format without comments, 1 hit)

Important Note: Comment from NCBI staff "Be careful using -max_target_seqs 1. You could miss the best hit. I would test with a higher number, like 50, to be sure setting to 1 gives the top hit with your query and db"

10. Retrieve definition of gene (gene name). This can be done just adding stitle in outfmt option. 

10. Retrieve definition of gene (gene name) using blastdbcmd program
Note: the blast search programs in tabular format (-outfmt 5, 6 or 10) doesn't output definition of gene (gene name).  To retrieve definition of gene, we need to use blastdbcmd program.  I saw some people using Bio::Perl to do the task, but it's not necessary.

10-1) Prepare file containing only ‘sgi’ (subject gene id).  The outformat option, -outfmt ‘6 sgi’ create what you need.

blastdbcmd -entry_batch output.txt -out result.txt -db yeast.aa -outfmt %t

Your result will be exported in the file "result.txt"

Thursday, September 6, 2012

(Toxic?) Supplement


It seems People are selling (potentially toxin producing) algae as supplements.

According to Wikipedia, there are two forms of apahnizomenon flos-aque, toxic and nontoxic forms.  Hope the supplement company is culturing nontoxic form for their business.

[copied from a website selling supplements]
QUESTION: WHAT IS APHANIZOMENON FLOS-AQUAE (AFA) BLUE-GREEN ALGAE?
ANSWER: Aphanizomenon flos-aquae (AFA) Blue-green algae is the first protein and most ancient food on earth. At the bottom of the food chain, it is the most nutrient-rich food (ounce for ounce) known to be created by nature. This simple organism is complete nutrition in its most basic form - the "building blocks of health". Wild AFA blue-green algae is a superb natural source of nutrients for the body. It boasts outstanding levels of chlorophyll, vitamin B12, beta-carotene, iron, protein, enzymes, amino acids and many more complementary nutrients in a completely assimable form. As a result, it can help to increase energy, correct imbalances, oxygenate cells and realize high levels of physical and mental health.

[Wikipedia]
Aphanizomenon flos-aquae is a freshwater species of cyanobacteria. Cyanobacteria (blue-green algae) are an ancient clade of bacterial microphytes, part of the cyanobacteria phylum.

Aphanizomenon flos-aquae as a species has both toxic and nontoxic forms. Most sources worldwide are toxic, containing both hepatic and neuroendotoxins.

Sunday, June 10, 2012

おすすめダイビングショップ

こちらが、沖縄でのお薦めのダイビングショップです(姉が経営)。沖縄でのスノーケリングを中心に活動しています。ダイビングでなくても、奇麗な珊瑚を楽しむ事が出来ます。お薦めスポットの水納島(みんなじま)では、シャワーも完備。ケラマ諸島でのボートダイビングでは、ウミガメを見る事が出来ます(ホームページ内の”海日記”を参照してください)。姉が経営していますが、機材もしっかり手入れされており、お薦めです。

ロコマリンサービス
http://www.loco-okinawa.com/

Saturday, May 5, 2012

Sightseeing spots in Kansai area

Here are my recommendations in Kainsai area.  I'm from Nara, so the best is visiting the Golden Buddha at the day of the festival in August.  It's fantastic, and I used to go almost every year when I was in Nara.  I like Inari-shrine, too.


Inari-shrine (pronounce "E-nali"), worshipping a god of fox
http://www.miyashikaen.com/blog/2011/01/post-192.html

Nijyo-castle
http://www.tokyotopia.com/sightseeing-kyoto.html
http://web-japan.org/nipponia/nipponia45/en/feature/feature04.html

Kinkaku-Ji
http://en.wikipedia.org/wiki/Kinkaku-ji

Kiyomizu-temple
http://www.taleofgenji.org/kiyomizu.html

Uji, green tea area
http://en.wikipedia.org/wiki/Byōdō-in
http://www.flickr.com/photos/kimmaki/2855564467/

San-ju San-gen Do
http://sanjusangendo.jp/
http://www.japan-guide.com/e/e3900.html
http://en.wikipedia.org/wiki/Sanjūsangen-dō

Osaka castle
http://en.wikipedia.org/wiki/Osaka_Castle

Golden buddha
http://www.fantasticjapan.com/todaiji-temple.html

Himeji-castle (pronounce "He-ma(y)-G"). Recommended
http://en.wikipedia.org/wiki/Himeji_Castle

Saturday, April 28, 2012

New publication

One of my works regarding parasitic infection in lumpfish is now published.  This is collaborative work with New England Aquarium.  They exhibit scarce and valuable fish in their aquarium, so that prevention and treatment of disease is critical for their business.  They observed clonic death of lumpfish due to parasitic infection and we identified it as Myxobolus albi.  Next step is to control vertical and horizontal infection to protect other health fish.


Myxobolus albi infection in cartilage of captive lumpfish (Cyclopterus lumpus)
http://vdi.sagepub.com/content/24/3/516

Saturday, April 7, 2012

An article covers my work

Here is the link for the periodical publication regarding water issues in California. It covers my work, Detection and prediction of endocrine disrupting chemicals using medaka microarray system.

HydroVision
http://www.grac.org/spring12.pdf

Monday, March 19, 2012

New UCD website

http://www.vetmed.ucdavis.edu/aquatic_health/index.cfm