Friday, February 26, 2010

Common Math Symbols in HTML

From John D. Cook's web page: a table of common symbols in mathematics and their corresponding HTML entity entries.

An alternative for math nerds:
(1) ∃ a page of that contains a table of HTML codes for common symbols used in math.
(2) Symbols in table ⊂ all math symbols.

Local Variables in Perl

Many programming languages allow you to associate variables with a scope. The scope of a variable defines the context in which a variable can be accessed and manipulated. In Perl, this is how you declare a local variable inside of a scope:

{
 my $x;
}


This means that the scalar variable $x can't be accessed outside of the braces. However, this is also valid Perl:
{
 local $x;
}


Perversely, this does not create a local variable named $x. This actually does this:
  • save the current value of $x (outside the braces) somewhere safe.
  • make a new variable named $x that can be used inside of $x.
  • when the scope of the new variable is cleared, replace $x with the old value.

This is a little complicated, so here's an example that illustrates the behavior of local:


$x = 3;
{
 local $x = 'foo';
 print $x, "\n";
}
print $x, "\n";

The output of this program is:

foo
3


In general, you should use my much more frequently than local, and overuse of
local can be considered a code smell. Read more about my and local in Coping with Scoping.

Tuesday, February 23, 2010

British to pay for placebo treatments out of pocket

A committee of British MPs have recommended that the British National Health Service discontinue homeopathy as a routine treatment for health issues. From an article by Andy Coghlan in the New Scientist


In preparing its report, the committee, which scrutinises the evidence behind government policies, took evidence from scientists and homeopaths, and reviewed numerous reports and scientific investigations into homeopathy. It found no evidence that such treatments work beyond providing a placebo effect.


This seems like a strong victory for the reality-based community. There are the usual complaints from people supporting homeopathy, such as:
Michael Dixon, medical director of the foundation adds: "Science is a vital tool in healthcare, but so are compassion and caring and treating patients with dignity. It is not clear that the Committee took that into account."
I'm not sure why ineffective remedies are supposed to be compassionate, and I think that the burden of proof rests with supporters of homeopathy to make the case that ineffective remedies are still useful.

Monday, February 22, 2010

One-Star Reviews for John Scalzi

John Scalzi is one of my favorite authors, I think he does great work as an author and as a blogger. He has a new post up on Whatever about One-Star Reviews. The basic idea is that he's found reviews of books on Amazon.com that give a book the lowest possible rating and a detailed description of why such a rating is deserved. John posts such reviews of two books currently nominated for awards, and then says this:
I think it’s useful for all us writers to remember no one work pleases everyone, and you can’t make anyone like it if they don’t, and you can’t keep them from telling other people what they think of it, even if they hate it… and that’s fine. Learn to deal with it. Otherwise it doesn’t matter how much success or praise or satisfaction you earn through your writing, you’ll still obsess over those one-star reviews and it will eat away at your joy. That’s no way to live.
I have a strong perfectionist streak, and this is important advice for people like me. If you want to do good work, you need to work very hard. You need to avoid being overwhelmed by extreme amounts of praise or criticism, because both are distractions from what you're really trying to accomplish. Most of all, you should probably remember that in some ways criticism is partially praise - something about your work has drawn people in enough to give it a chance. Even though some people might not end up liking your work, work that everyone likes is bland, banal and boring.

Saturday, February 20, 2010

Genome-Wide Associations of SNPs to Viral Infection Susceptibility

I just skimmed over a paper in which a genome-wide association study was performed in order to identify genes that are involved in susceptibility to viral infection:

Genome-Wide Identification of Susceptibility Alleles for Viral Infections Through a Population Genetics Approach

I think that this work is very provocative, but I'd like to see a plausible functional basis for these genes to be involved in viral infection susceptibility.

These are the premises of their argument:
1. The number of distinct viral species in a geographic region should be correlate well with the amount of viral-driven selection in that region.
2. We have measurements of 660,832 single nucleotide polymorphisms that can be associated with geographic regions (specifically the HGDP-CEPH panel data).

They calculated Kendall's rank correlation (aka Kendall's Tau) for single nucleotide polymorphisms and their viral diversity data. They report 441 variants that survive a Bonferroni correction (alpha = 0.05), and notice that many variants are either in genes known to have a role in viral infection, or in genes for which such a role is plausible.

Potential Issues

They mention the possibility that the SNP data is simply correlating with another variable that they've not controlled for. They test calculate the same Kendall's rank correlation statistic for the following variables:
- average annual minimum temperature
- average annual maximum temperature
- short wave UV radiation flux

They found that none of the SNPs associated with virus diversity correlated with virus diversity associated with any of these variables. It's obviously impossible to perform this control on every possible confounding variable, but the concern of alternative explanations for some of these genes remains an open question. I would be surprised if all of these variants ended up really being involved in viral response. I would imagine that viral diversity in some regions could be heavily correlated with bacterial diversity, and some of these genes might be involved in response to bacterial infection.

They also mentioned that their study doesn't have statistical power to pick up some regions of the genome known to have small but definite effects on viral infection in humans, such as HLA.

Finally, until we have a functional understanding of what these genes are actually doing I don't think that we can be very confident in any of these genes. I am fairly confident that many of their associated SNPs are not directly related to viral infection. The fact that the SNPs are most likely only associated with a functional genetic difference means that there is a lot of work left to do.

To make the point more plainly, we can divide the genes from their study into two groups:

1. Genes that have a known involvement in viral interactions.
2. Genes that have no such interaction.

The genes in group 1 are good to see, but we already know about those genes. The real test of this data will be to see how many genes from group 2 end up having validated functional roles in viral infection. To really understand how many of these variants are really associated with viral infections we need more work. Generating more hypotheses to test is a worthy goal in science, but the jury is out about exactly how much we've learned from this particular experiment.

Dolphins Can Manage Diabetes

Stephanie Venn-Watson has just presented data suggesting that dolphins have the ability to switch on and off type II diabetes depending on the availability of food.

"By taking regular blood samples of the dolphins, she discovered that they could induce type II diabetes at times of fasting and then almost immediately turn it off again when food became available."

Here is the full news story by the Richard Alleyne, published in the Telegraph. I'm very interested in reading the actual article. I'm guessing that the dolphins can somehow control their insulin production (some forms of type II diabetes affect your response to insulin in addition to production), and I wonder at what level this regulation is happening. I also wonder if there are other species that have this ability, as it's likely to be a generally useful trick for mammals. Perhaps there are even humans whose insulin production varies in and out of diabetic states in response to food scarcity.

I'd like to see more functional data on how this works, but it's a very interesting idea.

Amy Bishop - Strange and Deluded

Amy Bishop is clearly a disturbed individual who tragically attacked her colleagues with a gun, killing three and wounding several more. The more that I learn about her story, the stranger the picture of her situation becomes. Apparently on one of her papers she lists her husband and their three children as co-authors.

From Mary Agnes O'Connor at Shepherds and Black Sheep:

"Evidence strongly suggests that Dr. Bishop used her husband, her family and by all appearances the sham 'Cherokee Labsystems' to fabricate a record of recent accomplishments. Her use of essentially an online vanity publisher further diminishes her professional stature.

It should have been no surprise to Dr. Bishop that the University easily saw through the smoke and mirrors and that she would not receive tenure. But an oversized ego can be blinding."

The blog post is worth reading if you're interested in the life of this neurobiologist-turned-murderer.