Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class DnaUtilities2{
- public static void main(String [] args){
- char a = 'A';
- boolean value;
- value = isValidBase(a);
- System.out.println(value);
- char value2;
- value2 = watsonCrickComplement(a);
- System.out.println(value2);
- String dnaSequence = "ATT";
- int length = dnaSequence.length();
- System.out.println(length);
- char firstCharacter = dnaSequence.charAt(0);
- char secondCharacter = dnaSequence.charAt(1);
- char thirdCharacter = dnaSequence.charAt(2);
- String value3;
- value3=watsonCrickTripletComplement(dnaSequence);
- System.out.println(value3);
- //System.out.println(a + " gives out :" + value + "\n");
- /*for (int i=1; i<26; i++) {
- a++;
- value = isValidBase(a);
- System.out.println("'" + a + "'" + " gives out :" + value + "\n");
- } */
- }
- public static boolean isValidBase(char x){
- if ((x == 'A')||(x == 'T') || ( x == 'C') || ( x == 'G')){
- return true;
- }
- else{
- return false;
- }
- }
- public static char watsonCrickComplement(char x) {
- /*char a = 'C';
- boolean value;
- value = isValidBase(a);
- System.out.println(value);*/
- if (x =='A'){
- return 'T';
- }
- else if (x == 'T'){
- return 'A';
- }
- else if (x == 'C'){
- return 'G';
- }
- else if (x == 'G') {
- return 'C';
- }
- else {
- return x;
- }
- }
- public static String watsonCrickTripletComplement(String dnaSequence){
- // if length is 3 and all characters are valid -- return complement
- if(dnaSequence == "ATA"){
- return "TAT";
- }
- else{
- return "";
- }
- }
- //it should verify that dnaSequence has exactly 3 characters in it.
- public static int length(){
- int x = 0 ;
- return x;
- }
- //Next verify that each of the 3 characters are valid Watson-Crick complements.
- public static int charAt(int i){
- int y = 0;
- return y;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement