Skip to content

Latest commit

 

History

History
238 lines (221 loc) · 27.2 KB

specs.md

File metadata and controls

238 lines (221 loc) · 27.2 KB

Specs for GeomxTools:

  1. Package shall be downloadable and installable from Bioconductor.
  2. Package shall be downloadable and installable from GitHub.
  3. The package vignette shall knit into an html file.
  4. The knitted vignette shall have no errors in the R code blocks.

Specs for readDccFile

  1. Names including target names within the readDccFile returned list elements match the corresponding DCC section labels.
    test:
    # Spec 1: test that the names of DCC files have the right formats:------
  2. The number of targets in the returned list matches the number of targets listed in the DCC file.
    test:
    # Spec 2: test that the number of genes is correct:------
  3. The count for each target within the returned list matches the DCC file counts.
    test:
    # Spec 3: test that counts are correct:------

Specs for readPkcFile

  1. Column names of PKC files are in correct format.
    test:
    # Spec 1: test that the column names of PKC files are in correct format:------
  2. Names of metadata of PKC files are in correct format.
    test:
    # Spec 2: test that the names of metadata of PKC files are in correct format:------
  3. The number of probes matches the number of probes found in the PKC file.
    test:
    # req3: test that the number of probes is correct:------
  4. Warning if default PKC provided when no multiple versions.
    test:
    # req4: check for warning if default PKC provided when no multiple versions:---
  5. Error if default PKCs is not a valid pkc file.
    test:
    # req5: check for error if default PKCs is not a valid pkc file:------
  6. Error if multiple default PKCs for a module.
    test:
    # req6: check for error if multiple default PKCs for a module:------
  7. Warning when resolving multiple PKC versions.
    test:
    # req7: check for warning when resolving multiple PKC versions:------
  8. Only probes in all versions kept.
    test:
    # req8: check that only probes in all versions kept:------
  9. Default PKC target assignments are used for probes with most recent PKC being default unless re-specified by user.
    test:
    # req9: check that default PKC target assignments are used for probes:----

Specs for readNanoStringGeoMxSet

  1. NanoStringGeoMxSet@assayData$expr dimension labels shall match DCC files input.
    test:
    # Spec 1: test that the column names and the rownames of testData@assayData$exprs match those in DCC files and PKC Files respectively:------
  2. NanoStringGeoMxSet@phenoData@data column names shall match column names in input annotation file and rownames shall match input DCC file names.
    test:
    # Spec 2: test that the column names and the rownames of testData@phenoData$data match those in DCC files and PKC Files respectively:------
  3. NanoStringGeoMxSet@protocolData@data column names shall match column names in input annotation file and rownames shall match input DCC file names.
    test:
    # Spec 3: test that the column names and the rownames of testData@protocolData$data match those in DCC files and PKC Files respectively:------
  4. NanoStringGeoMxSet@featureData@data probes shall match probes in the input PKC file.
    test:
    # Spec 4: test that the genes in testData@featureData@data match those in PKC Files:------
  5. Experiment data, testData@experimentData@other, shall contain expected headers.
    test:
    # Spec 5: test that the names in testData@experimentData@other are in correct format:------
  6. The probe counts in testData@assayData$exprs shall match those in the input DCC files.
    test:
    #Spec 6: test that the counts in testData@assayData$exprs match those in DCC files
  7. Data shall match corresponding data when the same experiment is loaded in DSPDA.
    test:
  8. User shall be able to pass optional parameters to read annotation file in with user-specified settings.
    test:
    # Spec 7: test that ... gets translated to read_xlsx():------
  9. Unidentifiable optional parameters for annotation input reading shall result in an error.
    test:
    # Spec 8: test that only valid ... gets translated to read_xlsx():------
  10. PKCs are removed if they aren't in the provided config file. test:
    # Spec 10. PKCs are removed if they aren't in the provided config file.
  11. Only a single analyte is read in to a GeomMxSet object. test:
    # Spec 11: Only a single analyte is read in to a GeomMxSe object

