- JSONParser jsonParser = new JSONParser();
- JSONObject alignmentJsonObj = (JSONObject) jsonParser
- .parse(alignmentJsonString);
- JSONArray seqJsonArray = (JSONArray) alignmentJsonObj.get("seqs");
- String bioJsColourScheme = (String) alignmentJsonObj
- .get("globalColorScheme");
- cs = getJalviewColorScheme(bioJsColourScheme);
-
- for (Iterator<JSONObject> sequenceIter = seqJsonArray.iterator(); sequenceIter
- .hasNext();)
- {
- JSONObject sequence = sequenceIter.next();
- String sequcenceString = sequence.get("seq").toString();
- Sequence seq = new Sequence(sequence.get("name").toString(),
- sequcenceString, 0, sequcenceString.length());
-
- JSONArray jsonSeqArray = (JSONArray) sequence.get("features");
- SequenceFeature[] retrievedSeqFeatures = getJalviewSequenceFeatures(jsonSeqArray);
- if (retrievedSeqFeatures != null)
- {
- seq.setSequenceFeatures(retrievedSeqFeatures);
- }
- seqs.add(seq);