public void addBestSearchEngineScoreOptionalColumn(MZTabColumn column, Integer id) { String position = column.getLogicPosition(); if (optionalColumnMapping.containsKey(position)) { throw new IllegalArgumentException( "There exists column " + optionalColumnMapping.get(position) + " in position " + position); } MZTabColumn newColumn = null; switch (section) { case Protein_Header: if (column.getName().equals(ProteinColumn.BEST_SEARCH_ENGINE_SCORE.getName())) { newColumn = MZTabColumn.createOptionalColumn(section, column, id, null); } break; case Peptide_Header: if (column.getName().equals(PeptideColumn.BEST_SEARCH_ENGINE_SCORE.getName())) { newColumn = MZTabColumn.createOptionalColumn(section, column, id, null); } break; case Small_Molecule_Header: if (column.getName().equals(SmallMoleculeColumn.BEST_SEARCH_ENGINE_SCORE.getName())) { newColumn = MZTabColumn.createOptionalColumn(section, column, id, null); } break; } if (newColumn != null) { optionalColumnMapping.put(newColumn.getLogicPosition(), newColumn); columnMapping.put(newColumn.getLogicPosition(), newColumn); } }
private String addOptionColumn(MZTabColumn column) { String logicalPosition = column.getLogicPosition(); optionalColumnMapping.put(logicalPosition, column); columnMapping.put(column.getLogicPosition(), column); return logicalPosition; }
/** * Add {@link ProteinColumn#GO_TERMS} into {@link #optionalColumnMapping} and {@link * #columnMapping}. * * <p>Notice: this function only used in {@link Section#Protein_Header} */ public void addGoTermsOptionalColumn() { if (section != Section.Protein_Header) { throw new IllegalArgumentException( "go_terms optional column only add into the protein section."); } MZTabColumn column = ProteinColumn.GO_TERMS; optionalColumnMapping.put(column.getLogicPosition(), column); columnMapping.put(column.getLogicPosition(), column); }
/** * Add a optional column which has stable order and name, into {@link #optionalColumnMapping} and * {@link #columnMapping}. * * @see MZTabColumn#createOptionalColumn(Section, MZTabColumn, Integer, IndexedElement) * @exception IllegalArgumentException: If user would like to add duplicate optional columns. * @param column SHOULD NOT set null. * @param msRun SHOULD NOT set null. */ public void addOptionalColumn(MZTabColumn column, MsRun msRun) { String position = column.getLogicPosition(); if (optionalColumnMapping.containsKey(position)) { throw new IllegalArgumentException( "There exists column " + optionalColumnMapping.get(position) + " in position " + position); } MZTabColumn newColumn = null; // switch (section) { // case Protein_Header: // if (column.getName().equals(ProteinColumn.NUM_PSMS.getName()) || // column.getName().equals(ProteinColumn.NUM_PEPTIDES_DISTINCT.getName()) // || // column.getName().equals(ProteinColumn.NUM_PEPTIDES_UNIQUE.getName())) // { // newColumn = MZTabColumn.createOptionalColumn(section, column, msRun); // } // // if (position.equals(ProteinColumn.SEARCH_ENGINE_SCORE.getOrder()) || // position.equals(ProteinColumn.NUM_PSMS.getOrder()) || // position.equals(ProteinColumn.NUM_PEPTIDES_DISTINCT.getOrder()) || // position.equals(ProteinColumn.NUM_PEPTIDES_UNIQUE.getOrder())) { // newColumn = MZTabColumn.createOptionalColumn(section, column, msRun); // } // break; // case Peptide_Header: // if (position.equals(PeptideColumn.SEARCH_ENGINE_SCORE.getOrder())) { // newColumn = MZTabColumn.createOptionalColumn(section, column, msRun); // } // break; // case Small_Molecule_Header: // if (position.equals(SmallMoleculeColumn.SEARCH_ENGINE_SCORE.getOrder())) { // newColumn = MZTabColumn.createOptionalColumn(section, column, msRun); // } // break; // } if (section == Section.Protein_Header) { if (column.getName().equals(ProteinColumn.NUM_PSMS.getName()) || column.getName().equals(ProteinColumn.NUM_PEPTIDES_DISTINCT.getName()) || column.getName().equals(ProteinColumn.NUM_PEPTIDES_UNIQUE.getName())) { newColumn = MZTabColumn.createOptionalColumn(section, column, null, msRun); } } if (newColumn != null) { optionalColumnMapping.put(newColumn.getLogicPosition(), newColumn); columnMapping.put(newColumn.getLogicPosition(), newColumn); } }
/** * Add {@link AbundanceColumn} into {@link AbundanceColumn}, {@link #optionalColumnMapping} and * {@link #columnMapping}. The header like: {Section}_abundance_assay[1] * * @see AbundanceColumn#createOptionalColumn(Section, Assay, int) * @param assay SHOULD NOT empty. */ public String addAbundanceOptionalColumn(Assay assay) { MZTabColumn column = AbundanceColumn.createOptionalColumn( section, assay, new Integer(getColumnOrder(columnMapping.lastKey()))); abundanceColumnMapping.put(column.getLogicPosition(), column); return addOptionColumn(column); }
/** Add URI optional column into {@link #optionalColumnMapping} and {@link #columnMapping}. */ public void addURIOptionalColumn() { MZTabColumn column = null; switch (section) { case Protein_Header: column = ProteinColumn.URI; break; case Peptide_Header: column = PeptideColumn.URI; break; case Small_Molecule_Header: column = SmallMoleculeColumn.URI; break; case PSM_Header: column = PSMColumn.URI; break; } if (column != null) { optionalColumnMapping.put(column.getLogicPosition(), column); columnMapping.put(column.getLogicPosition(), column); } }
private static void addStableColumn(MZTabColumnFactory factory, MZTabColumn column) { factory.stableColumnMapping.put(column.getLogicPosition(), column); }