Posts by Tags

bash

Conditional execution in bash

1 minute read

Published:

Situation: You want to execute a script as soon as a particular file is created.

This is an easy one-liner:

# waiter.sh
# Usage: ./waiter.sh script_to_be_run file_to_anticipate [time_delay, def. 10 mins] 
while [ ! -f $2 ]; do sleep ${3-10m}; done; bash $1

The while loop keeps checking the existence of the specified file: while the file does not exist the loop will run sleep on and on. When the file exist, loop will be exited and the specified script will be run. Could it get any simpler? It seems like a waste just to continually check, but I don’t see a better option for now. (If you are wu liao run bash -x waiter.sh to see how many sleeps your waiter.sh has to go through to finally run your desired script.)

One learning point – I was using this kind of thing before to make a positional argument optional:

[ "$3" = "" ] && time_delay="15m" || time_delay=$3

This is a “ternary” bash construction, which you can construe as a shorthand conditional: A && B || C means “if A is true; execute B; else execute C”.

Turns out the easier way is using shell parameter expansion magic:

time_delay=${3-15m}  # if $3 is unset, set $3 to 15m
time_delay=${3:-15m} # if $3 is unset or null, set $3 to 15m

Extracting sequence from PDB file

3 minute read

Published:

There are times that you need the sequence of only the resolved amino acids in an X-ray crystal structure, not the full sequence of the construct. If you download the FASTA sequence or check the SEQRES record in the PDB file, you would only find the full sequence.

How to persistently run your script with Bash

1 minute read

Published:

This is a simple script that saves a lot of headaches for me. The situation: I’m running a proprietary software and it seems that there is a problem with the way our license server is setup, because from time to time the process will stop due to “not enough license” even though we have enough. Then we have to rerun, which is ok because there are checkpoint files, but it is a pain to constantly check whether my run has crashed or not.

Formatting list of SMILES with bash scripting

2 minute read

Published:

Here is a fun text manipulation exercise using bash you can do in less than an hour. Given that I have this text file, file.smi:

smiles1 some_id_abc
smiles2 some_id_xyz
...

I want to have it like this:

smiles1 C00000001
smiles2 C00000002
...

This was my real-world need of converting a list of SMILES to a format that is accepted by a conversion programme. Looks easy right?

Simple web scraping with Python

4 minute read

Published:

The situation: I wanted to extract chemical identifiers of a set of ~350 chemicals offered by a vendor to compare it to another list. Unfortunately, there is no catalog that neatly tabulates this information, but there is a product catalog pdf that has the list of product numbers. The detailed information of each product (including the chemical identifier) can be found in the vendor’s website like this: vendor.com/product/[product_no]. Let me show you how to solve this problem with bash and Python.

Good practice for bash scripting

6 minute read

Published:

I will illustrate some good practices of writing bash scripts by showing you how I write and refactor my bash script dock.sh that does some preparation for docking and then launch docking.

coding

Doing t-test in batch

1 minute read

Published:

Situation: I want to do t-test between two sets of experiment A and B. Each A and B were run in triplicates, so we have:

data_A_1.dat
data_A_2.dat
data_A_3.dat
data_B_1.dat
data_B_2.dat
data_B_3.dat

How to run t-test between every combination of A and B, as well as all A combined vs all B combined?

Formatting list of SMILES with bash scripting

2 minute read

Published:

Here is a fun text manipulation exercise using bash you can do in less than an hour. Given that I have this text file, file.smi:

smiles1 some_id_abc
smiles2 some_id_xyz
...

I want to have it like this:

smiles1 C00000001
smiles2 C00000002
...

This was my real-world need of converting a list of SMILES to a format that is accepted by a conversion programme. Looks easy right?

Good practice for bash scripting

6 minute read

Published:

I will illustrate some good practices of writing bash scripts by showing you how I write and refactor my bash script dock.sh that does some preparation for docking and then launch docking.

Picking up Python as a scientist

4 minute read

Published:

My PhD supervisor prophetically decreed back in 2013 that “it might do thee some good to learn Python” (not his exact words).

computational biology

Simple web scraping with Python

4 minute read

Published:

