}
@Transient
public void generateAFileDynamically(StringBuilder pBuilder) {
TaxonLabelSet tlSet = getTaxonLabelSet();
List<TaxonLabel> txnlbllist = tlSet.getTaxonLabelsReadOnly();
int numoftxnlbls = getTaxonNumber();
String title = getTitle();
if (TreebaseUtil.isEmpty(title)) {
//use the default title:
//title = "List of Uploaded Tree Block";
}
pBuilder.append("BEGIN TREES;\n");
pBuilder.append(" TITLE " + StringUtil.tokenize(getTitle()) + ";\n");
pBuilder.append(" LINK TAXA = " + StringUtil.tokenize(tlSet.getTitle().replaceAll("Input|Output", "")) + ";\n");
pBuilder.append(" TRANSLATE\n");
tlSet.buildTaxonWithLineNumber(pBuilder);
for (PhyloTree atree : getTreeList()) {
pBuilder.append(" TREE " + StringUtil.tokenize(atree.getLabel()) + " = ");
if (atree.getRootedTree() != null) {
if (atree.getRootedTree().booleanValue()) {
pBuilder.append("[&R] ");
} else {
pBuilder.append("[&U] ");
}
}
String tmpnewick, newick = atree.getNewickString();
List<TaxonLabel> txnlbllistclone = new ArrayList<TaxonLabel>(txnlbllist);
tlSet.sortByTaxonLabelLength(txnlbllistclone);
HashMap<String, Integer> txnOrder = new HashMap<String, Integer>();
for (int y = 0; y < numoftxnlbls; y++) {
txnOrder.put(txnlbllist.get(y).getTaxonLabel(), y);
}
for (int z = 0; z < numoftxnlbls; z++) {