bioinformatics - Genetic processes help in java -
i need guidance on java project. i'm develop human genetic(family) tree.
this subject:
each human cell contains 23 pairs of chromosomes numbered 1 22,and pair of sex chromosomes: xx in females , xy in man. during fertilization, 22 chromosomes + (x or y) of man merges 22 + x chromosome of woman. results in 22 pairs of chromosomes + (x or y) in cell form future baby. 23rd chromosome transmitted father (an x or y) determine sex of child (xx girl, xy boy).
each chromosome carries many genes (encoding everything, characteristic morphological, physiological, behavioral). due pairs of chromosomes, genetic information duplicated (except parts of sex chromosomes). each copy of gene called allele. means example, if gene responsible color of eye, allele blue.
the genetic information expressed consequence of combined expression of alleles being present. dominant allele expressed in genome of bearer. however, if information 1 allele not expressed when dominant allele of same gene present, recessive allele. peculiarity of recessive allele of gene can present in genome , transmitted on several generations without expressed in phenotype bearers. if there no dominant allele, 2 copies of gene have same recessive allele (homozygous recessive) recessive character expressed. through use of family tree, possible determine expression of gene within family.
the program should able following:
- generate simplified version relied on 23 chromosomes , allow user place genes on chromosomes simulate replication, mitosis, meiosis , fusion of chromosomes , display locations of genes on resulting cells.
- allow draw genealogical trees , deduced probabilities (or certainty) on expression of genes on person's family tree.
so far i've created class gene , class chromosome. next, thought creating class "parent" example , creating 23 chromosomes in it. before doing want make 23rd chromosome different man/woman. simulates replication, crossovers, mitosis etc.. don't know if i'm on right track. don't know how specify particular allele/gene recessive or dominant. moment classes act in random manner.
gene.java
import java.util.random; /** * @author mkab * */ public class gene implements cloneable { private object allele; public gene(){ super(); } public gene(object allele){ super(); this.allele = allele; } /** * randomly selects trait trait1 or trait2 , returns new gene trait * @param trait1 * @param trait2 * * @return new gene */ public gene randomallele(object trait1, object trait2){ object allele = null; random rand = new random(); int = rand.nextint(2);// generate between 0 , 2: 2 possibilities: 0 or 1 switch(i){ case 0: allele = trait1; break; case 1: allele = trait2; break; } return new gene(allele); } public gene clone() throws clonenotsupportedexception{ gene g; g = (gene) super.clone(); return g; } /** * @param allele allele set */ public void setallele(object allele) { this.allele = allele; } /** * @return allele */ public object getallele() { return allele; } /* (non-javadoc) * @see java.lang.object#tostring() */ @override public string tostring() { return "gene [allele=" + allele +"]"; } }
chromosome.java
import java.util.arraylist; import java.util.iterator; /** * class creates pair of chromosome adding random genes * @author mkab * */ public class chromosome implements cloneable { /** * user can put many genes possible on chromosome */ private arraylist<gene> genes = new arraylist<gene>(); public chromosome(){ super(); } public chromosome(arraylist<gene> genes){ this.genes = genes; } /** * add gene object chromosomes list. */ public void addgene(gene gene) { genes.add(gene); } /** *creates copy of chromosome */ @suppresswarnings("unchecked") @override public chromosome clone()throws clonenotsupportedexception{ chromosome c; c = (chromosome) super.clone(); c.genes = (arraylist<gene>)this.genes.clone(); //iterator<gene> = c.genes.iterator(); /*gene tmp; while(it.hasnext()){ }*/ return c; } /** * @return genes */ public arraylist<gene> getgenes() { return genes; } /** * @param genes genes set */ public void setgenes(arraylist<gene> genes) { this.genes = genes; } /** * * @return */ public int getsize(){ return genes.size(); } /** * @return gene @ index of arraylist * @param index - index @ return gene */ public gene getgenes(int index) { return genes.get(index); } /* (non-javadoc) * @see java.lang.object#tostring() */ @override public string tostring() { return "chromosome [genes=" + genes + "]"; } }
thanks
Comments
Post a Comment