The situation: I wanted to extract chemical identifiers of a set of ~350 chemicals offered by a vendor to compare it to another list. Unfortunately, there is no catalog that neatly tabulates this information, but there is a product catalog pdf that has the list of product numbers. The detailed information of each product (including the chemical identifier) can be found in the vendor’s website like this: vendor.com/product/[product_no]. Let me show you how to solve this problem with bash and Python.

Structure leads to function

5 minute read

Published:

Structure leads to function is a fundamental tenet of structural biology. It may sound obvious (or not), but the implications are profound.

Job title

2 minute read

Published:

What science field label do you give yourself?

Why do simulation?

5 minute read

Published:

Why do we do what we do? — is a question that should be asked by practitioners of any vocation

grace

jupyter notebook

Molecular similarity network with visualised structures

less than 1 minute read

Published:

Analogous to a Sequence Similarity Network (SSN), molecular similarity network visualises Tanimoto similarity between molecules. iwatobi shows how to construct one with molecular structures here and here using Python packages RDKit, networkx, and cyjupyter.

lab notebook

Link roundup: Jun 2019

1 minute read

Published:

Science
Inside the ‘secret underground lair’ where scientists are searching the galaxies
23 ‘facts’ you learned about healthy eating and nutrition as a kid that are no longer true
Pop Sci | The 10 worst insect stings in the wild
The Scientist | Could Tolerating Disease Be Better than Fighting It?
In the Pipeline | A New Way For the Machines To Handle Reagents

For those in the crowd who aren’t synthetic chemists, it cannot be emphasized enough that there is no way that you could have known about either of these choices beforehand – and that if you change the reaction to another bromo-heterocyclic system, the optimal base and solvent are likely to switch again to something else entirely. It’s as bad as cell culture or X-ray crystal growing, two other areas that are famously infested with evil spirits and voodoo rituals. You run into these systems that are just intrinsically very sensitive to initial conditions, with variables that are sometimes too small or obscure for you to even realize that they’re variables.

Potassium hunting on protein factories
Biotech Cockaigne of the Vegan Hopeful
Quanta | Neuroscience Readies for a Showdown Over Consciousness Ideas
Physics Today | The mysterious crystal that melts at two different temperatures
TLS | Weighty matters
Nature | Reproducibility trial publishes two conclusions for one paper

Papers
PLoS Comp Bio | Open collaborative writing with Manubot

Others
The New Yorker | Liu Cixin’s War of the Worlds
How to Pick a Career (That Actually Fits You)
Book Review: The Secret Of Our Success
The Pu-erh Brokers of Yunnan Province
Aeon | A Revolution in Time

Link roundup: May 2019

2 minute read

Published:

Science
NYT | Frances Arnold Turns Microbes Into Living Factories
In the Pipeline | Antibody Design, Publicly Challenged
Nature | A DIY approach to automating your lab
The Atlantic | The Myth of ‘Learning Styles’
The New Yorker | Can We Live Longer but Stay Younger?
8 Simple Tips to Live Longer and Healthier
Sci Am | Can You Prevent Pregnancy with the Pullout Method?
Nautilus | Yes, Determinists, There Is Free Will
Nature | Indonesia tops open-access publishing charts
There Is Such a Thing as Too Much Coffee, Scientists Say tl;dr Drinking no or too much coffee is associated with higher incidence of CVD/CAD/stroke so drink 1-2 cups/day.
5-HTTLPR: A POINTED REVIEW
Science | Meet the blue crew, scientists trying to give food, flowers, and more a color rarely found in nature
Let your cat submit your grant application
CONIECT researcher wins big on TV show, will use cash to fund cancer project
The Scientist | Genetically Modified Viral Cocktail Treats Deadly Bacteria in Teen
Nautilus | Nurture Alone Can’t Explain Male Aggression
New approach for solving protein structures from tiny crystals
In the Pipeline | A Small-Molecule CRISPR Inhibitor
CBD: a marijuana miracle or just another health fad?
CNN | The most effective ways to curb climate change might surprise you
Vox | Why you shouldn’t exercise to lose weight, explained with 60+ studies
Nautilus | How the Western Diet Has Derailed Our Evolution
Science | Want to become a better mentor? Ask for anonymous feedback
Nature | How small changes to a paper can help to smooth the review process
10 Things No One Told Me About Applying for Tenure
Deadly box jellyfish antidote discovered using CRISPR genome editing
Nat Geo | See the world’s oldest trees by starlight
In the Pipeline | Muting Mutations

