-
- //Generate visual mapping output
- // StringBuilder strucSeq = new StringBuilder();
- // for(int[] x : mapping){
- // if(mapping[0] == 0){
- // strucSeq.append(b)
- // }
- // }
- mappedStrucSeq[1] = "x";
+
+ for (int[] x : mapping)
+ {
+ if (!startDetected && x[0] > -1)
+ {
+ matchedResStart = counter;
+ // System.out.println(matchedResStart);
+ startDetected = true;
+ }
+
+ if (startDetected && x[0] == -1)
+ {
+ matchedResEnd = counter;
+ }
+ ++counter;
+ }
+
+ String matchedSeqStr = seqStr;
+ if (matchedResStart != -1)
+ {
+ matchedResEnd = (matchedResEnd == -1) ? counter : matchedResEnd;
+ pdbStart = mapping[matchedResStart][0];
+ pdbEnd = mapping[matchedResEnd - 1][0];
+ sStart = mapping[matchedResStart][1];
+ sEnd = mapping[matchedResEnd - 1][1];
+ int seqStart = seq.getStart();
+ if (seqStart > 1)
+ {
+ matchedResStart = matchedResStart - seqStart;
+ matchedResEnd = matchedResEnd - seqStart;
+ }
+ else
+ {
+ --matchedResStart;
+ --matchedResEnd;
+ }
+ matchedSeqStr = seqStr.substring(matchedResStart, matchedResEnd);
+ }
+
+ StringBuilder targetStrucSeqs = new StringBuilder();
+ for (String res : resNumMap.values())
+ {
+ targetStrucSeqs.append(res);
+ }
+