Thursday, July 10, 2014

Insomnia due to back pain

I've noticed a number of people are posting on medical advice websites with the following symptoms: Sleep for 2-5 hours and wake up with a lot of back pain which goes away after getting up. Even napping during the day lying down will cause back pain in a couple of hours especially after a meal.

If this is happening to you, you may be suffering from acid-reflux erosion of the esophagus which can cause enervation (activation) of the nerves in the esophagus and stomach. This leads to your back pain via a process called Referred Pain. Referred pain is the process where pain induced in one part of your body is 'felt' in another part. As you can see from the chart in the Wikipedia article, stomach-based referred pain shows up in the middle of the back along the spine.

Now these pain symptoms are not going to be an exact match to the chart. Personally, I would feel like an electric charge was running along one of my ribs from my spine to my front during the earlier stages of my symptoms. Everybody's anatomy is slightly different and you'll get variations on the theme. However, it was primarily back pain that I was feeling. Now my pain almost exactly matches the chart.

After way too many specialists including a neurologist who should have had a clue about this, my GP at the time, Dr Karkalis in King of Prussia (fantastic doctor IMHO) who likes to review challenging patient charts at night for fun, thought my symptoms might be due to acid reflux. He was right, but in order to finalize the diagnosis, he prescribed a proton-pump inhibitor. After a few weeks my back pain from sleep was reduced significantly.

Another way to diagnose this and manage it longer term is to tilt the head of your bed up by 15-20 degrees to let gravity keep the acid in your stomach instead allowing it into your esophagus. If your back pain abates (not necessarily overnight though it often does) fairly quickly, then your back pain is likely due to acid reflux.

Sadly, you will need to sleep elevated for the rest of your life if you have acid-reflux back pain. The proton-pump inhibitors are pretty safe drugs, but they are not always be able to control your acid-reflux enough to control the pain completely. As you can see from my hammock blog post, hammocks work really well to set the right angle for sleeping and are much less expensive than adjustable beds.

Your acid reflux will be more or less severe at different times due to exercise, stress, eating habits, body weight so your management of it will need to accommodate the severity of your acid reflux. In other words, you may need to increase the angle of your bed when your acid reflux is more severe.

Also, check with your doctor and get tested for Barret's Esophagus. Basically, serious acid reflux sufferers are at higher risk for esophageal cancer.

Sunday, August 26, 2012

Acid Reflux, Camping, Hammocks and Holes

This is a personal blog article.  I generally try to keep this to professional matters, but I would like to record this for those of us suffering from acid reflux.  I've been dealing with it for over a decade now and mostly control it via mechanical means - sleeping on an incline.  After a couple of hours sleeping flat, I get referred pain from my esophagus which feels like back pain.  I try really hard to figure out how to sleep on an incline so I can get 6-8 hours of sleep instead of 2-3 hours of sleep and then 2-3 hours sitting up until the pain subsides, rinse, repeat.  

I was camping last weekend, first time since I've started noticing my acid reflux.  I generally suffer when away from home and try all sorts of tricks with setting the bed on blocks to create an incline, build a mound of pillows, or sleep in a recliner.  I wasn't looking forward to sleeping on the ground for a couple of nights.  

I tried to find a spot on a bit of a slope, but that had to be balanced with the desire to not slide down on a slippery tent floor in a slippery sleeping bag.  The first night was absolutely miserable.  I did manage 5 hours or so I think.  I woke up somewhere between 3-4am in pain and left the tent so I wouldn't disturb my campmates.  Being in pain, cold, and really tired doesn't make for a lovely camping trip.  

I was absolutely dreading the coming night and trying to find a nice spot of ground (shaped like a recliner) to set up my sleeping bag and pad and praying that it wouldn't rain.  My wife fortunately found the right spot and not something I would have thought of.  It was a hole about 2 feet deep, 2 feet wide and 3 feet long in a U shape.  It turned out to be a perfect, recliner-like, shape.  I tried it out and immediately felt comfortable.  Long story short, I had a great night sleeping in the hole.  I heartily recommend digging a hole to sleep in if you have trouble sleeping on your back or sleeping flat due to acid reflux issues.

This experience started me thinking about using a hammock when away from home as it would provide the same shape..  Looking on Google, there are a LOT of articles on using baby hammocks for babies with acid reflux and very few about adults using hammocks to manage acid reflux.  I took the plunge anyway and bought a hammock to try out.  I slept in it last night, and it worked great.  I was able to sleep for a very long time (about 10 hours - trying to catch up on missed sleep).  It was very comfortable all night, and I had no pain indicative of acid reflux this morning. 

It seems to be a successful experiment - though I do need a few more data points to fully confirm it of course.  Assuming that additional data points confirm this approach, I need to figure out how to take the hammock with me when traveling.  Hotels don't generally provide hammock hooks in the wall.  Travel-wise, hammocks don't take up much room which is good as I hate checking bags when I fly.  The hammock I tried out was the ENO Double Nest Hammock which doesn't take up much space or weight (about the size of a grapefruit and less than two pounds).

ENO Double Nest Hammock (Tomato/Khaki)