Papers
Nature | Design and evolution of an enzyme with a non-canonical organocatalytic mechanism
R Soc Open Sci | Communicating uncertainty about facts, numbers and science
PLoS Comp Bio | Securing the future of research computing in the biosciences
Nature | Total synthesis of Escherichia coli with a recoded genome
Ann Intern Med | Association Among Dietary Supplement Use, Nutrient Intake, and Mortality Among U.S. Adults: A Cohort Study

Others
Wired | The Glorious, Almost-Disconnected Boredom of My Walk in Japan
How to Grow Up: A Guide to Humans
SMBC | Thin Ice
HBR | The Hard Truth About Innovative Cultures
The Politics of Humor
Darwinian existentialism: The history — and evolution — of the meaning of life
Want to Fall Asleep Faster? Military Pilots Use This Hack to Sleep Anywhere in 2 Minutes or Less

Link roundup: Mar 2019

4 minute read

Published:

Science
Science | Mine your mind for the data to drive your career
Nautilus | A Magician Explains Why We See What’s Not There
Nature | Why the sexes don’t feel pain the same way
Quantum computing for the very curious
All the Cannabinoids in Marijuana That Aren’t THC
Nature | ‘Particle’ robot swarm moves without computer control (video)
Wired | The Read/Write Metaphor Is a Flawed Way to Talk About DNA
Nature | Protein-slaying drugs could be the next blockbuster therapies
Aeon | Why is simpler better?
Draw molecular network on Jupyter notebook with rdkit and cytoscape.js-2 #RDKit #cytoscape
How UMAP Works UMAP is dimension reduction algorithm like PCA analysis. Paper is available in arXiv.
Death of the calorie
Surgical stitch-up: meet the placebo surgeon
Quanta | How Artificial Intelligence Is Changing Science
Nature | How I was almost mistaken for a chocolatier
Nature | Enzymes trapped and zapped for use outside cells (Paper in Angewandte Chemie)
Merchants of Hype
A Stanford psychologist on the art of avoiding assholes

I would make a distinction between temporary and certified assholes, because all of us under the wrong conditions can be temporary assholes. I’m talking about somebody who is consistently this way, who consistently treats other people this way. I think it’s more complicated than simply saying an asshole is someone who doesn’t care about other people. In fact, some of them really do care — they want to make you feel hurt and upset, they take pleasure in it.

Why Do We Need Sleep? Israeli Scientists Solve the Mystery
In the Pipeline | A New FDA Commissioner, Suddenly

… See, just get the government out of the way and everything starts to flourish! But as I’ve said many times, the FDA is not the real roadblock in this business. It’s biology. More specifically, it’s our lack of understanding of biology. Lowering standards will do nothing to help that at all.

The professional advisers who can help you to move from academia to industry
Papers
ACS Chem Bio | Esterification Delivers a Functional Enzyme into a Human Cell
Q Rev Biophys | Frustration in Biomolecules 2014 paper, but I only read it recently. Besides providing a nice mental model of frustration in thinking about protein physics, the text is written in decidedly unacademic prose.
Nature | Complete biosynthesis of cannabinoids and their unnatural analogues in yeast
PLoS Comp Bio | Script of scripts: A pragmatic workflow system for daily computational research
This is like Makefile, but more user-friendly, you can switch languages easily, and is hosted in Jupyter notebook. If you constantly switch between bash, Python, R, and others; this is good to keep your workflow in one file. I think I don’t need it at the moment.
Others
Choosing our religion

Creation is thus seen as a relationship of radical dependence. To cite an insight deriving from St Thomas Aquinas, God’s creation of the world should not be likened to a carpenter making a chest. A better analogy would be more intimate – a singer producing a song, for instance. The difference is profound. Carpenter and chest are discrete entities. Carpenters can pass on the articles they make, never seeing them again. But a song is by definition an emanation of a singer.

A crucial difference between humans and other animals is equally plain. Genuinely fulfilled human lives involve further dimensions including dignity, which is connected with the exercise of choice; and virtue, implying the need to stretch or transcend ourselves. G. K. Chesterton wrote that it makes little sense to upbraid a lion for not being properly lion-like: lions are lions. The same is not true of human beings. People everywhere have a striking idea that they ought to behave in certain “humane” ways, but also an awareness that they do not in fact behave as they should. It is often noted that these two facts are the root of all clear thinking about ourselves and our world.

