}
//Then read in the features and apply them to the dataset
- SequenceI[] sequence = parseResult(result.toString(), null);
+ Alignment al = parseResult(result.toString(), null);
for (int i = 0; i < entries.size(); i++)
{
UniprotEntry entry = (UniprotEntry) entries.elementAt(i);
Enumeration en2 = entry.getAccession().elements();
while (en2.hasMoreElements())
{
- sequence[i].getDatasetSequence().addDBRef(new DBRefEntry(DBRefSource.UNIPROT,
+ al.getSequenceAt(i).getDatasetSequence().addDBRef(new DBRefEntry(DBRefSource.UNIPROT,
"0",
en2.nextElement().toString()));
}
- sequence[i].getDatasetSequence().setPDBId(onlyPdbEntries);
+ al.getSequenceAt(i).getDatasetSequence().setPDBId(onlyPdbEntries);
if (entry.getFeature() != null)
{
e = entry.getFeature().elements();
{
SequenceFeature sf = (SequenceFeature) e.nextElement();
sf.setFeatureGroup("Uniprot");
- sequence[i].getDatasetSequence().addSequenceFeature( sf );
+ al.getSequenceAt(i).getDatasetSequence().addSequenceFeature( sf );
}
}
}
return result;
}
- SequenceI[] parseResult(String result, String title)
+ Alignment parseResult(String result, String title)
{
String format = new IdentifyFile().Identify(result, "Paste");
- SequenceI[] sequences = null;
+ Alignment al = null;
if (FormatAdapter.isValidFormat(format))
{
- sequences = null;
- try{ sequences = new FormatAdapter().readFile(result.toString(), "Paste",
+
+ try{ al = new FormatAdapter().readFile(result.toString(), "Paste",
format);}
catch(Exception ex){}
- if (sequences != null && sequences.length > 0)
+ if (al != null && al.getHeight() > 0)
{
if (alignFrame == null)
{
- AlignFrame af = new AlignFrame(new Alignment(sequences),
+ AlignFrame af = new AlignFrame(al,
AlignFrame.DEFAULT_WIDTH,
AlignFrame.DEFAULT_HEIGHT
);
}
else
{
- for (int i = 0; i < sequences.length; i++)
+ for (int i = 0; i < al.getHeight(); i++)
{
- alignFrame.viewport.alignment.addSequence(sequences[i]);
+ alignFrame.viewport.alignment.addSequence(al.getSequenceAt(i));
////////////////////////////
//Dataset needs extension;
/////////////////////////////
- Sequence ds = new Sequence(sequences[i].getName(),
+ Sequence ds = new Sequence(al.getSequenceAt(i).getName(),
AlignSeq.extractGaps("-. ",
- sequences[i].getSequenceAsString()),
- sequences[i].getStart(),
- sequences[i].getEnd());
- sequences[i].setDatasetSequence(ds);
+ al.getSequenceAt(i).getSequenceAsString()),
+ al.getSequenceAt(i).getStart(),
+ al.getSequenceAt(i).getEnd());
+ al.getSequenceAt(i).setDatasetSequence(ds);
alignFrame.viewport.alignment.getDataset().addSequence(ds);
}
alignFrame.viewport.setEndSeq(alignFrame.viewport.alignment.
{
// Parse out the ids from the structured names
boolean errors = false;
- for (int i = 0; i < sequences.length; i++)
+ for (int i = 0; i < al.getHeight(); i++)
{
PDBEntry entry = new PDBEntry();
com.stevesoft.pat.Regex idbits = new com.stevesoft.pat.Regex(
"PDB\\|([0-9A-z]{4})\\|(.)");
- if (idbits.search(sequences[i].getName()))
+ if (idbits.search(al.getSequenceAt(i).getName()))
{
String pdbid = idbits.substring(1);
String pdbccode = idbits.substring(2);
entry.setProperty(new Hashtable());
entry.getProperty().put("chains",
pdbccode
- + "=" + sequences[i].getStart()
- + "-" + sequences[i].getEnd());
- sequences[i].getDatasetSequence().addPDBId(entry);
+ + "=" + al.getSequenceAt(i).getStart()
+ + "-" + al.getSequenceAt(i).getEnd());
+ al.getSequenceAt(i).getDatasetSequence().addPDBId(entry);
// We make a DBRefEtntry because we have obtained the PDB file from a verifiable source
// JBPNote - PDB DBRefEntry should also carry the chain and mapping information
DBRefEntry dbentry = new DBRefEntry(jalview.datamodel.DBRefSource.PDB,"0",pdbid);
- sequences[i].getDatasetSequence().addDBRef(dbentry);
+ al.getSequenceAt(i).getDatasetSequence().addDBRef(dbentry);
}
else
{
// that the user should know about.
jalview.bin.Cache.log.warn(
"No PDBEntry constructed for sequence " + i + " : " +
- sequences[i].getName());
+ al.getSequenceAt(i).getName());
errors = true;
}
}
+ " from " + database.getSelectedItem());
}
- return sequences;
+ return al;
}