Monday, January 2, 2012
Phred :: Install
Phred
The installation is in the server
working directory: /bioinfo/packages/Phred
Copy the phred-dist-020425.c-acd.tar.Z to above directory
$ uncompress phred-dist-020425.c-acd.tar.Z
$ tar xvf phred-dist-020425.c-acd.tar
Edit makefile to uncomment lines for 'UNIX specific definitions'
$ make
To set the environment variable
$ export PHRED_PARAMETER_FILE=\usr\local\etc\PhredPar\phredpar.dat
== Now ready to run phred
phd2fasta package
move the package to the working directory
$ uncompress phd2fasta-acd-dist.tar.Z
$ tar xvf phd2fasta-acd-dist.tar
$ make
The program can be executed as ./phd2fasta
Wednesday, December 7, 2011
Ruby :: Gem :: Jeweler
Write a gem in Ruby using Jeweler
Steps.
- Install gem called jeweler
$ gem install jeweler
Fetching: jeweler-1.6.4.gem (100%)
Successfully installed jeweler-1.6.4
1 gem installed
Installing ri documentation for jeweler-1.6.4...
Installing RDoc documentation for jeweler-1.6.4...
Steps.
- Install gem called jeweler
$ gem install jeweler
Fetching: jeweler-1.6.4.gem (100%)
Successfully installed jeweler-1.6.4
1 gem installed
Installing ri documentation for jeweler-1.6.4...
Installing RDoc documentation for jeweler-1.6.4...
To execute the command, first checkout the options
$ jeweler --help
Now generate a new project using the command jeweler.
$ jeweler hello_gem
No github.user found in ~/.gitconfig. Please tell git about your GitHub account (see http://github.com/blog/180-local-github-config for details). For example: git config --global github.user defunkt
ERROR: The above command came up with an error.
To fix the user
$ git config --global github.user defunkt
$ git config --global github.token 6ef8395fecf207165f1a82178ae1b984
- replace defunkt and 6ef8395fecf207165f1a82178ae1b984
with your user and token respectively.
- To get the token from the Github
On Github > Account Seetings > Account Admin > API token: Your token is ***********
Rerun the jeweler command to create a new project
- By default the test script are generated for shoulda
- I am familiar with Rspec so I chose Rspec for my testing.
$ jeweler hello_gem --rspec
create .gitignore
create Rakefile
create Gemfile
create LICENSE.txt
create README.rdoc
create .document
create lib
create lib/hello_gem.rb
create spec
create spec/spec_helper.rb
create spec/hello_gem_spec.rb
create .rspec
Jeweler has prepared your gem in ./hello_gem
The structure of the directories are
$ tree
.
└── hello_gem
├── Gemfile
├── lib
│ └── hello_gem.rb
├── LICENSE.txt
├── Rakefile
├── README.rdoc
└── spec
├── hello_gem_spec.rb
└── spec_helper.rb
3 directories, 7 files
hello_gem doesnt have the rspec gem yet, so in the Gemfile
group :test do
gem 'rspec', "~> 2.3.0"
end
Run the bundle install command to install the rspec gem
$ bundle install
To know all the rake commands that can run,
$ rake -T
rake build # Build gem into pkg/
rake clobber_rdoc # Remove rdoc products
rake console[script] # Start IRB with all runtime dependencies loaded
rake gemcutter:release # Release gem to Gemcutter
rake gemspec # Generate and validate gemspec
rake gemspec:debug # Display the gemspec for debugging purposes, as jeweler knows it (not from the filesystem)
rake gemspec:generate # Regenerate the gemspec on the filesystem
rake gemspec:release # Regenerate and validate gemspec, and then commits and pushes to git
rake gemspec:validate # Validates the gemspec on the filesystem
rake git:release # Tag and push release to git.
rake install # Build and install gem using `gem install`
rake rcov # Run RSpec code examples
rake rdoc # Build the rdoc HTML Files
rake release # Release gem
rake rerdoc # Force a rebuild of the RDOC files
rake spec # Run RSpec code examples
rake version # Displays the current version
rake version:bump:major # Bump the major version by 1
rake version:bump:minor # Bump the a minor version by 1
rake version:bump:patch # Bump the patch version by 1
rake version:write # Writes out an explicit version.
Before we start with the gem we need a version to it.
$ rake version:write MAJOR=0 MINOR=1 PATCH=0
Updated version: 0.1.0
To know the current version
$ rake version
Current version: 0.1.0
Now install the gem
$ rake install
rake aborted!
"FIXME" or "TODO" is not a description
Tasks: TOP => install => build
(See full trace by running task with --trace)
NOTE: If you get this error, then open the Rakefile
Change the lines from
gem.summary = %Q{TODO: one-line summary of your gem}
gem.description = %Q{longer description of your gem}
to
gem.summary = "one-line summary of your gem"
gem.description = "longer description of your gem"
Now try again
$ rake install
Successfully built RubyGem
Name: hello_gem
Version: 0.1.0
File: hello_gem-0.1.0.gem
Executing "ruby -S gem install ./pkg/hello_gem-0.1.0.gem":
ruby -S gem install ./pkg/hello_gem-0.1.0.gem
Successfully installed hello_gem-0.1.0
1 gem installed
Installing ri documentation for hello_gem-0.1.0...
Installing RDoc documentation for hello_gem-0.1.0...
Now you can push the gem to Github and Rubygems.org
First commit all the changes to Git
$ git add .
$ git commit -am "inital setup"
Second create an repository at github, and call it hello_gem
This will create a repository called hello_gem.git
Run the command
$ rake release
Committing hello_gem.gemspec
Pushing master to origin
Generated: hello_gem.gemspec
hello_gem.gemspec is valid.
Successfully built RubyGem
Name: hello_gem
Version: 0.1.0
File: hello_gem-0.1.0.gem
Executing "gem push ./pkg/hello_gem-0.1.0.gem":
gem push ./pkg/hello_gem-0.1.0.gem
Pushing gem to https://rubygems.org...
You do not have permission to push to this gem.
rake aborted!
Command failed with status (1): [gem push ./pkg/hello_gem-0.1.0.gem...]
- It generated the gemspec file
- validates the hello_gem.spec
- It pushes the gem to GIT
- ERROR: It fails to push the gem to rubygems.org
Gems are no longer hosted by Github, It has moved to Rubygems.org
- To move gems to Rubygems, use Gemcutter
- To install gemcutter
$ gem update --system
Now install the gem
$ gem install gemcutter
Now stay in the hello_gem folder, and build the gem
$ gem build hello_gem.gemspec
Successfully built RubyGem
Name: hello_gem
Version: 0.1.0
File: hello_gem-0.1.0.gem
Now push the gem to rubygems.org
$ gem push hello_gem-0.1.0.gem
Enter your Gemcutter credentials. Don't have an account yet? Create one at http://gemcutter.org/sign_up
Email: user@example.com
Password:
Signed in. Your api key has been stored in ~/.gemrc
Pushing gem to Gemcutter...
Successfully registered gem: hello_gem (0.1.0)
Now gem is part of the Rubygems.
To add Gemcutter support to Jeweler
In the Rakefile, enter the line
Jeweler::GemcutterTasks.new
- This line has to added after the require 'jeweler'
Now check if we have the gemcutter functionality in Jeweler
$ rake -T
rake gemcutter:release # Release gem to Gemcutter
Now execute the rake command to send the gem to rubygems.org
$ rake gemcutter:release
- This is exactly the same as 'gem push hello_gem-0.1.0.gem'
Now lets look at the current directory
$ tree
.
├── Gemfile
├── Gemfile.lock
├── hello_gem.gemspec
├── lib
│ └── hello_gem.rb
├── LICENSE.txt
├── pkg
│ └── hello_gem-0.1.0.gem
├── Rakefile
├── README.rdoc
├── spec
│ ├── hello_gem_spec.rb
│ └── spec_helper.rb
└── VERSION
3 directories, 11 files
Update the gem in ur local machine
Check if the gem is updated.
Now lets look at the current directory
$ tree
.
├── Gemfile
├── Gemfile.lock
├── hello_gem.gemspec
├── lib
│ └── hello_gem.rb
├── LICENSE.txt
├── pkg
│ └── hello_gem-0.1.0.gem
├── Rakefile
├── README.rdoc
├── spec
│ ├── hello_gem_spec.rb
│ └── spec_helper.rb
└── VERSION
3 directories, 11 files
So far the gem is empty so lets write something to it.
Let start writing to it, in the lib/hello_gem.rb
$ cat lib/hello_gem.rb
class HelloGem
def self.hi
puts "Hello World!"
end
end
Now bump the version to a minor release
$ rake version:bump:minor
Current version: 0.1.0
Updated version: 0.2.0
Update the gem in ur local machine
$ rake install
Successfully built RubyGem
Name: hello_gem
Version: 0.2.0
File: hello_gem-0.2.0.gem
Executing "ruby -S gem install ./pkg/hello_gem-0.2.0.gem":
ruby -S gem install ./pkg/hello_gem-0.2.0.gem
Successfully installed hello_gem-0.2.0
1 gem installed
Installing ri documentation for hello_gem-0.2.0...
Installing RDoc documentation for hello_gem-0.2.0...
Check if the gem is updated.
$ irb
ruby-1.9.2-p290 :001 > require 'hello_gem'
=> true
ruby-1.9.2-p290 :002 > HelloGem.hi
Hello World!
=> nil
Modify the gem file to require another file.
- create a directory in the lib with the same name 'hello_gem'
$ mkdir lib/hello_gem
- create a file called translator.rb and write the following
$ cat lib/hello_gem/translator.rb
class Translator
def initialize(language)
@language = language
end
def hi
case @language
when 'spanish'
"Hola Mundo!"
when 'english'
"Hello World!"
else
"ERROR !!!"
end
end
end
- create a directory in the lib with the same name 'hello_gem'
$ mkdir lib/hello_gem
- create a file called translator.rb and write the following
$ cat lib/hello_gem/translator.rb
class Translator
def initialize(language)
@language = language
end
def hi
case @language
when 'spanish'
"Hola Mundo!"
when 'english'
"Hello World!"
else
"ERROR !!!"
end
end
end
- Modify the gemfile to include this translator
$ cat lib/hello_gem.rb
require 'hello_gem/translator'
class HelloGem
def self.hi(language = 'english')
translator = Translator.new(language)
translator.hi
end
end
Now update the git repository
$ git add .
$ git commit -am "hello_gem/translator added"
$ rake version:bump:minor
$ rake install
$ irb
> require 'hello_gem'
=> true
> HelloGem.hi
=> "Hello World!"
> HelloGem.hi('english')
=> "Hello World!"
> HelloGem.hi('spanish')
=> "Hola Mundo!"
> HelloGem.hi('hindi')
=> "ERROR !!!"
To make the executable
$ mkdir bin
$ touch bin/hello_gem
$ chmod a+x bin/hello_gem
Edit the bin/hello_gem
$ cat bin/hello_gem
#!/usr/bin/env ruby
require 'hello_gem'
puts HelloGem.hi(ARGV[0])
$ mkdir bin
$ touch bin/hello_gem
$ chmod a+x bin/hello_gem
Edit the bin/hello_gem
$ cat bin/hello_gem
#!/usr/bin/env ruby
require 'hello_gem'
puts HelloGem.hi(ARGV[0])
To make this executable, we have include the following line in the gemspec
$ cat hello_gem.gemspec
Gem::Specification.new do |s|
:
s.executables << 'hello_gem'
end
Update the git repository and reinstall the gem
On the command line
$ hello_gem english
Hello World!
$ hello_gem spanish
Hola Mundo!
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
describe "HelloGem" do
it "should return Hello World" do
HelloGem.hi.should == 'Hello World!'
end
it "should return Hello World" do
HelloGem.hi('english').should == 'Hello World!'
end
it "should return Hola mundo" do
HelloGem.hi('spanish').should == 'Hola Mundo!'
end
it "should return error" do
HelloGem.hi('french').should == 'ERROR !!!'
end
end
$ cat hello_gem.gemspec
Gem::Specification.new do |s|
:
s.executables << 'hello_gem'
end
Update the git repository and reinstall the gem
On the command line
$ hello_gem english
Hello World!
$ hello_gem spanish
Hola Mundo!
Testing, In the spec folder, edit hello_gem_spec.rb
$ cat spec/hello_gem_spec.rb
$ cat spec/hello_gem_spec.rb
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
describe "HelloGem" do
it "should return Hello World" do
HelloGem.hi.should == 'Hello World!'
end
it "should return Hello World" do
HelloGem.hi('english').should == 'Hello World!'
end
it "should return Hola mundo" do
HelloGem.hi('spanish').should == 'Hola Mundo!'
end
it "should return error" do
HelloGem.hi('french').should == 'ERROR !!!'
end
end
Execute the tests to make sure it passes
$ rspec spec/
....
Finished in 0.0005 seconds
4 examples, 0 failures
Documentation of work.
In the hello_gem.rb
$ cat lib/hello_gem.rb
# The main HelloGem class
class HelloGem
# Say Hi to the world.
#
# Example:
# >> HelloGem.hi('spanish')
# => Hola Mundo!
#
# Arguments:
# language: (string)
def self.hi(language = 'english')
:
Resouces:
http://guides.rubygems.org/make-your-own-gem/
http://asciicasts.com/episodes/183-gemcutter-jeweler
Location:
110 W Hickory St, Denton, TX 76201, USA
Monday, October 17, 2011
Denoising pyrosequencing reads
Tools to denoise pyrosequencing reads.
1. Denoiser
- Software for rapidly denoising pyrosequencing amplicaon reads by exploiting rank-abundance distributions.
- It is an alternative to PyroNoise software suite
- It is included in the new release of Qiime 1.3
Download
Pre-requisites
Install pre-requisites
Install Denoiser
Provide the path to Denoiser in ~/.bashrc file
Define variable in Denoiser/settings.py
Follow the mini-tutorial in README to denoise the sequences
To get fasta file, quality file and sff text file from sff file
Quality Filtering and barcode assignment
-f fasta file
-q quality file
-m barcode mapping file
-w enable sliding window test for quality scores
-r remove unassigned reads (deprecated)
-l minimum sequence length
-L maximum sequence length
Prefix clustering
-i SFF text file
-f quality filtered sequence file
-o output directory
-s squeeze, run-length encoding for prefix-filtering
-v verbose
-p the primer sequence
Flowgram clustering and Denoising
-i SFF text file
-p Output directory of prefix clustering
-v verbose
-o output directory
2. Pre-cluster
1. Denoiser
- Software for rapidly denoising pyrosequencing amplicaon reads by exploiting rank-abundance distributions.
- It is an alternative to PyroNoise software suite
- It is included in the new release of Qiime 1.3
Download
$ wget http://www.microbio.me/denoiser/Denoiser_0.91.tgz $ tar zxvf Denoiser_0.91.tgz $ cd Denoiser_0.91
Pre-requisites
Python: >= 2.5.1 http://www.python.org PyCogent toolkit: >= 1.4 http://pycogent.sourceforge.net ghc: >= 6.8 (recommended for install) http://haskell.org/ghc
Install pre-requisites
$ sudo apt-get install ghc
Install Denoiser
$ cd FlowgramAlignment $ make ghc --make -O2 FlowgramAli_4frame [1 of 3] Compiling ADPCombinators ( ADPCombinators.lhs, ADPCombinators.o ) [2 of 3] Compiling FlowgramUtils ( FlowgramUtils.lhs, FlowgramUtils.o ) [3 of 3] Compiling Main ( FlowgramAli_4frame.lhs, FlowgramAli_4frame.o ) Linking FlowgramAli_4frame ... $ make install cp FlowgramAli_4frame ../bin/
Provide the path to Denoiser in ~/.bashrc file
PYTHONPATH=$PYTHONPATH/:$HOME/software/Denoiser_0.9/ export PYTHONPATH
Define variable in Denoiser/settings.py
PROJECT_HOME = home + "/path/to/Denoiser_0.91/"
Follow the mini-tutorial in README to denoise the sequences
To get fasta file, quality file and sff text file from sff file
$ sffinfo 454Reads.sff > 454Reads.sff.txt $ sffinfo -s 454Reads.sff > 454Reads.fasta $ sffinfo -q 454Reads.sff > 454Reads.qual
Quality Filtering and barcode assignment
$ denoiser/split_libraries.py -f 454Reads.fasta -q 454Reads.qual -m barcode_to_sample_mapping.txt -w 50 -r -l 150 -L 350
where,-f fasta file
-q quality file
-m barcode mapping file
-w enable sliding window test for quality scores
-r remove unassigned reads (deprecated)
-l minimum sequence length
-L maximum sequence length
Prefix clustering
$ preprocess.py -i 454Reads.sff.txt -f seqs.fna -o example_pp -s -v -p CATGCTGCCTCCCGTAGGAGT
where, -i SFF text file
-f quality filtered sequence file
-o output directory
-s squeeze, run-length encoding for prefix-filtering
-v verbose
-p the primer sequence
Flowgram clustering and Denoising
denoiser.py -i 454Reads.sff.txt -p example_pp -v -o example_denoised
where,-i SFF text file
-p Output directory of prefix clustering
-v verbose
-o output directory
2. Pre-cluster
- It is part of the mothur package
- It a pseudo-single linkage algorithm with the goal of removing sequences that are likely due to pyrosequencing errors.
3. SeqNoise
- It a pseudo-single linkage algorithm with the goal of removing sequences that are likely due to pyrosequencing errors.
3. SeqNoise
Labels:
denoiser,
denoising,
Mothur,
pre-cluster,
pyrosequences,
qiime
Wednesday, October 12, 2011
Python :: Installation :: Without root access
Operating System: Ubuntu 64-bit
Download Python from http://www.python.org/getit/
$ wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2
$ bunzip2 Python-2.7.2.tar.bz2
$ tar xvf Python-2.7.2.tar
$ ./configure --prefix=$HOME/bin/python
$ make
$ make install
Check if it works
$ $HOME/bin/python/bin/python
Load the path in your .bashrc file
$ echo "PATH=$PATH:$HOME/python/bin" >> ~/.bashrc
$ source ~/.bashrc
No we should be able to run python.
Download Python from http://www.python.org/getit/
$ wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2
$ bunzip2 Python-2.7.2.tar.bz2
$ tar xvf Python-2.7.2.tar
$ ./configure --prefix=$HOME/bin/python
$ make
$ make install
Check if it works
$ $HOME/bin/python/bin/python
Load the path in your .bashrc file
$ echo "PATH=$PATH:$HOME/python/bin" >> ~/.bashrc
$ source ~/.bashrc
No we should be able to run python.
Tuesday, October 4, 2011
Qiime-1.3.0 :: Installation
Download Qiime-1.3.0 from
URL: http://sourceforge.net/projects/qiime/files/releases/Qiime-1.3.0.tar.gz/download
Installation on Ubuntu 64-bit machine
Extract the contents in the tar ball
$ tar zxvf Qiime-1.3.0.tar.gz
$ cd Qiime-1.3.0
$ vim README
Dependencies( check and Install)
1. Python >= 2.6
$ python --version
Python 2.7.1+
or
$ sudo apt-get install python-numpy python-numpy-doc
URL: http://sourceforge.net/projects/qiime/files/releases/Qiime-1.3.0.tar.gz/download
Installation on Ubuntu 64-bit machine
Extract the contents in the tar ball
$ tar zxvf Qiime-1.3.0.tar.gz
$ cd Qiime-1.3.0
$ vim README
Dependencies( check and Install)
1. Python >= 2.6
$ python --version
Python 2.7.1+
2. NumPy >= 1.3.0
download url: http://sourceforge.net/projects/numpy/files/NumPy/1.6.1/
$ tar zxvf numpy-1.6.1.tar.gz
$ cd numpy-1.6.1/
$ python setup.py install --user # installs to your home directory
or
$ sudo apt-get install python-numpy python-numpy-doc
3. PyCogent >= 1.5.1.
download url: http://sourceforge.net/projects/pycogent/
Extract the contents
$ tar zxvf PyCogent-1.5.1.tgz
$ cd PyCogent-1.5.1/
With root access,
$ python setup.py build
$ sudo python setup.py install
Without root access,
$ python setup.py build_ext -if
- which compiles the extensions in place (the i option) forcibly (the f option, ie even if they’ve already been compiled).
- move the cogent directory to where you want it (or leave it in place)
- add this location to your python path using sys.path.insert(0, "/your/path/to/PyCogent") in each script, or by setting shell environment variables (e.g. $ export PYTHONPATH=/your/path/to/PyCogent:$PYTHONPATH)
4. Matplotlib
$ sudo apt-get install python-matplotlib
NOTE:
- If you DO NOT intend on using denoiser, it works good
- If you Do intend on using denoiser, it will create an error called
cogent.app.util.ApplicationError: Calling /home/username/qiime/lib/qiime/support_files/denoiser/bin/FlowgramAli_4frame failed. Check permissions and that it is in fact an executable.
- I am not sure yet how to solve this.
Now move the qiime config file to your home directory
$ cp qiime/support_files/qiime_config ~/.qiime_config
$ sudo apt-get install python-matplotlib
or download it from http://matplotlib.sourceforge.net/
Installation Qiime
$ python setup.py install --install-scripts=/home/username/qiime/bin/ --install-purelib=/home/username/qiime/lib/ --install-data=/home/username/qiime/lib/
- where user has to be replaced with username of the current user.
- As of now, it runs into a problem
:
running install_data
error: can't copy 'qiime/support_files/denoiser/bin/FlowgramAli_4frame': doesn't exist or not a regular file.
I looked up in Qiime Google groups page, as of this post, the developers has been informed on this error with setup.py and they have mentioned on rectifying it. This error may not show when u download. If it does, then a small trick completes the installation. Just run the below command and rerun the setup.py command
$ touch qiime/support_files/denoiser/bin/FlowgramAli_4frame
NOTE:
- If you DO NOT intend on using denoiser, it works good
- If you Do intend on using denoiser, it will create an error called
cogent.app.util.ApplicationError: Calling /home/username/qiime/lib/qiime/support_files/denoiser/bin/FlowgramAli_4frame failed. Check permissions and that it is in fact an executable.
- I am not sure yet how to solve this.
The build will succeed with the following message
Build finished. The HTML pages are in _build/html.
Local documentation built with Sphinx. Open to following path with a web browser:
/path/to/Qiime-1.3.0/doc/_build/html/index.html
If you have installed Qiime using above steps then you have to provide path in .bashrc file
$ echo "export PATH=/home/username/qiime/bin/:$PATH" >> ~/.bashrc
$ echo "export PYTHONPATH=/home/username/qiime/lib/:$PYTHONPATH" >> ~/.bashrc
$ source ~/.bashrc
- dont forget to replace the username with your username
Now move the qiime config file to your home directory
$ cp qiime/support_files/qiime_config ~/.qiime_config
Since we created the binary files in another location, we have to provide the path to it in the configuration file. Look for the line that begins with qiime_scripts_dir
$ vim ~/.qiime_config
qiime_scripts_dir /home/username/qiime/bin
qiime_scripts_dir /home/username/qiime/bin
- Note, the white space between the two values is a tab, Dont use space
- Also dont forget to replace the username with your username.
Testing
- Also dont forget to replace the username with your username.
Testing
Move to the tests folder and execute the tests script
$ cd tests
$ python all_tests.py
$ cd tests
$ python all_tests.py
Friday, September 9, 2011
HTML5 :: div :: rounded corners :: webkit
CSS with webkit
.round {
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
}
CSS without webkit
.round {
// All corners are round
border-radius: 10px;
// diagonally opposite corners are rounded;
border-radius: 10px 3px;
// custom round
border-radius: 20px 3px 8px 14px;
}
HTML5 :: Work in IE8
HTML5 tags dont work on IE, to make it work include the lines below in the <head>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->;
Subscribe to:
Posts (Atom)