Did You Know Pandas Can Do So Much?
I find these Ruben Bolling’s illustrations amusing: 1 | 2
GQ | The Secrets of the World’s Greatest Art Thief
What We Owe a Rabbit
Regarding the Em Dash
A history of Singapore in 10 dishes

Link roundup: Feb 2019

6 minute read

Published:

Science
Nature | Low pay, exclusivity requirements and lack of support plague postdocs across Europe
Edge | Biological and Cultural Evolution Essay by Freeman Dyson

Our double task is now to preserve and foster both biological evolution as Nature designed it and cultural evolution as we invented it, trying to achieve the benefits of both, and exercising a wise restraint to limit the damage when they come into conflict. With biological evolution, we should continue playing the risky game that nature taught us to play. With cultural evolution, we should use our unique gifts of language and art and science to understand each other, and finally achieve a human society that is manageable if not always peaceful, with wildlife that is endlessly creative if not always permanent.

Nature | The ten commandments for learning how to code
The Atlantic | Scientists Are Totally Rethinking Animal Cognition
Nautilus | How the Biggest Fabricator in Science Got Caught
On one hand, it is good to pre-screen data with a statistical tool, but on the other, is it that hard to generate data that appears to be experimentally derived? I can imagine, instead of coming up with the numbers oneself, one could sample from a random number generator with specified distribution. How would one detect this sort of fraud?
Nautius | Why Misinformation Is About Who You Trust, Not What You Think
NY Times | Why Do South Asians Have Such High Rates of Heart Disease?

Studies show that at a normal body weight — generally considered a body mass index, or B.M.I., below 25 — people of any Asian ancestry, including those who are Chinese, Filipino and Japanese, have a greater likelihood of carrying this dangerous type of fat.

Eat Meat. Not Too Much. Mostly Monogastrics.

…a diet including chicken and pork, but no dairy or beef, has lower greenhouse gas emissions than a vegetarian diet that includes milk and cheese, and almost gets within spitting distance of a vegan diet.

The Scientist | Tiny, Motorized Pill Delivers Vaccine to Mouse Intestine
Vox | How one scientist coped when AI beat him at his life’s work AlphaFold
NatGeo | Life probably exists beyond Earth. So how do we find it?
Phys.org | Working proteins make good use of frustration
Nature | Quantum ‘spookiness’ explained (video)
Sci Am | Why Do the Northern and Southern Lights Differ?
Professor’s ‘grave misconduct’ in UMN lab leads to discipline
Nature | What 50 principal investigators taught me about my failure to land tenure
Nature | Three secrets of survival in science advice

All LSTABs face a dilemma. Politicians generally prefer direct answers to their questions. In other words, they want policy recommendations. They have been known to ask for ‘one-handed scientists’, so that they don’t have to hear ‘on the other hand’.

NY Times | Everywhere in the Animal Kingdom, Followers of the Milky Way
Chemistry World | Molecular movie reveals how twisting methyl disturbs aspirin electrons
The Atlantic | The Women Who Contributed to Science but Were Buried in Footnotes
Wired | Monkeys With Superpower Eyes Could Help Cure Color Blindness
Aeon | Becoming: From zygote to tadpole, in six stunning minutes (video)
Wired | This Jagged Little Pill Could Make Diabetes Easier to Treat
Nature | The science of tea’s mood-altering magic

Borgwardt says the Korean study shows that tea has “a relatively strong effect”, on a par with that of 2.5 hours of exercise per week. Epidemiological studies suggest that long-term habitual consumption of green tea might reduce the risk of dementia. One study of people aged over 55 in Singapore, for example, found that those who drank as little as one cup of tea per week performed better at memory and information-processing tasks than did non-tea-drinkers2.

3QD | A Truly Amazing And Beautiful Connection Between Math And Physics
In the Pipeline | Targets Versus Drugs
The Atlantic | Feed a Cold, Don’t Starve It
Nautilus | The Real Secret of Youth Is Complexity
Nature | Forget everything you know about 3D printing — the ‘replicator’ is here
Promises, promises, and precision medicine