ENO Double Nest Hammock (Navy/Olive)

These straps are handy to hang the hammock with:  ENO Slap Straps

I'd recommend getting two carabiners to replace the ones that come with the hammock based on reviews I saw on Amazon:  Black Diamond Neutrino Carabiner - Grey

 

 

Tuesday, July 17, 2012

String Similarity

This post is my attempt at recording a very nice thread of posts on BioNLP.org's mailing list on string similarity measures. Harsha G at Molecular Connections asked about string similarity measures which prompted 

Tools recommended:

Papers:

Responses:

From Tudor Groza:

Dear Harsha,

I would suggest you have a look at Simmetrics [1] - it is a comprehensive
package for string similarities ranging from basic ones, like Levenshtein
distance to more advanced one, like Smith-Waterman or Needleman-Wunch. You
can find the Java API at [2] - for some reasons the original page is
missing, hence the only way to get to it is via the Web archive.

Hope that this helps.

[1] http://sourceforge.net/projects/simmetrics/
[2]
http://web.archive.org/web/20081225104938/http://www.dcs.shef.ac.uk/~sam/simmetrics/index.html

Kind regards,
Tudor

 

From Sampo Pyysalo:

Dear Harsha, all,

Not sure what your exact needs are, but I've found that in
approximate-matching lookup against many larger biomedical resources it's
good to do a fast, comparatively simple first-pass lookup before running
more advanced string comparison algorithms to avoid the computational costs
of full comparison for a large number of string pairs. I've found Naoaki
Okazaki's simstring (http://www.chokkan.org/software/simstring/) to be
excellent for this first task. The way I'd recommend to use this is to
first filter a large string collection to a reasonably-sized set of best
matches (in terms of a comparatively coarse similarity function like char
n-gram cosine) with simstring and then run more advanced stuff like
custom-cost edit distance for this smaller set.

There are a number of studies by Okazaki as well as Yoshimasa Tsuruoka and
others on the topic of string similarity metrics for domain tasks that may
also be of interest to you, e.g.
http://dx.doi.org/10.1093/bioinformatics/btm393

Cheers,

Sampo

From Florian Leitner:

Dear Harsha,

A good overview is the 2003 W. Cohen paper "promoting" the SoftTFIDF measure and with a very good overview of available similarity measures:

http://dc-pubs.dbs.uni-leipzig.de/files/Cohen2003Acomparisonofstringdistance.pdf

As for libraries to do string similarity matching, there are many, many options available. As they have not been mentioned so far, most prominently, there are the Regular Expression libraries.

-- REGEX
In terms of pure speed, some of Google's own searches are powered by re2 (developed by a Google search engineer), a deterministic RegEx ("DFA")  engine that is significantly faster than the "default" engines available in most other programming languages (because they are all are at least in parts non-deterministic, i.e., "NFAs"). However, due to the pure deterministic nature there is quite some default functionality missing (e.g., lookaheads and -behinds, etc.), so you have to define all variants you wish to match in your patterns (no approximate matches!), while it is blazingly fast:

http://code.google.com/p/re2/

In terms of pure approximate matching speed, don't forget that *nix offers a pretty powerful approximate string matching implementation right at your "fingertips":

http://www.tgries.de/agrep/

Last, another C implementation of a POSIX compliant approximate (DFA-based) regex matcher is TRE, although this is library is therefore somewhat slower than the RE2 engine, too:

http://laurikari.net/tre/

These three regex libraries are probably the most noteworthy if you need raw speed. Then there are a few Java regex libraries that seem noteworthy, too:

First, there is a non-determinisitc RegEx engine (FREJ) to do approximate matching, also in Java:

http://frej.sourceforge.net/

And yet another Java regex implementation, partially DFA and partially NFA, is the Brics Automaton:

http://www.brics.dk/automaton/

(there are much more Java regex libraries, but let Google be your best friend if you need even more pointers...)

-- DISTANCE
Apart from the regex/D- or NFA based implementations, there are distance-based measures to do approx. string matching. A very fast similarity search tool is SimString, an approximate matcher based on distance measures, and already mentioned by Sampo in his post, in C++:

http://www.chokkan.org/software/simstring/

Probably the most well-known package in this domain is the SecondString package from the CMU (from W. Cohen, the author cited above) for approx. string matching in Java, also based on edit distance measures:

http://secondstring.sourceforge.net/

Last I'd mention there is a simple Python module to calculate n-gram-based similarities; while I do love Python very much, alone due to that fact that this is Python-based, it will most likely be the slowest option listed here:

http://packages.python.org/ngram/index.html

Hope this helps to get you up to [matching] speed!

Cheers,
Florian

 From Aurélie Névéol:

Harsha,

Another measure to look into is the "PubMed distance" described in this paper:

Lu Z, Wilbur WJ. Improving accuracy for identifying related PubMed queries by an integrated approach. J Biomed Inform. 2009 Oct;42(5):831-8.

An example of use and evaluation can be found in this other paper:

