
Does electromagnetism, ultrasound, or weightlessness have any effect on determining the sex of the worm Caenorhabditis elegans?

C. elegans has two sexes: hermaphrodite and male. You probably know that in humans, women have two X chromosomes while men have one X chromosome and one Y chromosome, and that is how gender is genetically determined. In worms, hermaphrodites have two X chromosomes, but males have only one X chromosome with no Y chromosome. That is, males have one fewer chromosome than hermaphrodites.
Imagine at the very early stage of an embryo when the embryo is just one cell, if the embryo has two X chromosomes, it will grow up to be a hermaphrodite, but if something happens and the cell loses one X chromosome, then it will grow up to be a male. Therefore, any environmental factor that affects X-chromosome stability will affect the male-to-hermaphrodite ratios. In addition, some genes are known to affect X-chromosome stability. Any environmental factor that causes gene mutation may thus result in mutations in these genes and eventually cause a change in worm sex determination.
High electromagnetic energy such as X-rays or ultraviolet (UV) light will cause gene mutation in worms. This could lead to alteration in sex determination when certain genes are mutated. In general, low-energy electromagnetic fields have little or no effect on sex determination. However, it is known that high temperature will cause increased X-chromosome loss and hence result in more males. Therefore, it is possible to use microwave radiation or manipulate the electromagnetic field to induce heat and then create a high incidence of males.
NASA has put worms in space shuttles, and the weightlessness didn't increase gene mutations. So far, there is no report of changes in worm sex determination due to weightlessness.
Your question about the ultrasound effect on worm sex determination is really hard to answer because there is no study on this. If it is a low-power ultrasound, like the ones used for diagnostic medical imaging, there is probably no effect. High-power ultrasound can kill cells and break them into pieces. Since there is no study on this topic, we don't know whether a middle-range ultrasound can have an effect on worm sex determination without killing the worms.
References
Worms in space: International Caenorhabditis elegans Experiment(ICE).
Genetic control of sex determination in worms
Scientific articles on worms in space:
1. Higashitani, A., et al. Checkpoint and physiological apoptosis in germ cells proceeds normally in spaceflown Caenorhabditis elegans. Apoptosis 10(5): 949−954, 2005.
2. Zhao, Y. et al., A mutational analysis of Caenorhabditis elegans in space. Mutation Research 601(1-2): 19−29, 2006.