}
private void writeGeneList(Element globalElement, Document document) {
GeneList geneList = session.getCurrentGeneList();
if (geneList != null) {
Element geneListElement = document.createElement(SessionElement.GENE_LIST.getText());
geneListElement.setAttribute(IGVSessionReader.SessionAttribute.NAME.getText(), geneList.getName());
StringBuffer genes = new StringBuffer();
for (String gene : geneList.getLoci()) {
genes.append(gene);
genes.append("\n");
}
geneListElement.setTextContent(genes.toString());