Névéol A, Islamaj-Doğan R, Lu Z. Author Keywords in Biomedical Journal Articles. Proc AMIA Annu Symp. 2010:537-41.

Best regards,

Aurelie

From Bob Carpenter:

I'd suggest looking further than Jaccard distance in
the LingPipe matchers.  We have TF/IDF matchers based
on character n-grams that are widely used in practice (not
just by us or with our implementation;  note
that this is NOT the same as Cohen et al.'s soft TF/IDF,
which I've never fully understood).

There's also the Jaro-Winkler matchers, which are
tuned for matching single-word names.

LingPipe also has a dictionary-based matcher that will
spot approximate matches (by weighted edit distance) in
text using the Aho-Corasick algorithm for deterministic
matching and suffix arrays for speeding approximate matching.

And you can also use something like an HMM- or CRF-based
chunker to find matches in texts.  It basically then looks
like a named-entity problem.

If you want something fancier that should outperform any of
these methods, check out this paper by McCallum, Bellare and Pereira:


http://lingpipe-blog.com/2010/04/27/mccallum-bellare-and-pereira-2005-a-conditional-random-field-for-discriminatively-traied-finite-state-string-edit-distance/

I'm also quite keen on this method for string comparison
by Dreyer, Eisner and Smith, though I haven't tried it, either:

  http://aclweb.org/anthology-new/D/D08/D08-1113.pdf

And in the end, you may be wanting to do something like cluster
similar terms rather than just provide pairwise similarities.
Andrew McCallum and crew have done some great work on this problem,
and there's a huge swath of "deduplication" and "record linkage"
literature that's related.

Tuesday, February 7, 2012

CAPEX, OPEX and Cloud?

Here is a really good overview of CAPEX and OPEX as well as how it impacts Cloud Computing initiatives:

http://itprojectfinancials.com/insights/2011/06/05/capitalizing-software-development-costs-from-sdcl-to-agile/

I think we all find the CAPEX/OPEX financial issues to be troubling on multiple levels.  Thanks to Matthew Dube for letting me know about this.

Fable of the porcupine

Fable of the Porcupine:

It was the coldest winter ever, and many animals died because of the cold. The porcupines, realizing the situation, decided to group together to keep warm, but the quills of each one wounded their closest companions. After a while, they decided to distance themselves from one another, but then they began to die, alone and frozen.

They had to make a choice: Either accept the quills of their companions or die. Wisely, they learned to live with the little wounds caused by their close relationships, in order to receive the heat that came from the others. This way they were able to survive.

Moral of the story:

The best relationship is not the one that brings together perfect people; it's when each individual learns to live with the others' imperfections and can admire their good qualities.

Background:

A friend of mine, Nils Onsager, Master Hapkido Instructor, shared this with me.  I found it an excellent parable for diversity and the challenges inherent in diversity.


Saturday, April 30, 2011

Lab Notebook Digitization

I've got a few posts planned about our Lab Notebook Digitization project.  We recently had to change our lab notebook archiving process.  We had been using a vendor (Carmel Business Systems - CBS) in San Diego, but when we closed our site there, it didn't make much sense to ship them across the country to be digitized and then have to ship them back.  It is too bad as CBS had done a great job.  They worked with us about about 6 years ago to build a digitization process using digital cameras which was much faster and cheaper than the old system of microfilm with scanners filling in for color lab notebook pages.

When reviewing the options, we looked at the state of the state for outsourcing digitization which six years later is much more mature.  Since we are digitizing our archived notebooks (ones archived with the older process), we were also looking for a less expensive option for several thousand lab notebooks.  We were a bit surprised at the cost of outsourcing digitization in our local market.  So surprised in fact (and due to the rather budget-breaking costs), that we looked into more of a DIY approach.

I was very happy to see how far the DIY digitization marketplace has come.  There are now at least two very good digitization vendors in the marketplace with included software for digitizing books (thank you Google Books and Microsoft and Internet Archive and the EU for creating this market).  I looked at several vendors, but the best ones for my needs were Kirtas and Atiz.  As much as I love the concept of an army of digitization robots stoking my dreams of megalomaniacal world domination, I realized the Kirtas digitization robot would not be suitable for lab notebooks which have foldouts, pockets for photographs and all sorts of other creative ways of communicating intellectual property that are impossible for the Kirtas robot to deal with.  Kirtas does have manual stations, but I wasn't as impressed with those compared to the BookDrive series from Atiz.  The LED lights, V cradle and the V glass for holding the books down were features I really liked along with the price.  Price was definitely a selling feature.

Based on the cost of a fully loaded BookdrivePro with excellent 22 megapixel cameras and the staff required to run it, we estimated our digitization costs per notebook to be about 3-4X cheaper than the best estimate we could get from an external digitization vendor.  We expect to increase that ratio to about 5-6X  after Atiz improves their software based on some suggestions a colleague of mine (James McIninch) made.

Google's Birthday Wishes

I was quite pleased today to see Google's Birthday wishes to me.  It's impressive how pervasive personalization can be and how nice it is (though still a bit creepy - I've taken to turning off the monitor now when I'm talking about something sensitive --  just kidding :)