I'm programming genetic processes in java for my project and I want simulate the mitosis of a human cell. A human cell contains 23 pairs of chromosome. Mitosis is basically a cell division, or reproduction, in which a cell gives rise to two genetically identical daughter cells. You can find a picture about it here (scroll a little bit down the page):
Mitosis
I think that this mitosis would be like a java method in a class "Cell" for example. So i made a class Chromosome with it's own methods to represent a single chromosome and made a class "Cell" containing 23 pairs of chromosomes. I plan on putting the method mitosis in the class Cell but the problem is that this method should return 2 identical cells and I think it's impossible to create a method that returns 2 cells in this class. I thought about making a method that would return an array of 2 cells it doesn't work. Any suggestions an how to create this method? Or maybe another approach than the one i'm using? Thanks.
Mitosis is the process in which a eukaryotic cell nucleus splits in two, followed by division of the parent cell into two daughter cells. The word "mitosis" means "threads," and it refers to the threadlike appearance of chromosomes as the cell prepares to divide.
The daughter cells from mitosis are called diploid cells. Diploid cells have two complete sets of chromosomes.
There are two ways cell division can happen in humans and most other animals, called mitosis and meiosis. When a cell divides by way of mitosis, it produces two clones of itself, each with the same number of chromosomes.
However, mitosis and cytokinesis last only about an hour, so approximately 95% of the cell cycle is spent in interphase—the period between mitoses.
Actually that's what I'm even using to clone my cells. But it's not the cloning of the cells that's my problem, it's what the method "mitosis" should return. As long as mitosis(biologically) is concerned, two identical cells are produced.
You are getting hung up over trying to make Java behave like a real world object.
What you should be focusing on is having the right number of the right kind of cells after mitosis, not on making the method signatures directly mirror the real-world events.
Mitosis is where one cell splits into two. IMO, any of the following are valid "models" in Java:
a method on this Cell that returns the other one:
public Cell mitosis() {
return this.clone(); // ... or equivalent
}
a method on this Cell that returns two cells:
public Cell[] mitosis() {
return new Cell[]{this, this.clone()}; // ... note - must return this as one
// of the objects
}
a static method that returns two cells:
public static Cell[] mitosis(Cell one) {
return new Cell[]{one, one.clone()};
}
Even the following might be right ... if the caller takes care to remove all references to the original cell.
public static Cell[] mitosis(Cell original) {
return new Cell[]{original.clone(), original.clone()};
}
But my point is that it doesn't really matter what the signatures are. What matters is that after the method (and the caller) have done there stuff, the new model has the right Cell objects in the right relationships.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With