}
/**
- * Remove the following special characters from input string +, -, &, |, !, (,
- * ), {, }, [, ], ^, ", ~, *, ?, :, \
+ * Remove the following special characters from input string +, -, &, !, (, ),
+ * {, }, [, ], ^, ", ~, *, ?, :, \
*
* @param seqName
* @return
{
Objects.requireNonNull(seqName);
return seqName.replaceAll("\\[\\d*\\]", "")
- .replaceAll("[^\\dA-Za-z|]", "").replaceAll("\\s+", "+");
+ .replaceAll("[^\\dA-Za-z|_]", "").replaceAll("\\s+", "+");
}
{
int pdbIdColIndex = tbl_summary.getColumn("PDB Id")
.getModelIndex();
- int refSeqColIndex = tbl_summary.getColumn("Ref Sequence")
+ int refSeqColIndex = tbl_summary.getColumn("Ref Sequence")
.getModelIndex();
- int[] selectedRows = tbl_summary.getSelectedRows();
+ int[] selectedRows = tbl_summary.getSelectedRows();
PDBEntry[] pdbEntriesToView = new PDBEntry[selectedRows.length];
int count = 0;
ArrayList<SequenceI> selectedSeqsToView = new ArrayList<SequenceI>();
for (int row : selectedRows)
{
- String pdbIdStr = tbl_summary.getValueAt(row, pdbIdColIndex)
+ String pdbIdStr = tbl_summary.getValueAt(row, pdbIdColIndex)
.toString();
- SequenceI selectedSeq = (SequenceI) tbl_summary.getValueAt(row,
+ SequenceI selectedSeq = (SequenceI) tbl_summary.getValueAt(row,
refSeqColIndex);
selectedSeqsToView.add(selectedSeq);
PDBEntry pdbEntry = selectedSeq.getPDBEntry(pdbIdStr);
if (SiftsSettings.isMapWithSifts())
{
+ ArrayList<SequenceI> seqsWithoutSourceDBRef = new ArrayList<SequenceI>();
for (SequenceI seq : sequences)
{
if (seq.getSourceDBRef() == null)
{
- ssm.setProgressBar(null);
- ssm.setProgressBar("Fetching Database refs..");
- new DBRefFetcher(sequences).fetchDBRefs(true);
- break;
+ if (seq.getDBRefs() == null)
+ {
+ seqsWithoutSourceDBRef.add(seq);
+ continue;
+ }
+ for (DBRefEntry dbRef : seq.getDBRefs())
+ {
+ if (dbRef.getSource().equalsIgnoreCase("uniprot"))
+ {
+ seq.setSourceDBRef(dbRef);
+ break;
+ }
+ }
+ for (DBRefEntry dbRef : seq.getDBRefs())
+ {
+ if (dbRef.getSource().equalsIgnoreCase("pdb"))
+ {
+ seq.setSourceDBRef(dbRef);
+ break;
+ }
+ }
+ if (seq.getSourceDBRef() == null)
+ {
+ seqsWithoutSourceDBRef.add(seq);
+ }
+ }
+ }
+ if (!seqsWithoutSourceDBRef.isEmpty())
+ {
+ int y = seqsWithoutSourceDBRef.size();
+ ssm.setProgressBar(null);
+ ssm.setProgressBar(">>>>> Fetching Database refs for " + y
+ + " sequence" + (y > 1 ? "s" : "")
+ + " with no valid uniprot or pdb ref for SIFTS mapping");
+ System.out.println(">>>>> Fetching Database refs for " + y
+ + " sequence" + (y > 1 ? "s" : "")
+ + " with no valid uniprot or pdb ref for SIFTS mapping");
+ SequenceI[] seqWithoutSrcDBRef = new SequenceI[y];
+ int x = 0;
+ for (SequenceI fSeq : seqsWithoutSourceDBRef)
+ {
+ seqWithoutSrcDBRef[x++] = fSeq;
}
+ new DBRefFetcher(seqWithoutSrcDBRef).fetchDBRefs(true);
}
}
if (pdbEntriesToView.length > 1)