private static final String SIFTS_FTP_BASE_URL = "ftp://ftp.ebi.ac.uk/pub/databases/msd/sifts/xml/";
public static final String DEFAULT_SIFTS_DOWNLOAD_DIR = System
private static final String SIFTS_FTP_BASE_URL = "ftp://ftp.ebi.ac.uk/pub/databases/msd/sifts/xml/";
public static final String DEFAULT_SIFTS_DOWNLOAD_DIR = System
- * Construct an instance of SiftsClient using the supplied SIFTs file - the
- * SIFTs file should correspond to the given PDB Id
+ * Construct an instance of SiftsClient using the supplied SIFTs file. Note:
+ * The SIFTs file should correspond to the PDB Id in PDBfile instance
- int[][] mapping = getGreedyMapping(chain, seq, ps);
+ HashMap<Integer, int[]> mapping = getGreedyMapping(chain, seq, ps);
String mappingOutput = mappingDetails.toString();
StructureMapping siftsMapping = new StructureMapping(seq, pdbFile,
String mappingOutput = mappingDetails.toString();
StructureMapping siftsMapping = new StructureMapping(seq, pdbFile,
- public int[][] getGreedyMapping(String entityId, SequenceI seq,
+ public HashMap<Integer, int[]> getGreedyMapping(String entityId, SequenceI seq,
System.out.println("Generating mappings for : " + entityId);
Entity entity = null;
entity = getEntityById(entityId);
String originalSeq = AlignSeq.extractGaps(
jalview.util.Comparison.GapChars,
seq.getSequenceAsString());
System.out.println("Generating mappings for : " + entityId);
Entity entity = null;
entity = getEntityById(entityId);
String originalSeq = AlignSeq.extractGaps(
jalview.util.Comparison.GapChars,
seq.getSequenceAsString());
TreeMap<Integer, String> resNumMap = new TreeMap<Integer, String>();
List<Segment> segments = entity.getSegment();
for (Segment segment : segments)
TreeMap<Integer, String> resNumMap = new TreeMap<Integer, String>();
List<Segment> segments = entity.getSegment();
for (Segment segment : segments)
{
String resNumIndexString = cRefDb.getDbResNum()
.equalsIgnoreCase("None") ? String.valueOf(UNASSIGNED)
{
String resNumIndexString = cRefDb.getDbResNum()
.equalsIgnoreCase("None") ? String.valueOf(UNASSIGNED)
- mapping[currSeqIndex][PDB_RES_POS] = Integer
- .valueOf(resNum);
- } catch (ArrayIndexOutOfBoundsException e)
+ char resCharCode = ResidueProperties
+ .getSingleCharacterCode(residue.getDbResName());
+ resNumMap.put(currSeqIndex, String.valueOf(resCharCode));
+ }
+ else
- char resCharCode = ResidueProperties
- .getSingleCharacterCode(residue.getDbResName());
- resNumMap.put(currSeqIndex, String.valueOf(resCharCode));
+ mapping.put(currSeqIndex - nonObservedShiftIndex, new int[] {
+ Integer.valueOf(resNum), UNASSIGNED });
- seqEnd = (seqEnd == UNASSIGNED) ? counter : seqEnd;
- pdbStart = mapping[seqStart][PDB_RES_POS];
- pdbEnd = mapping[seqEnd][PDB_RES_POS];
+ pdbStart = mapping.get(seqStart)[PDB_RES_POS];
+ pdbEnd = mapping.get(seqEnd)[PDB_RES_POS];
int orignalSeqStart = seq.getStart();
if (orignalSeqStart >= 1)
{
int subSeqStart = seqStart - orignalSeqStart;
int subSeqEnd = seqEnd - (orignalSeqStart - 1);
int orignalSeqStart = seq.getStart();
if (orignalSeqStart >= 1)
{
int subSeqStart = seqStart - orignalSeqStart;
int subSeqEnd = seqEnd - (orignalSeqStart - 1);
private boolean isResidueObserved(Residue residue)
{
String annotation = getResidueAnnotaiton(residue,
private boolean isResidueObserved(Residue residue)
{
String annotation = getResidueAnnotaiton(residue,
{
boolean isStrictMatch = true;
return isStrictMatch ? curSourceDBRef.equalsIgnoreCase(accession)
: curDBRefAccessionIdsString.contains(accession.toLowerCase());
}
{
boolean isStrictMatch = true;
return isStrictMatch ? curSourceDBRef.equalsIgnoreCase(accession)
: curDBRefAccessionIdsString.contains(accession.toLowerCase());
}
- void padWithGaps(TreeMap<Integer, String> resNumMap)
+ void padWithGaps(TreeMap<Integer, String> resNumMap,
+ ArrayList<Integer> omitNonObserved)