siftsEntry = parseSIFTs(siftsFile);
}
-
/**
* Parse the given SIFTs File and return a JAXB POJO of parsed data
*
{
siftsDownloadDir.mkdirs();
}
- // System.out.println(">> Download ftp url : " + siftsFileFTPURL);
- URL url = new URL(siftsFileFTPURL);
- URLConnection conn = url.openConnection();
- InputStream inputStream = conn.getInputStream();
- FileOutputStream outputStream = new FileOutputStream(
- downloadedSiftsFile);
- byte[] buffer = new byte[BUFFER_SIZE];
- int bytesRead = -1;
- while ((bytesRead = inputStream.read(buffer)) != -1)
- {
- outputStream.write(buffer, 0, bytesRead);
- }
- outputStream.close();
- inputStream.close();
- // System.out.println(">>> File downloaded : " + downloadedSiftsFile);
+ // System.out.println(">> Download ftp url : " + siftsFileFTPURL);
+ URL url = new URL(siftsFileFTPURL);
+ URLConnection conn = url.openConnection();
+ InputStream inputStream = conn.getInputStream();
+ FileOutputStream outputStream = new FileOutputStream(
+ downloadedSiftsFile);
+ byte[] buffer = new byte[BUFFER_SIZE];
+ int bytesRead = -1;
+ while ((bytesRead = inputStream.read(buffer)) != -1)
+ {
+ outputStream.write(buffer, 0, bytesRead);
+ }
+ outputStream.close();
+ inputStream.close();
+ // System.out.println(">>> File downloaded : " + downloadedSiftsFile);
return new File(downloadedSiftsFile);
}
{
continue;
}
+ String canonicalSource = DBRefUtils.getCanonicalName(dbRef
+ .getSource());
if (isValidDBRefEntry(dbRef)
- && dbRef.isPrimary()
- && (DBRefUtils.getCanonicalName(dbRef.getSource())
- .equalsIgnoreCase(DBRefSource.UNIPROT) || DBRefUtils
- .getCanonicalName(dbRef.getSource())
+ && (canonicalSource.equalsIgnoreCase(DBRefSource.UNIPROT) || canonicalSource
.equalsIgnoreCase(DBRefSource.PDB)))
{
return dbRef;
String pdbFile, String chain) throws SiftsException
{
structId = (chain == null) ? pdbId : pdbId + "|" + chain;
- System.out.println("Getting mapping for: " + pdbId + "|" + chain
- + " : seq- " + seq.getName());
+ System.out.println("Getting SIFTS mapping for " + structId + ": seq "
+ + seq.getName());
final StringBuilder mappingDetails = new StringBuilder(128);
PrintStream ps = new PrintStream(System.out)
int pdbStart = UNASSIGNED;
int pdbEnd = UNASSIGNED;
- Integer[] keys = mapping.keySet().toArray(new Integer[0]);
- Arrays.sort(keys);
- if (keys.length < 1)
+ if (mapping.isEmpty())
{
- throw new SiftsException(">>> Empty SIFTS mapping generated!!");
+ throw new SiftsException(
+ "SIFTS mapping failed - falling back on Needleman-Wunsch");
}
+
+ Integer[] keys = mapping.keySet().toArray(new Integer[0]);
+ Arrays.sort(keys);
seqStart = keys[0];
seqEnd = keys[keys.length - 1];
}
}
}
+
/**
*
* @param chainId
}
}
-
-
@Override
public Entity getEntityById(String id) throws SiftsException
{