- 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, Integer.valueOf(sequence.get("start")
- .toString()), Integer.valueOf(sequence.get("end")
- .toString()));
-
- JSONArray jsonSeqArray = (JSONArray) sequence.get("features");
- SequenceFeature[] retrievedSeqFeatures = getJalviewSequenceFeatures(
- jsonSeqArray, seq);
- if (retrievedSeqFeatures != null)
- {
- seq.setSequenceFeatures(retrievedSeqFeatures);
- }
- seqs.add(seq);