Ubuntu 9.10 WM quirks
The quirks of my spanking new Ubuntu install is driving me nuts..
I found solutions online that do not seem to work!
1) I have to alt-tab twice to change windows (the first just shows the popup)
tried
http://ubuntuforums.org/archive/index.php/t-490238.html
http://ubuntuforums.org/archive/index.php/t-570357.html
but it seems that using compositing or adding visual effects solves the problem!
2) Alt_R doesn’t work! its a special mod key but xmodmap doesn’t help!
Any solutions is appreciated!
python script to inventorise your ab1 files with md5sums
The problem that needed solving this time was having a list of filenames of my ab1 files, location( directory path) and a md5sum so i know if duplicate filenames are the same file or just a result of misnaming.
managed to come up with this after copying from two different scripts
one that was used to make an inventory of a directory of ogg songs and the other a python equivalent of md5sum check in linux.
Have fun!
#!/usr/bin/python
#===============================================================================
#
# FILE: inventory-abi.py
#
# USAGE: ./inventory-abi.py
#
# DESCRIPTION: Lists all the files of extension .ab1 with the directory and its md5sum
# adapated from code from http://pthree.org/2007/08/09/recursion-in-python/ and
# used md5sum code from http://code.activestate.com/recipes/266486/
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: will execute md5 on directory as well
# current method to get CWD is not OS independent
# NOTES: ---
# AUTHOR: Kevin ,
# VERSION: 1.0
# CREATED: 11/07/2008 07:03:16 PM SGT
# REVISION: ---
#===============================================================================
import dircache, os, md5
counter = 0
def sumfile(fobj):
'''Returns an md5 hash for an object with read() method.'''
m = md5.new()
while True:
d = fobj.read(8096)
if not d:
break
m.update(d)
return m.hexdigest()
def md5sum(fname):
'''Returns an md5 hash for file fname, or stdin if fname is "-".'''
if fname == '-':
ret = sumfile(sys.stdin)
else:
try:
f = file(fname, 'rb')
except:
return 'Failed to open file'
ret = sumfile(f)
f.close()
return ret
def PrintFiles(indent):
global counter
thisDir = os.getcwd()
for file in dircache.listdir(thisDir):
if (file.endswith('ab1') or os.path.isdir(file)) and not file.startswith('.'):
if file.endswith('ab1'):
counter += 1
currdir = os.popen("pwd") #for output of cwd currently works for linux pending upgrade to OS independent
md5 = md5sum(file) #calls the md5sum function, md5 lib ships with Python
ab1File.write('%s%s\t%s\t%s\n' %(indent, file, currdir.readline()[:-1], md5))
if os.path.isdir(file):
os.chdir(file)
PrintFiles(indent + ' ')
os.chdir('../')
try:
ab1File = open('ab1files.txt', 'w')
except IOError, e:
print "Unable to open 'ab1files.txt' for writing: ", e
else:
PrintFiles('')
ab1File.write('\nCurrent number of ab1 files: %d\n\n' %(counter))
ab1File.close()
Odds of losing ur Lab notebook vs ur Enotebook
interesting cross discussions at Saunder’s blog about archiving your lab notebook here
and another person’s take on it which kinda reflects my own opinions .. my previous notebook was a word document it certainly is more helpful cos I dun have to flip pages but jus do a crtl-F
interestingly they both didn’t talk about the odds of having the information lost due to spilled reagents or gasp ur lab notebook catching fire. I don’t think a dog would wanna eat that dirty notebook though. But i think that in some sense an E-notebook is more liable to have data loss.
of course there are safeguards to have to prevent the data loss due to harddisk failures. But I think along the way from the bench to the computer, its likely that one forgets to insert some data..
hmm incoherent? sorry brain is abit scrambled trying to figure out ensembl annotation pipeline. anyway hope you all have a nice weekend! heh next weekend i be travelling down to Cambridge Hinxton for Ensembl User Meeting .. hopefully I get my answers!
nsaunders does a tag cloud on journal feeds
Save Toner when printing from Consed output!
finally found the answer here from this helpful site!
166) PRINTING CONSED WINDOWS
There is a free (or nearly free) program called “xv”. One web site is
http://www.trilon.com/xv It is written by one of those dying breed of
UNIX programmers who just *loved* UNIX and programming and sharing it.
His web site is enjoyable because some of his passion comes through.
With xv, you can make a postscript file from a Consed window. Then
you can print the postscript file on a color printer.
However, since some Consed windows are mostly black (Aligned Reads
Window and Traces Window), this uses up a lot of toner and is
difficult to read. So go to the Consed Main Window, pulldown the
‘Options’ menu and release on ‘General Preferences’. Scroll down to
“Make light background in Aligned Reads Window…” and click on “Do it
now”. Dismiss any Aligned Reads Windows or Traces Windows and then
bring them back up. You will notice the light background. A few
other things (traces colors and thickness) are also customized for
making color prints.
Python script to split a text file by even or odd numbers
written a short script to split a file into even or odd line numbers
#!/usr/bin/python
## loop do something to each line of input file
## changed to write the even line numbers to a file
## and the odd line numbers to another
## note that even numbers start with line 0 (not 1!)
## usage: sort-even-odd.py inputfile
## written by kevinl @ kevinl.wordpress.com
import sys
def isodd(n):
return bool(n%2)
input=open(sys.argv[1], 'r')
L=input.readlines()
evenout=open('evenout', 'w')
oddout=open('oddout','w')
for linecount in range(len(L)):
if isodd(linecount):
oddout.write(L[linecount])
else:
evenout.write(L[linecount])
#print "line number is " + str(linecount)
1st to publish with Google apps?
Gosh down with flu yesterday and exciting news broke out
http://code.google.com/appengine/
to read the reviews and comments check out
http://googleblog.blogspot.com/2008/04/developers-start-your-engines.html
http://nsaunders.wordpress.com/2008/04/08/googles-appengine/
I wonder who will be the first to develop an app host it there and publish a paper in a journal with it..
greasemonkey extensions have already been published. what’s stopping a bioinformatician with a lack of web resources to use google’s?
7 bioinformatics secrets every biologist should know
see this lecture in youtube!
I am already using some of the stuff mentioned in here. I might even add a few more to the list.. but it seems like a cool lecture for biologists.
http://www.mozilla.org/
http://biobar.mozdev.org/
http://www.google.com/intl/en/options/
https://addons.mozilla.org/en-US/firefox/addon/748
http://www.ihop-net.org/UniPub/iHOP/
http://bioinfo.icapture.ubc.ca/iHOPerator/
http://gaggle.systemsbiology.org/docs/
http://apropos.mcw.edu/
http://string.embl.de/
consolidated links list from computational biology blog
Rename Multiple Files Efficiently Using Excel or Google Docs
batch renaming is what I picked up perl for in the first place. Then I found interesting software like 14arename (win only). I then also picked up abit of SED and AWK in linux.
I know about the batch rename feature in winxp but it didn’t occur to me I could do it in excel. Basically this page teaches you to use
“use SUBSTITUTE to change specific text in the filenames, use CONCATENATE() with DATE() if you want to add date to the filename, etc.” to create a column of rename commands in DOS. something like
ren abcd.fa abcd.gbk
very old school i know but hey its a godsend in your colleagues windows box with no admin rights to install anything.
