Often a Python class may have lots of bound methods that may fail, but it is not really a problem. Here I present a tidy way to deal with catching the errors with a decorator.
A segfault and NaN driven series of disconnected ideas, analyses and just plain silly posts about computational biochemistry, synthetic biology and microbiology.
Wednesday, 19 December 2018
How to deal with horridly complex dictionaries in Python
NCBI and Uniprot data is complex, so is understandably stored as byzantine data structures, which have rather consistent schema, but hard to decipher. Depending on workflow, XML files are can be stored as dictionaries or as ElementTree.Element instances. I will talk about both, here I will talk about dictionaries —elsewhere I discuss using ElementTree. These are easier to deal with in some cases, but you can spend ages trying to find the series of keys and indices required to find a given value.
Here I present a nice pair of Python methods to get a given key or value in a convoluted object of nested dictionary-like and list-like objects.
Here I present a nice pair of Python methods to get a given key or value in a convoluted object of nested dictionary-like and list-like objects.
Tuesday, 18 September 2018
Python website on a shoestring budget, a tutorial
If you have a Python script you want to make into a website yet want to do it for a cheap as possible, it may seem like an impossible cause. But it isn't. Three options are possible:
- use a free service
- use a grant-based service
- run a server at home on a Raspberry Pi
Each have their merits, but the latter more so. Hence, why this tutorial is dedicated to showing you how to do it.
Everything you wanted to know about isopeptide bonds in Rosetta, but were too afraid to ask
Rosetta is great at predicting (with some accuracy) the energies of variant proteins, however, to make the most out of it with proteins with internal isopeptide bonds a few considerations are needed.
Saturday, 25 August 2018
PCR distribution
The distribution of mutations in an error prone library has been modelled in Sun (1995) based on the underlying principle of a PCR reaction. In the paper it is found that the distribution becomes more and more similar to a regular Possion and the two are virtually the same after 10 cycles. However, given that one most likely does not know what one's PCR efficiency is, using this formula may be dangerous. Whereas in reality getting a better estimate of the mean number of mutations may be more helpful.
Sunday, 12 August 2018
Protein dropcaps
To make a webpage stylish does not mean that it cannot be biochemically themed. In fact, to can have both thanks to protein dropcaps! using the protein alphabet made by Prof. Mark Howarth in Nature Structural and Molecular Biology in May 2015(available Here) in combination with a wee JS script I wrote you can be a stylish biochemist. The script along with documentation is available in my GitHub page: https://github.com/matteoferla/protein_alphabet_dropcaps.
Saturday, 4 August 2018
A fully suicidal enzyme follows a second order equation
That a fully suicidal enzyme follows a second order equation is a rather intuitive statement, but it is nice to have formal proof, which is as follows.
Monday, 19 March 2018
The curious case of fluorescein and implicit waters
I recently was asked a straightforward task: get the energy scores of a given protein by itself, conjugated with fluorescein maleimide and its ring opened form. Despite that, I failed miserably because of implicit waters playing odd tricks.
Given that it is of no real use, I am happy to share so to give a tutorial of how to do that in Rosetta (ligand docking), which I found taxing the first time.
Given that it is of no real use, I am happy to share so to give a tutorial of how to do that in Rosetta (ligand docking), which I found taxing the first time.
Sunday, 18 March 2018
GFP is technically a suicide enzyme
GFP has an oxygen dependent maturation step to form its cofactor. Therefore, it could be farcically considered a suicide enzyme...
It performs a reaction: it converts oxygen to peroxide —doing a single turnover.
Saturday, 6 January 2018
Skewed mutational biases: English scrabble with Klingon tiles
Skewed mutational biases: English scrabble with Klingon tiles
In a game of Scrabble one draws seven tiles from a bag and the best results are found when a bag and the language used match. In library making with error-prone PCR one does not have that luxury, but different methods differing degrees of fairness. Mutazyme is like playing in English with a Latin tile set, while manganese Taq with equal nucleotides is like playing in English with a Klingon tile set.Thursday, 4 January 2018
Pi projects: a new year's resolutions
2018 is here. I have papers that I want to or have to write and endless tasks I want to complete, but life is not all about career-driven self-sacrifice, it is also about having fun and what better way than with physical computing. And more time passes the more Rasberry pi projects I find I want to do. So I thought I'd share my shortlist of what I think are the most useful.
Subscribe to:
Posts (Atom)