private void setRNAContents ( String str ) throws NotationException { /* Nucleotide with all contents */ String [ ] list ; // if (str.contains("(")) { List < String > items = extractContents ( str ) ; for ( String item : items ) { if ( item . length ( ) > 1 ) { if ( ! ( item . startsWith ( "[" ) && item . endsWith ( "]" ) ) ) { throw new NotationException ( "Monomers have to be in brackets " + item ) ; } } contents . add ( new MonomerNotationUnit ( item , type ) ) ; } // } /* nucleotide contains no base, but a modified sugar or phosphat */ // else if (str.contains("[")) { // if (str.startsWith("[")) { // str = str.replace("]", "]$"); // } else { // str = str.replace("[", "$["); // } // list = str.split("\\$"); // for (int i = 0; i < list.length; i++) { // contents.add(new MonomerNotationUnit(list[i], type)); // } // } /* nucleotide contains only standard sugar and/or phosphat */ else { // for (int i = 0; i < str.length(); i++) { // contents.add(new MonomerNotationUnit(Character.toString(str.charAt(i)), // type)); // } // } }
method to set for each nucleotide the sugar the base and the phosphat