Specs for NanoStringGeoMxSet-class

  1. The sData row names shall match DCC file names and column names shall match phenoData and protocolData column names.
    test:
    # Spec 1: test that the rownames and column names in sData are correct:------
  2. svarLabels list matches the column names of the sData data frame.
    test:
    # Spec 2: test that the svarLabels method gives the correct results:------
  3. dimLabels shall return a vector with two elements, TargetName and SampleID, by default.
    test:
    # Spec 3: test that the dimLabels method gives the correct results:------
  4. The design slot shall be accessible and NULL by default.
    test:
    # Spec 4: test that the design method gives the correct results:------
  5. featureType shall be accessible before and after aggregation with default value set to Probe and after aggregation set to Target.
    test:
    # Spec 5: test that the featureType method gives the correct results:------
  6. The function countsShiftedByOne shall return a boolean indicating if count shift has been performed on the object.
    test:
    # Spec 6: test that the countsShiftedByOne method gives the correct results:------
  7. The function analyte shall return which analyte is read into the object. test:
    # Spec 7: test that the analyte method gives the correct results:------
  8. dimLabels replacement method shall allow the replacement of the vector elements within dimLabels.
    test:
    # Spec 8: test that dimLabels(testData) matches the value assigned:------
  9. The design replacement method shall allow the assignment of the design.
    test:
    # Spec 9: test that design(testData) matches the value assigned:------
  10. The featureType replacement method shall allow the user to replace the feature type of the object.
    test:
    # Spec 10: test that featureType(testData) matches the value assigned:------

Specs for aggregateCounts

  1. All collapsed probe values must be equal to the geoMean of probes for each target.
    test:
    # Spec 1: test that collapsed probe count is equal to the geomean of probes for each target:------
  2. The geomean and geosd of negatives is correct. test:
    # Spec 2: test that geomean and geosd of negatives is correct
  3. featureType shall default to Probe and change to Target after the aggregateCounts method is used.
    test:
    # Spec 3: featureType is changed after aggregation
  4. Aggregated GeoMxSet object shall have the same sample dimensions as the probe object and feature dimension shall match the number and names of targets in the feature data target name column. Aggregated object expression matrix dimension labels shall match the aggregated object dimension labels and counts shall by default match the geometric mean of aggregated counts by target from the probe object.
    test:
    # Spec 4: Aggregated object has target dimension and annotations
  5. An aggregation function other than geometric mean shall generate an aggregated object with dimension labels matching the default aggregated object and counts aggregated by the specified function for each target.
    test:
    # Spec 5: Target expression matrix contains aggregated counts
  6. Other aggregation functions will work. test:
    # Spec 6: Other aggregation functions work
  7. An error shall be displayed if the GeoMxSet object is target-level.
    test:
    # Spec 7: Counts can't be aggregated twice
  8. Targets with only one probe shall not have aggregated counts. test:
    # Spec 8: Single Probes are not aggregated
  9. A warning shall be displayed if no negatives are found in the probe-level object being aggregated.
    test:
    # Spec 9: Warning given when data doesn't have negatives
  10. A warning shall be displayed if the GeoMxSet object has no multiprobe targets.
    test:
    # Spec 10: Warning given when data doesn't have multi-probe targets

