Whole Pictures and Python
I really believe there's a need for scientists, and particularly those dealing with biology, to look on from outside objectively and ask what it is they're contributing to the general pool of knowledge. However, that doesn't mean we should stop working on the focused projects that abound and that make up the vast majority of tractable projects in the field.
Anyhow, with that said, I also wanted to jump over and mention Python. A couple of recent classes on the subject have been given here at the GSC, which have given me a very light feel for the language. At first, I figured it was just as wonky as perl, but after writing my very first Python script, I can see the beauty, elegance and flexibility of the language. With no further ado, let me unveil my first script for processing a large data flat file:
import os, sys, re
readfile = file('/home/afejes/Desktop/SNPanalysis.TUandREADS', "r")
Mutation= re.compile(r"[1-9]+[A-Z]+>>>[A-Z]\s\(\w+\)", re.VERBOSE)
Genename = re.compile (r"------>\sENSG", re.VERBOSE)
writefile = file('/home/afejes/Desktop/SNPanalysis.SNPS', "w")
for line in readfile:
if Genename.match(line):
Gene = line[8:23]
elif Mutation.match(line):
writefile.write(Gene + '\t' + line)
else:
pass
readfile.close()
writefile.close()