fredkneeland / DNA_Analysis

Java code for analyzing human dna
GNU General Public License v3.0
1 stars 3 forks source link

Add RGB calculator for DNA letter -> 'ATGC' #11

Open fredkneeland opened 6 years ago

fredkneeland commented 6 years ago

Add a class that creates an RBG color for each of the ATGC letters. Add another method that returns an average color for a count of 'A', 'T', 'G' and 'C'

i.e.


class ColorGenerator {
  // [0] => Red Color from 0-255
  // [1] => Green Color from 0-255
  // [2] => Blue Color from 0-255
  public static int[] colorGeneratorForLetter(Char letter) {
     switch(letter) {
         // TODO: return a const color here for each letter
      }
  } 

  public static int[] averageColorForLetterCounts(int aCount, int tCount, int gCount, int cCount) {
     // use colorGeneratorForLetter and averages to determine color
   }
}
ynx0 commented 6 years ago

Can you clarify on how to implement averageColorForLetterCounts()? Thanks

fredkneeland commented 6 years ago

Sure! The idea is that it will return a color for a combination of letters, so for example if you are looking at specific 3 letter words and 30% are 'A's and 70% are 'G's then it would return the RBG values for A multiplied by .3 added with the RGB values of 'G' multiplied by 0.7. At least that was what I was thinking.

@ThePhantomGamer

ynx0 commented 6 years ago

Ok, thanks. I will implement that in my fork.

ynx0 commented 6 years ago

Please take a look at my branch to see if the first method aligns to what you need

fredkneeland commented 6 years ago

Yeah, that looks great, submit a pull request!