Saturday, November 16, 2013

A biopython script to count the sequence identity from aligned sequences input

# A biopython script to calculate sequence identity score
# input is an aligned multiple protein, or DNA, or RNA sequences 
# with identical length including gaps
import sys
import numpy as np
from Bio import AlignIO
alignment = AlignIO.read("seq.faa", "fasta")
align_array = np.array([list(rec) for rec in alignment], np.character)
l=len(alignment)
seq2=np.arange(l)
seq=np.arange(l)
a=np.arange(l*l).reshape(l,l)
b1=a
for m in range(0,len(alignment)):
    seq[m]=0
    for n in range(0,alignment.get_alignment_length()):
        if align_array[m,n]!="-":
           seq[m]=seq[m]+1
        continue
    pass
pass  
#for i in range(0,len(alignment)):   #without parallel running
for i in range(800,1000): #parallel running, give start and finish sequence ID
    for k in range(0,len(alignment)):
        seq2[k]=0
        b1[i,k]=0
        for j in range(0,alignment.get_alignment_length()):
           if align_array[k,j]!="-":
             seq2[k]=seq2[k]+1
             if (align_array[i,j]==align_array[k,j]) and align_array[k,j]!="-":
                  b1[i,k]=b1[i,k]+1
             continue
           continue
        pass
        seq1=seq[i]
        if seq1 < seq2[k]:
           sequ=seq2[k]
        else:
           sequ=seq1
        p=1.0*b1[i,k]/sequ
        print "%3d %3d %3d %3d %3d %3d %9.6f" %(i,k,seq1,seq2[k],sequ,b1[i,k],p)
    pass
pass

Tuesday, September 17, 2013

error while loading shared libraries in Linux

install xmgrace in a SuSE linux system

'more /etc/SuSE-release' gives system info:
SUSE Linux Enterprise Desktop 11 (x86_64)
VERSION = 11
PATCHLEVEL = 2

'xmgrace' result in one of two errors:

xmgrace: error while loading shared libraries: libpng14.so.14: cannot open shared object file: No such file or directory

or

xmgrace: error while loading shared libraries: libpng14.so.14: wrong ELF class: ELFCLASS32


First error indicate the library is missing
Second error indicate the library is 32bit (not 64bit)

'ldd /usr/bin/xmgrace', part of the output is:
        ...
        libt1.so.5 => /usr/lib64/libt1.so.5 (0x00007f06d0acf000)
        libjpeg.so.62 => /usr/lib64/libjpeg.so.62 (0x00007f06d08ab000)
        libpng14.so.14 => not found
        libm.so.6 => /lib64/libm.so.6 (0x00007f06d0631000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f06d042d000)
        ...

Solution is to download the right library, google '64 bit libpng14.so.14'
result in a package named "brlcad-7.20.2-0.openSUSE.x86_64.rpm"
which has the needed library and many other libraries also
at rpm.pbone.net

Download the package
and install it by
'sudo zypper install brlcad-7.20.2-0.openSUSE.x86_64.rpm'
Then the library is installed under /usr/brlcad/lib,
copy to /usr/lib64 by 'sudo cp /usr/brlcad/lib/libpng14.so.14 /usr/lib64'

enjoy 'xmgrace' !

Friday, June 3, 2011

mpg123 in CentOS linux

At first, it gave error messages like:

[oss.c:172] error: Can't open default sound device!
[audio.c:627] error: failed to open audio device
[audio.c:180] error: Unable to find a working output module in this list: oss
[audio.c:529] error: Failed to open audio output module
[mpg123.c:869] error: Failed to initialize output, goodbye.

mpg123 -a ALSA favorite.mp3
[oss.c:176] error: Can't open ALSA!

mpg123 -a alsa favorite.mp3
[oss.c:176] error: Can't open alsa!

then suddenly,
mpg123 favorite.mp3
works!
don't know why.

Wednesday, September 1, 2010

chemical review on NMR

August 2004

Volume 104, Issue 8

pages 3517-3704

biological NMR

Tuesday, July 27, 2010

car motto

Find what you love
Love what you find

Wednesday, July 21, 2010

DinB

The DinB gene and its protein product were first discovered in Walker's lab in 1980, long before scientists knew anything about translesion polymerases. Then graduate student Cynthia Kenyon, now a biologist at University of California, San Francisco who has done groundbreaking work on the genetic basis of aging in worms, systematically identified the genes turned on in bacteria exposed to DNA damaging agents, the so-called SOS response. Kenyon named the damaged-inducible (Din) genes in order of discovery, and DinB was the second one she found.

from
http://www.medicalnewstoday.com/articles/36070.php

Wednesday, July 7, 2010

SAIC stands for

SAIC stands for Science Applications International Corporation, in case you wonder.