How jwyang16/decoder works
Main Components
• R Package Core – The primary functionality is implemented in the R directory. Key files include:
• DECODER_function.R (core deconvolution logic)
• DECODER_pipeline.R (the end-to-end data processing pipeline including reading BAM files, peak calling, counting, and deconvolution)
• Additional utility scripts in R/demo.r, R/genomes.r, etc.
• External Data – Provided in the “data” and “inst/extdata” directories:
• “data” holds RData files (demo examples, reference datasets).
• “inst/extdata” contains example BAM files separated into “bulk” and “single_cell” as sample inputs.
• Documentation & Manual – The “man” directory stores Rd files that document each exported function (e.g., DECODER, DECODER.pipeline).
• Installation & Metadata – Files like DESCRIPTION, NAMESPACE, and README provide metadata and usage instructions.
Relationships and Interactions
• User Interface:
• Users load the package in R (via library(DECODER)) and call the DECODER or DECODER.pipeline function.
• Data Flow:
• Input data flows from BAM files (bulk and single-cell), which are read via the pipeline functions.
• Pre-processing steps such as peak calling and counting are performed internally.
• The core deconvolution method then processes these data to estimate cell-type proportions.
• External Interaction:
• The package may interface with standard R libraries; it also comes with example data for demonstration.
• GitHub is used as the distribution channel.
Architectural Patterns and Technologies
• Modular Design:
• Separation of concerns is achieved by splitting the core logic (DECODER_function.R) and the pipeline workflow (DECODER_pipeline.R).
• Domain-Specific Workflow:
• R Package Structure:
• Standard R package components (R scripts, data, docs) which ensure reproducibility and ease of installation.
Final Details
• Start from the user loading R, then the package fetches example or user-specified BAM files from the “inst/extdata” folder, processes them using the defined functions in the “R” scripts, and returns the results.
• Also highlighting the alternative usage modes (using built-in reference vs. user-defined reference) as branching points in the data flow.