Question: Recently, I read a book called "Swallowed Star". In the story, a virus changes human DNA enough for humans to have unbelievable superpowers and skills. Some even obtain the ability to have their own gravitational pull and not breathe in space.

I want to know if it is actually possible for genes to be able to cause such things, or is it just impossible theoretically speaking if there isn't enough matter?

PS. Sorry if this sounds like a stupid question. I don't have the knowledge of space and viruses to answer this myself. Please forgive me.

Answer: 
I would argue that a sufficiently complex (that is, likely not natural) retro-virus could make some changes like super-strong, super-fast, likely significantly improved senses of sight and hearing. Even there it might only express (either fully or even partially) in children rather than already-grown individuals. And to effect children the retro-virus would need to infect gamete-producing tissues.

To do away with the need to breathe you would need to integrate an entirely different metabolic pathway, I suppose technically feasible, somehow, but seems unlikely. Even more unlikely for that alternative to be as energetically-favorable as using free oxygen from an atmosphere (that is, just as jet engines have better performance than rockets because they don't have to carry their oxidizer along with them). However, none of that seems as unlikely as modifying gravity.

None of those things are 'magical'. Basically imagine the most optimized organism you can think of along any given axis and it could probably be accomplished.
In real life many people have genes for diseases they will never have. The unlucky ones are the people who get cancer, for example, after suffering a severe infection. The Epstein-Barr virus "turns on" the genes responsible for a certain kind of blood cancer. This is called epi-genetics. It's still a developing field.

In your story, gaining superpowers by way of a virus infection could be explained by an epi-genetic change kicking in, though your human would have to already have the genes necessary to express that power. That can be explained by their ancestors also having had superpowers which would carry through the generations just like hair colour, height, handedness, and a million other characteristics.

[epi-genetic](/questions/tagged/epi-genetic "show questions tagged 'epi-genetic'") [superpowers](/questions/tagged/superpowers "show questions tagged 'superpowers'") [genetics](/questions/tagged/genetics "show questions tagged 'genetics'")