However, nearly two decades after the first predictions of dramatic success, we find no impact of the human genome project on the population’s life expectancy or any other public health measure, notwithstanding the vast resources that have been directed at genomics. Exaggerated expectations of how large an impact on disease would be found for genes have been paralleled by unrealistic timelines for success, yet the promotion of precision medicine continues unabated

For science, or the ‘motherland’? The dilemma facing China’s brightest minds
Sci Am | Hollywood: Can You Get Climate Change Right for Once?

“Twelve years until we all die” is catchier than “under some reasonable but debatable assumptions about economic growth, policy choices, and the physical climate sensitivity, the carbon budget to stay below the arbitrary threshold of a 1.5 degree C temperature increase relative to pre-industrial conditions appears to be exceeded by 2030”.

Paper
PNAS | Mobile platform for rapid sub–picogram-per-milliliter, multiplexed, digital droplet detection of proteins
ChemRxiv | Click, Zoom, Explore: Interactive 3D (i-3D) Figures in Standard Manuscript PDFs [via Chemistry World] Quite cool. But not everyone uses Adobe Acrobat reader…
PLOS Comp Bio | DeepDrug3D: Classification of ligand-binding pockets in proteins with a convolutional neural network
Nature | Ultra-large library docking for discovering new chemotypes
Chem Comm | Enantioenrichment of racemic BINOL by way of excited state proton transfer
Others
Believers without belief
Nature | Gifts of Prometheus A sci-fi short story
How Chinese novelists are reimagining science fiction
Awesome Python Python resources list
Beware Isolated Demands For Rigor
The Proverbial Murder Mystery
Mc Sweeney’s | How to Finish Your Dissertation Before the Heat Death and Gradual Extinction of the Universe
SMBC | Robot Love
xkcd | Error Bars
Indonesia and the West: From Debussy to Lou Harrison

Link roundup: Jan 2019

4 minute read

Published:

Science
Nature | Can quantum ideas explain chemistry’s greatest icon?
Quizzes from Harvard’s The Music Lab If you have always suspected that you are tone deaf, have I got a quiz for you.
Nature | Extreme chemistry: experiments at the edge of the periodic table

This is somewhat as expected: the strength of chemical bonding tends to decrease down a periodic group, as atoms get larger. But to fully explain superheavies’ chemistry, Pershina’s calculations must also take into account relativistic effects. In very heavy atoms, which have super-strong interactions between the innermost electrons and the highly charged nuclei, the electrons are travelling so fast (potentially at more than 80% of the speed of light) that their mass increases, as special relativity predicts. This pulls them farther in towards the nucleus, which can mean that they screen the outer electrons from the nuclear charge more effectively. That alters the outer electrons’ energies and, consequently, their chemical reactivity.

Nature | Flying squirrels are secretly pink
Harvard Business Review | Time for Happiness
In the Pipeline | Exercise And Its Signaling
In the Pipeline | Quinine’s Target Quinine’s target has been identified. This is significant step in malaria research.
BBC | A bit of meat, a lot of veg - the flexitarian diet to feed 10bn
The Smithsonian | The Statistician Who Debunked Sexist Myths About Skull Size and Intelligence
PopSci | Saturn is ancient, but its rings are only as old as the dinosaurs
Nature | Watch: Robot reveals how ancient reptile ancestor moved It’s cool that they even make interactive demo
Nature | Cryptic DNA sequences may help cells survive starvation
In the Pipeline | Nivien’s Shot Drug research is hard
In the Pipeline | Come One, Come All to These Kinases.
Is Sunscreen the New Margarine?
Nature | Designer protein delivers signal of choice Layman summary of a new paper
The Conversation | The periodic table is 150 – but it could have looked very different
Science | Four lessons about transitioning from academia to the ‘real world’
Brain Pickings | Love After Life: Nobel-Winning Physicist Richard Feynman’s Extraordinary Letter to His Departed Wife
The Guardian | Why exercise alone won’t save us
The Scientist | Can Viruses in the Genome Cause Disease?
The Atlantic | Why Exaggeration Jokes Work
Wired | How a Reclusive Lizard Became a Prize Find for Wildlife Smugglers
3 Quarks Daily | The vast and mysterious real numbers
Paper
PLOS Comp Bio | Inherent versus induced protein flexibility: Comparisons within and between apo and holo structures
Science | An enantioconvergent halogenophilic nucleophilic substitution (SN2X) reaction
Science | Porphyromonas gingivalis in Alzheimer’s disease brains: Evidence for disease causation and treatment with small-molecule inhibitors
PLOS Comp Biol | Ten simple rules on how to create open access and reproducible molecular simulations of biological systems
ACS Catalysis | Structure-Guided Triple-Code Saturation Mutagenesis: Efficient Tuning of the Stereoselectivity of an Epoxide Hydrolase
Cell Chem Bio | What Makes a Kinase Promiscuous for Inhibitors?
Nature | Enzymatic assembly of carbon–carbon bonds via iron-catalysed sp3 C–H functionalization
It’s nice to see that even though Frances Arnold just received the Nobel Prize, she is still actively publishing papers. Or maybe I notice just because I am on the lookout for publications on protein design ¯\_(ツ)_/¯
PNAS | Dietary sugar silences a colonization factor in a mammalian gut symbiont [via Scientific American]
Others
What Was It About Animorphs? I never finished reading Animorphs when I was a teenager because the library didn’t have the complete collection. Reread everything last year and glad that I did.
Language Log | Slavs and slaves
NYT | Virginia Woolf? Snob! Richard Wright? Sexist! Dostoyevsky? Anti-Semite!

