for (int i = 0; i < reply.length; i++)\r
result.append(reply[i] + "\n");\r
\r
- parseResult(result.toString());\r
+ parseResult(result.toString(), null);\r
}\r
}\r
else if (database.getSelectedItem().equals("PDB"))\r
\r
\r
if (result.length()>0)\r
- parseResult(result.toString());\r
+ parseResult(result.toString(), null);\r
}\r
else if( database.getSelectedItem().equals("PFAM"))\r
{\r
);\r
\r
if(result.length()>0)\r
- parseResult( result.toString() );\r
+ parseResult( result.toString(), textfield.getText().toUpperCase() );\r
\r
}catch(java.io.IOException ex)\r
{ result = null; }\r
}\r
\r
//Then read in the features and apply them to the dataset\r
- SequenceI[] sequence = parseResult(result.toString());\r
+ SequenceI[] sequence = parseResult(result.toString(), null);\r
for (int i = 0; i < entries.size(); i++)\r
{\r
UniprotEntry entry = (UniprotEntry) entries.elementAt(i);\r
return result;\r
}\r
\r
- SequenceI[] parseResult(String result)\r
+ SequenceI[] parseResult(String result, String title)\r
{\r
String format = IdentifyFile.Identify(result, "Paste");\r
SequenceI[] sequences = null;\r
\r
if (FormatAdapter.formats.contains(format))\r
{\r
- sequences = new FormatAdapter().readFile(result.toString(), "Paste",\r
- format);\r
+ sequences = null;\r
+ try{ sequences = new FormatAdapter().readFile(result.toString(), "Paste",\r
+ format);}\r
+ catch(Exception ex){}\r
+\r
if (sequences != null && sequences.length > 0)\r
{\r
if (alignFrame == null)\r
{\r
AlignFrame af = new AlignFrame(new Alignment(sequences));\r
af.currentFileFormat = format;\r
+ if(title==null)\r
+ title = "Retrieved from " + database.getSelectedItem();\r
Desktop.addInternalFrame(af,\r
- "Retrieved from " + database.getSelectedItem(),\r
+ title,\r
AlignFrame.NEW_WINDOW_WIDTH,\r
AlignFrame.NEW_WINDOW_HEIGHT);\r
af.statusBar.setText("Successfully pasted alignment file");\r
alignFrame.viewport.alignment.addSequence(sequences[i]);\r
\r
////////////////////////////\r
- //Datset needs extension;\r
+ //Dataset needs extension;\r
/////////////////////////////\r
Sequence ds = new Sequence(sequences[i].getName(),\r
AlignSeq.extractGaps("-. ",\r