Human cell mitosis

I am programming genetic processes in java for my project and I want to simulate mitosis of a human cell. A human cell contains 23 pairs of chromosomes. Mitosis is basically cell division or reproduction, in which a cell generates two genetically identical daughter cells. Here you can find the picture (scroll a little page):

Mitosis

I think this mitosis will be similar to the java method in the "Cell" class, for example. Therefore, I created the Chromosome class with its own methods for representing a single chromosome and created the "Cell" class containing 23 pairs of chromosomes. I plan to put the mitosis of the method in the Cell class, but the problem is that this method should return 2 identical cells, and I think it is impossible to create a method that returns 2 cells in this class. I was thinking of creating a method that would return an array of 2 cells, it does not work. Any suggestions on how to create this method? Or maybe a different approach than the one I use? Thanks.

+7
source share
4 answers

I would suggest that Cell implements Cloneable and use the clone() idiom copy constructor .

In doMitosis() mode in Cell you basically do something like this:

 public Cell[] doMitosis() { Cell[] cells = new Cell[]{this.clone(), this.clone()}; return cells; } 

PS. The code is an approximate sketch, not the actual implementation. In addition, this code takes into account that the parent cell must be killed (and collected by garbage) so that 2 identical cells can have the right of passage.

+1
source

Actually, what I even use to clone my cells. But this is not cell cloning, which is my problem, this is what the mitosis method should bring back. While mitosis (biologically), two identical cells arise.

You hung up trying to get Java to act like an object in the real world.

What you should focus on is the correct number of correct cells after mitosis, and not that the method signatures directly reflect real-world events.

Mitosis is a place where one cell is divided into two parts. IMO, any of the following valid "models" in Java:

  • a method in this cell that returns another:

     public Cell mitosis() { return this.clone(); // ... or equivalent } 
  • a method in this cell that returns two cells:

     public Cell[] mitosis() { return new Cell[]{this, this.clone()}; // ... note - must return this as one // of the objects } 
  • static method that returns two cells:

     public static Cell[] mitosis(Cell one) { return new Cell[]{one, one.clone()}; } 

Even the following may be correct ... if the caller takes care to remove all links to the original cell.

  public static Cell[] mitosis(Cell original) { return new Cell[]{original.clone(), original.clone()}; } 

But I want to say that it doesn’t really matter what signatures are. The important thing is that after the method (and the caller) has done things there, the new model has the right Cell objects in the right relationship.

+3
source

As an alternative to Cloneable consider a copy constructor or a copy factory , a static factory analogue of a copy constructor.

+1
source

This turns out to be something you need to do in real Java programs - check out the Cloneable interface.

0
source

All Articles