I think we’d all be better readers if we realized that it isn’t the writer who’s the time traveler. It’s the reader. When we pick up an old novel, we’re not bringing the novelist into our world and deciding whether he or she is enlightened enough to belong here; we’re journeying into the novelist’s world and taking a look around.

As Tintin turns 90, the comic book hero is still teaching children about the world
I have a similar anecdote with the author about the informativity of comic books. Though it was with Doraemon, of all things.
Language Log | Sinographs for “tea” Fascinating. Adding The True History of Tea to my to-read.
Buzzfeed News | How Millennials Became The Burnout Generation
The Next Level of Data Visualization in Python

Link roundup: Dec 2018

1 minute read

Published:

Science
TED talk | Hans and Ola Rosling: How not to be ignorant about the world Classic Hans Rosling TED talk [via 3 Quarks Daily]
Nautilus | Iron Is the New Cholesterol Donate blood, people!
In the Pipeline | We Have Given People Amyloid Disease
Kurt Gödel and the romance of logic
Nature | Enzymes engineered to trap reaction intermediates with link to the paper therein
The Scientist | Scientists Don’t Stay for Long in Their Jobs Anymore: Study
What’s the Most Dangerous Food of All Time?
Synthetic biology: A call for a new culture of responsibility
Science | Chess, a Drosophila of reasoning
The Scientist | Book Excerpt from Gene Machine “…author Venki Ramakrishnan relays the moment when he and collaborators finally solved the structure of a ribosomal subunit.”
The Atlantic | The CRISPR Baby Scandal Gets Worse by the Day
Popular Science | Cannabis gets its high-inducing power from ancient viruses
Paper
BMJ | Key opinion leaders’ guide to spinning a disappointing clinical trial result [via In the Pipeline]
Science | Molecular to organismal chirality is induced by the conserved myosin 1D [via In the Pipeline]
Proc. R. Soc. London, Ser. A | The origins of quantum biology A nice historical review
J Med Chem | qFit-ligand Reveals Widespread Conformational Heterogeneity of Drug-Like Molecules in X-Ray Electron Density Maps
Nature | Mannose impairs tumour growth and enhances chemotherapy [via In the Pipeline]
J Med Chem | Two Decades under the Influence of the Rule of Five and the Changing Properties of Approved Oral Drugs
Others
Aeon | Who decides what words mean [via Language Log]
Graphical vi-vim Cheat Sheet and Tutorial
The Atlantic | The World’s Most Efficient Languages

machine learning

others

Book notes: On not speaking Chinese

31 minute read

Published:

This book is quite different from my usual reading, which is mostly fiction, science-fiction, and popular science. This book is categorically a humanities book. In fact, some chapters were previously published in humanities journal. Nevertheless, I persevered through, since the subject is close to my heart (and my identity). Also, Ien Ang’s writing is not boring academic prose. It is certainly not easy reading, but it is very readable and her personal stake in the subject also helps. The book is an academic, yet also personal, essay.

Swedish loanwords and pronunciation woes

2 minute read

Published:

