/** * A method that find the length of longest gene. * * @param genes The genes of a dna strand. * @return The Length of longer gene. */ public int longestGene(StorageResource sr) { int maxlength = 0; for (String a : sr.data()) { maxlength = Math.max(a.length(), maxlength); } return maxlength; }
public void printGenes(StorageResource sr) { int counter60 = 0; int counter035 = 0; for (String a : sr.data()) { if (a.length() > 60) { System.out.println("String length longer than 60 : " + a); counter60++; } if (cgRatio(a) > 0.35) { System.out.println("CG Ratio greater than 0.35 : " + a); counter035++; } } System.out.println("Number of elements with length greater than 60 : " + counter60); System.out.println("Number of elements with CG ratio greater than 0.35 : " + counter035); }