static{\r
formats.addElement("FASTA");\r
formats.addElement("MSF");\r
+ formats.addElement("PileUp");\r
formats.addElement("CLUSTAL");\r
formats.addElement("BLC");\r
formats.addElement("PIR");\r
afile = new FastaFile(inFile, type);\r
else if (format.equals("MSF"))\r
afile = new MSFfile(inFile, type);\r
+ else if (format.equals("PileUp"))\r
+ afile = new PileUpfile(inFile, type);\r
else if (format.equals("CLUSTAL"))\r
afile = new ClustalFile(inFile, type);\r
else if (format.equals("BLC"))\r
afile = new FastaFile();\r
else if (format.equals("MSF"))\r
afile = new MSFfile();\r
+ else if (format.equals("PileUp"))\r
+ afile = new PileUpfile();\r
else if (format.equals("CLUSTAL"))\r
afile = new ClustalFile();\r
else if (format.equals("BLC"))\r
\r
if(data.indexOf("PILEUP")>-1)\r
{\r
+ reply = "PileUp";\r
+ break;\r
+ }\r
+ if((data.indexOf("!!")>-1)\r
+ && (data.indexOf("!!")<data.indexOf("_MULTIPLE_ALIGNMENT ")))\r
+ {\r
reply = "MSF";\r
break;\r
}\r
super(inFile,type);\r
}\r
\r
- public void parse() {\r
+ private static com.stevesoft.pat.Regex gapre = new com.stevesoft.pat.Regex("\\~","-");\r
+ private static com.stevesoft.pat.Regex re2gap = new com.stevesoft.pat.Regex("["+jalview.util.Comparison.GapChars+"]","\\~");\r
\r
+ public void parse() {\r
int i = 0;\r
boolean seqFlag = false;\r
String key = new String();\r
}\r
}\r
}\r
-\r
+ // Replace ~ with a sensible gap character\r
+ seq = gapre.replaceAll(seq);\r
Sequence newSeq = new Sequence(head,seq,start,end);\r
\r
seqs.addElement(newSeq);\r
int end = start + 10;\r
\r
if (end < s[j].getSequence().length() && start < s[j].getSequence().length() ) {\r
- out.append(s[j].getSequence().substring(start,end));\r
+ out.append(re2gap.replaceAll(s[j].getSequence().substring(start,end)));\r
if (k < 4) {\r
- out.append(" ");\r
+ // out.append(" ");\r
} else {\r
out.append("\n");\r
}\r
} else {\r
if (start < s[j].getSequence().length()) {\r
- out.append(s[j].getSequence().substring(start));\r
+ out.append(re2gap.replaceAll(s[j].getSequence().substring(start)));\r
out.append("\n");\r
} else {\r
if (k == 0) {\r