Specs for summarizeNegatives

  1. The summarizeNegatives function shall be able to be run multiple times.
    test:
    testthat::test_that("summarizeNegatives can be rerun", {
  2. For each panel, negatives shall be summarized by geometric mean and geometric standard deviation per panel. Summary results shall be saved in sample data.
    test:
    # Spec 2: tests that countsShiftedByOne returns true when counts have been shifted:------

Specs for normalize

  1. Normalization factors shall be appended to sample data.
    test:
    #### Spec 1 check that normfactors are in pData of demoData
  2. Quantile normalization shall allow normalization at any quantile calculated as: AOI quantile / geometric mean of all AOI quantiles.
    test:
    #### Spec 2 verify calculation of q90 norm factors
  3. Quantile normalization shall normalize expression counts as: count/(quantile normalization factor).
    test:
    #### Spec 3 verify calculation of quantile norm values
  4. Negative normalization shall calculate normalization factors as: geometric mean of AOI negatives / geometric mean of all AOIs geometric mean of each AOI. One normalization factor shall be calculated per panel for each AOI.
    test:
    #### Spec 4 verify calculation of negative norm factors
  5. Negative normalized values shall be calculated as: count / negative normalization factor for the corresponding target panel.
    test:
    #### Spec 4a verify calculation of negative norm factors for multipanel
  6. Housekeeper normalization shall calculate the normalization factor as: geometric mean of housekeepers within AOI / geometric mean of all AOIs geometric mean of housekeepers within AOI.
    test:
    #### Spec 5 verify calculation of housekeeping norm factors
  7. The user shall be able to do background subtraction by panel. For each panel, negative background shall be calculated as the geometric mean of negatives for each AOI. Background subtracted counts shall be calculated as counts - corresponding AOI background for the corresponding panel.
    test:
    # #### Spec 6 verify calculation of subtract background norm factors
  8. The user shall be able to do background subtraction with all negatives regardless of panel. Negative background shall be calculated as the geometric mean of negatives for each AOI. Background subtracted counts shall be calculated as counts - corresponding AOI background.
    test:
    # compute neg norm factors for samples and divide by geomean
  9. An error shall be displayed if no negatives are available to calculate background when performing background subtraction.
    test:
    test_that("bg subtract errors with no negatives", {
  10. An error shall be displayed if no negatives are available to calculate background when performing negative normalization.
    test:
    test_that("Error is given if no negatives are in dataset", {
  11. An error shall be displayed if negative normalization is attempted on a probe-level object.
    test:
    test_that("Error is given if dataset is not collapsed", {
  12. An error shall be displayed if background subtraction is attempted on a probe-level object.
    test:
    test_that("background subtraction throws warning on probe level data", {
  13. All normalization methods work on protein data. test:
    # Spec 13: All normalization methods work on protein data.:------

Specs for Quality Control

  1. The Technical signal QC shall flag samples that have raw counts below the raw read threshold parameter. The Low Reads flag shall be stored in the protocol data.
    test:
    # Spec 1: test that the number of Low Reads is correct:------
  2. The Technical signal QC shall flag samples that are below the percent trimmed allowed. The percent trimmed shall be calculated as: 100% * (trimmed reads/raw reads). The LowTrimmed flag shall be stored in the protocol data.
    test:
    # Spec 2: test that the number of Low Percent Trimmed is correct:------
  3. The Technical signal QC shall flag samples that are below the percent stitched reads allowed. The percent stitched reads shall be computed as: 100 * (stitched reads / raw reads). The LowStitched flag shall be stored in the protocol data.
    test:
    # Spec 3: test that the number of Low Percent Stiched is correct:------
  4. The Technical signal QC shall flag samples that have percent aligned reads below the percent aligned reads threshold which is the minimum percent of raw reads aligned to target sequences allowed. The percent aligned reads shall be computed as: 100 * (aligned reads / raw reads). The LowAligned flag shall be stored in the protocol data.
    test:
    # Spec 4: test that the number of Low Percent Aligned is correct:------
  5. The Technical signal QC shall flag samples that are below the percent saturation allowed. The percent saturation shall be calculated as: 100% * (1 - deduplicated reads/aligned reads). The LowSaturation flag shall be stored in the protocol data.
    test:
    # Spec 5: test that the number of Low Percent Saturation is correct:------
  6. The Negative probe count geomean threshold establishes the level of technical noise expected and flags segments with signal below that level. The LowNegatives QC shall flag samples with geometric mean of negatives below the negative cutoff.
    test:
    # Spec 6: test that the number of Low Negatives is correct:------
  7. The No Template Control (NTC) Count establishes the level at which counts in the NTC will be flagged. The No Template Control (NTC) is used to detect contamination in the library prep. The QC shall flag segments that have higher than the maximum NTC count cutoff.
    test:
    # Spec 7: test that the number of High NTC is correct:------
  8. The minimum nuclei count threshold is the minimum recommended value for the GeoMx run and QC shall flag segments with nuclei count below that level. The LowNuclei flag shall be set for this QC on the object protocol slot.
    test:
    # Spec 8: test that the number of Low Area is correct:------
  9. The minimum surface area threshold is the minimum recommended value for the GeoMx run and QC shall flag segments with area below that level. The LowArea flag shall be set for this QC on the object protocol slot.
    test:
    # Spec 9: test that the number of Low Nuclei is correct:------
  10. The LowNuclei and/or LowArea flag QC shall be bypassed if no area and/or nuclei columns are in the input annotation file.
    test:
    # Spec 10: test that no error occurs when no nuclei or area:------
  11. The LowProbeRatio QC shall flag probes with geometric mean expression to target geometric mean expression ratios below the ratio cutoff.
    test:
    # Spec 11: test that the number of Low Probe Ratio is correct:------
  12. The LocalGrubbsOutlier QC shall flag probes that are Grubbs outliers in each AOI when compared to probes from the same target given specified alpha setting.
    test:
    # Spec 12: test that the Local Grubbs Outlier is correct:
  13. The GlobalGrubbsOutlier QC shall flag probes with percent of LocalGrubbsOutlier flags greater than the percent cutoff across all AOI.
    test:
    # Spec 13: test that the Global Grubbs Outlier is correct:
  14. Targets with less than three probes shall have no Grubbs outlier flags.
    test:
    # Spec 14: test that genes with less than 3 probes get no grubbs flag:
  15. LowProbeRatio flags shall match between GeomxTools BioProbeQC and DSPDA BioProbe QC.
    test:
  16. GlobalGrubbs flags shall match between GeomxTools BioProbeQC and DSPDA BioProbe QC.
    test:
  17. Proportions of local Grubbs' outliers per target shall match proportions per target identified with local Grubbs' outlier testing in DSPDA. Exact probes selected as outliers may vary if more than one probe has the same extreme value. By the definition of the Grubbs' test only one of these values may be excluded and the choice between probes with the same value is arbitrary.
    test:
  18. The QC flags from setSegmentQCFlags shall match the QC flags from running setSeqQCFlags, setBackgroundQCFlags, and setGeoMxQCFlags on the same GeoMxSet object with the same settings.
    test:
    # Spec 18: test that flags match after setSegmentQCFlags:------
  19. The QC flags from setSegmentQCFlags shall match the QC flags from running segment Quality Control in DSPDA with the same settings on the same data.
    test:
  20. The appropriate segment QC flags shall be added to a protein dataset. test:
    # Spec 20: The appropriate segment QC flags shall be added to a protein dataset.:------
  21. A warning is given if protein data is run through setBioProbeQCFlags. test:
    # Spec 21: A warning is given if protein data is run through setBioProbeQCFlags.:------

Specs for mixedModelDE

  1. The function probe p-value shall match the probe p-value from running linear mixed model analysis outside of the function.
    test:
    # Spec 1: test that the outputs from mc and serial methods is the same:------
  2. With a non-Windows operating system, parallelizing across multiple cores or clusters shall produce the same results. Multicore parallelization is not available for Windows.
    test:
    # Spec 2: test that the outputs from mc and parallel methods is the same:------
  3. With a non-Windows operating system, parallelizing across multiple cores or running the function sequentially shall produce the same results. Multicore parallelization is not available for Windows.
    test:
    # Spec 3. test that function works for model with random slope and random intercept
  4. An error shall be produced if model terms are not found in sample data.
    test:
    # Spec 4: test that function outputs an error when model terms are not in sData:------
  5. An error shall be produced if grouping variable is not located in the sample data.
    test:
    # Spec 5: test that function outputs an error when groupVar is not in model formula:------

Specs for shiftCountsOne

  1. The function with useDALogic param set to TRUE shall add one to all zeros in the expression matrix.
    test:
    # Spec 1: test that the counts from shiftCountsOne(..., useDALogic = TRUE) are correct:------
  2. The function with useDALogic param set to FALSE shall add one count to all counts in the expression matrix.
    test:
    # Spec 2: test that the counts from shiftCountsOne(..., useDALogic = FALSE) are correct:------

Specs for writeNanoStringGeoMxSet

  1. The function shall generate a DCC file for each sample from a probe-level GeoMxSet object expression matrix regardless of processing steps previously performed on the object.
    test:
    # Spec 1: test DCC files are written after read in
  2. The function shall not generate DCC files and an error shall be displayed when attempting to write from a target-level GeoMxSet object regardless of processing steps previously performed on the object.
    test:
    # Spec 2: test error occurs when writing set after aggregating counts
  3. GeoMxSet object generated from the created DCC files shall match the GeoMxSet object used to generate the DCC with the writeNanoStringGeoMxSet function with the exception of the NTC sample data column if included.
    test:
    # Spec 3: test GeomxSet object from written DCC is identical to original

Specs for utilty functions

  1. The function ngeoMean shall calculate the geometric mean of values. If values <=0 are provided to the function, values shall be shifted by a threshold value to be >0 prior to calculation. Values that are NA shall be ignored in the calculation.
    test:
    # Spec 1: test that ngeoMean is calculated as expected:------
  2. The function ngeoSD shall calculate the geometric standard deviation of values. If values <=0 are provided to the function, values shall be shifted by a threshold value to be >0 prior to calculation. Values that are NA shall be ignored in the calculation.
    test:
    # Spec 2: test that ngeoSD is calculated as expected:------
  3. The function logtBase shall calculate the log of values by base parameter. If values <=0 are provided to the function, values shall be shifted by a threshold value to be >0 prior to calculation. Values that are NA shall be ignored in the calculation.
    test:
    # Spec 3: test that logtBase is calculated as expected:------

Specs for GeoMxSet coercions

  1. The coercion of a GeoMxSet object shall warn users when coercing non-normalized data but will coerce when forced.
    test:
    # Spec 1: The coercion of a GeoMxSet object shall warn users when coercing non-normalized data but will coerce when forced.:------
  2. The coercion of a GeoMxSet object shall only occur on target level data.
    test:
    # Spec 1: The coercion of a GeoMxSet object shall only occur on target level data.:------
  3. The coercion of a GeoMxSet object shall only occur when a valid norm data count matrix is provided by the user.
    test:
    # Spec 3: The coercion of a GeoMxSet object shall only occur when a valid norm
  4. The coercion of a GeoMxSet object shall copy the wanted data from the GeoMxSet object to the correct location in the coerced object.
    test:
    # Spec 4: The coercion of a GeoMxSet object shall copy the wanted data from the
  5. The coercion of a GeoMxSet object shall warn users when the coordinate column names are not valid.
    test:
    # Spec 4: The coercion of a GeoMxSet object shall warn users when the coordinate
  6. The coercion of an older version of a GeoMxSet object to the current version is valid.
    test:
    # Spec 5: The coercion of an older version of a GeoMxSet object to the current

Specs for Protein functions

  1. igg.names shall return the expected target names.
    test:
    # Spec 1: igg.names shall return the expected target names.:------
  2. hk.names shall return the expected target names.
    test:
    # Spec 2: hk.names shall return the expected target names.:------
  3. computeNormalizationFactors and normalize calculations match. test:
    # Spec 3: computeNormalizationFactors and normalize calculations match.:------