I’m reading Oliver Sacks’ Uncle Tungsten and was delighted to find out that tungsten is a Swedish loanword (lit. heavy stone). That got me revisited my list of Swedish loanwords we have in English, as well as some names that have become scientific terms.

Revisiting Gödel

2 minute read

Published:

For years after I first encountered Gödel’s incompleteness theorems, they had utterly baffled me (just look at the Wikipedia page and tell me if it is comprehensible). So I dismissed it as one of those inexplicable-to-non-mathematicians things.

Rainbow connection

5 minute read

Published:

My most impressionable memory of seeing a rainbow happened in a tourist bus in Iceland. It was faint, like a watercolour painting on the canvas that was the pale blue sky and the treeless Icelandic landscape. I noticed it first, and a few minutes later the whole bus was teetering at one side of the bus, peering spellbound out of the window (except for the bus driver, I hope).

python

Automated form-filling with Python

2 minute read

Published:

Situation: You need to submit a lot of stuff to a website, but it only provides individual submission, not batch.

Molecular similarity network with visualised structures

less than 1 minute read

Published:

Analogous to a Sequence Similarity Network (SSN), molecular similarity network visualises Tanimoto similarity between molecules. iwatobi shows how to construct one with molecular structures here and here using Python packages RDKit, networkx, and cyjupyter.

Doing t-test in batch

1 minute read

Published:

Situation: I want to do t-test between two sets of experiment A and B. Each A and B were run in triplicates, so we have:

data_A_1.dat
data_A_2.dat
data_A_3.dat
data_B_1.dat
data_B_2.dat
data_B_3.dat

How to run t-test between every combination of A and B, as well as all A combined vs all B combined?

Simple web scraping with Python

4 minute read

Published:

The situation: I wanted to extract chemical identifiers of a set of ~350 chemicals offered by a vendor to compare it to another list. Unfortunately, there is no catalog that neatly tabulates this information, but there is a product catalog pdf that has the list of product numbers. The detailed information of each product (including the chemical identifier) can be found in the vendor’s website like this: vendor.com/product/[product_no]. Let me show you how to solve this problem with bash and Python.

Picking up Python as a scientist

4 minute read

Published:

My PhD supervisor prophetically decreed back in 2013 that “it might do thee some good to learn Python” (not his exact words).

science

Book notes: The Two Cultures

6 minute read

Published:

The Two Cultures | CP Snow

The stuff Snow was talking about in this lecture feels antiquated now. Probably it was the peculiar time and place that polarised the “two cultures”. Or perhaps it was Snow’s caricaturisation. (Snow himself looked retrospectively at his 1959 lecture in Part II.)

Nevertheless we can always learn something – some of the points are interesting and and applicable. The divide of the current age though is between scientists and non-scientists – hopefully it is something we will overcome. The introduction by Stefan Collini also proves to be a commentary that is also worth reading.

science education

Book notes: The Two Cultures

6 minute read

Published:

The Two Cultures | CP Snow

The stuff Snow was talking about in this lecture feels antiquated now. Probably it was the peculiar time and place that polarised the “two cultures”. Or perhaps it was Snow’s caricaturisation. (Snow himself looked retrospectively at his 1959 lecture in Part II.)

Nevertheless we can always learn something – some of the points are interesting and and applicable. The divide of the current age though is between scientists and non-scientists – hopefully it is something we will overcome. The introduction by Stefan Collini also proves to be a commentary that is also worth reading.

Muscle memory

1 minute read

Published:

I have been teaching swimming to a friend who is relatively a beginner. I often found myself having no words to describe a certain motion or posture and go “you just have to experience it with your body”. While I do attribute this partly to my lack of training as a swimming instructor, I still think there are things that cannot be conveyed in words, especially when it comes to motoric stuff, don’t you think?

Martial art: Definitely a motoric stuff
Image credit: SMBC Comics

Anyway, thinking about this my mind wandered to the talk about failures in science. It’s like this – before I did my PhD I have of course heard things about the inevitable stress and failures (and I find myself saying the same thing to pre- and current PhD students too) but knowing it cognitively is different from experiencing it oneself, isn’t it?

Here is a recent Nature article on the subject: <Scientific progress is built on failure>. Reading this, on one hand I hope that a PhD student or a prospective one takes note and does the necessary mental preparation; but on the other hand, I cannot help but go “My son, I know these things would fall on deaf ears. You just have to experience it for yourself”.