Search in sources :

Example 46 with XSSFCell

use of org.apache.poi.xssf.usermodel.XSSFCell in project ImmunogeneticDataTools by nmdp-bioinformatics.

the class DetectedFindingsWriter method reportDetectedFindings.

/**
 * @param linkagesFound
 * @throws IOException
 * @throws SecurityException
 */
public synchronized void reportDetectedFindings(DetectedLinkageFindings findings) {
    XSSFRow row = spreadsheet.createRow(rowId++);
    int cellId = 0;
    XSSFCell cell = row.createCell(cellId++);
    cell.setCellValue(findings.getGLId());
    cell = row.createCell(cellId++);
    cell.setCellValue(findings.getAlleleCount(Locus.HLA_A));
    cell = row.createCell(cellId++);
    cell.setCellValue(findings.getAlleleCount(Locus.HLA_B));
    cell = row.createCell(cellId++);
    cell.setCellValue(findings.getAlleleCount(Locus.HLA_C));
    cell = row.createCell(cellId++);
    cell.setCellValue(findings.getAlleleCount(Locus.HLA_DRB1));
    cell = row.createCell(cellId++);
    cell.setCellValue(findings.getAlleleCount(Locus.HLA_DRB345));
    cell = row.createCell(cellId++);
    cell.setCellValue(findings.getAlleleCount(Locus.HLA_DQB1));
    for (Linkages linkage : LinkagesLoader.getInstance().getLinkages()) {
        cell = row.createCell(cellId++);
        cell.setCellValue(findings.getLinkageCount(linkage.getLoci()));
        cell = row.createCell(cellId++);
        cell.setCellValue(findings.getMinimumDifference(linkage.getLoci()) + "");
    }
    String detectedFindings = formatDetectedFindings(findings);
    printWriter.write(detectedFindings);
}
Also used : Linkages(org.dash.valid.Linkages) XSSFRow(org.apache.poi.xssf.usermodel.XSSFRow) XSSFCell(org.apache.poi.xssf.usermodel.XSSFCell)

Aggregations

XSSFCell (org.apache.poi.xssf.usermodel.XSSFCell)46 XSSFRow (org.apache.poi.xssf.usermodel.XSSFRow)35 XSSFSheet (org.apache.poi.xssf.usermodel.XSSFSheet)22 XSSFWorkbook (org.apache.poi.xssf.usermodel.XSSFWorkbook)22 XSSFCellStyle (org.apache.poi.xssf.usermodel.XSSFCellStyle)10 Test (org.junit.Test)8 ArrayList (java.util.ArrayList)7 HashMap (java.util.HashMap)7 FileOutputStream (java.io.FileOutputStream)5 IOException (java.io.IOException)5 ByteArrayInputStream (java.io.ByteArrayInputStream)4 File (java.io.File)4 FileInputStream (java.io.FileInputStream)4 Map (java.util.Map)4 Workbook (org.apache.poi.ss.usermodel.Workbook)4 XSSFFont (org.apache.poi.xssf.usermodel.XSSFFont)4 RefineTest (com.google.refine.RefineTest)3 HashSet (java.util.HashSet)3 Iterator (java.util.Iterator)3 Cell (org.apache.poi.ss.usermodel.Cell)3