/** {@inheritDoc} */ @Override public FeatureTable execute() throws MSDKException { // Total features totalFeatures = featureTable.getRows().size(); /* * TODO: Write method */ processedFeatures = totalFeatures; // Return the new feature table return result; }
/** {@inheritDoc} */ @Override public FeatureTable execute() throws MSDKException { // Total features totalFeatures = featureTable.getRows().size(); /* * TODO: Write method */ processedFeatures = totalFeatures; // Return the new feature table return result; }
/** {@inheritDoc} */ @Override public FeatureTable execute() throws MSDKException { // Set the total features totalFeatures = featureTable.getRows().size(); // Collect all possible charge states int charges[] = new int[maximumCharge]; for (int i = 0; i < maximumCharge; i++) { charges[i] = i + 1; } // Loop through all features in the feature table for (FeatureTableRow row : featureTable.getRows()) { /* * TODO: Write method */ if (canceled) return null; processedFeatures++; } return null; }
/** {@inheritDoc} */ @Override public FeatureTable execute() throws MSDKException { // Set the total features totalFeatures = featureTable.getRows().size(); // Collect all possible charge states int charges[] = new int[maximumCharge]; for (int i = 0; i < maximumCharge; i++) { charges[i] = i + 1; } // Loop through all features in the feature table for (FeatureTableRow row : featureTable.getRows()) { /* * TODO: Write method */ if (canceled) return null; processedFeatures++; } return null; }
/** * <p>getRowsInsideRange.</p> * * @param table a {@link io.github.msdk.datamodel.FeatureTable} object. * @param rtRange a {@link com.google.common.collect.Range} object. * @param mzRange a {@link com.google.common.collect.Range} object. * @return a {@link java.util.List} object. */ public static @Nonnull List<FeatureTableRow> getRowsInsideRange(@Nonnull FeatureTable table, @Nonnull Range<Float> rtRange, @Nonnull Range<Double> mzRange) { List<FeatureTableRow> featureTableRows = table.getRows(); List<FeatureTableRow> result = new ArrayList<>(); for (FeatureTableRow row : featureTableRows) { Float rowRT = row.getRT(); if ((rowRT != null) && rtRange.contains(rowRT) && mzRange.contains(row.getMz())) result.add(row); } return result; }
/** * <p>getRowsInsideRange.</p> * * @param table a {@link io.github.msdk.datamodel.FeatureTable} object. * @param rtRange a {@link com.google.common.collect.Range} object. * @param mzRange a {@link com.google.common.collect.Range} object. * @return a {@link java.util.List} object. */ public static @Nonnull List<FeatureTableRow> getRowsInsideRange(@Nonnull FeatureTable table, @Nonnull Range<Float> rtRange, @Nonnull Range<Double> mzRange) { List<FeatureTableRow> featureTableRows = table.getRows(); List<FeatureTableRow> result = new ArrayList<>(); for (FeatureTableRow row : featureTableRows) { Float rowRT = row.getRT(); if ((rowRT != null) && rtRange.contains(rowRT) && mzRange.contains(row.getMz())) result.add(row); } return result; }
/** {@inheritDoc} */ @Override public File execute() throws MSDKException { logger.info("Started exporting feature table to " + mzTabFile); // Get number of rows totalRows = featureTable.getRows().size(); // Open file FileWriter writer; try { writer = new FileWriter(mzTabFile); } catch (Exception e) { logger.info("Could not open file " + mzTabFile + " for writing."); return null; } // jmztab data holders Metadata mtd = new Metadata(); MZTabColumnFactory factory = MZTabColumnFactory.getInstance(Section.Small_Molecule); // Write meta data to mzTab file writeMetaData(featureTable, writer, mtd, factory); // Write sample data to mzTab file writeSampleData(featureTable, writer, mtd, factory); // Close file try { writer.close(); } catch (Exception e) { logger.info("Could not close file " + mzTabFile); return null; } return mzTabFile; }
/** * Create the vector which contains all the possible aligned peaks. * * @param peakListX * @param peakListY * @return vector which contains all the possible aligned peaks. */ private List<AlignStructMol> getVectorAlignment(FeatureTable peakListX, FeatureTable peakListY) { List<AlignStructMol> alignMol = new ArrayList<AlignStructMol>(); for (FeatureTableRow row : peakListX.getRows()) { // Calculate limits for a row with which the row can be aligned Range<Double> mzRange = mzTolerance.getToleranceRange(row.getMz()); Range<Float> rtRange = rtTolerance.getToleranceRange(row.getRT()); // Get all rows of the aligned peaklist within parameter limits List<FeatureTableRow> candidateRows = FeatureTableUtil.getRowsInsideRange(peakListY, rtRange, mzRange); for (FeatureTableRow candidateRow : candidateRows) { alignMol.add(new AlignStructMol(row, candidateRow)); } } return alignMol; }
/** * Create the vector which contains all the possible aligned peaks. * * @param peakListX * @param peakListY * @return vector which contains all the possible aligned peaks. */ private List<AlignStructMol> getVectorAlignment(FeatureTable peakListX, FeatureTable peakListY) { List<AlignStructMol> alignMol = new ArrayList<AlignStructMol>(); for (FeatureTableRow row : peakListX.getRows()) { // Calculate limits for a row with which the row can be aligned Range<Double> mzRange = mzTolerance.getToleranceRange(row.getMz()); Range<Float> rtRange = rtTolerance.getToleranceRange(row.getRT()); // Get all rows of the aligned peaklist within parameter limits List<FeatureTableRow> candidateRows = FeatureTableUtil.getRowsInsideRange(peakListY, rtRange, mzRange); for (FeatureTableRow candidateRow : candidateRows) { alignMol.add(new AlignStructMol(row, candidateRow)); } } return alignMol; }
PolynomialFunction function = this.getPolynomialFunction(list); List<FeatureTableRow> allRows = featureTable.getRows();
PolynomialFunction function = this.getPolynomialFunction(list); List<FeatureTableRow> allRows = featureTable.getRows();
for (FeatureTableRow row : featureTable.getRows()) {