Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 149 additions & 0 deletions .codeboarding/Application Orchestrator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
```mermaid

graph LR

Application_Orchestrator["Application Orchestrator"]

Command_Line_Interface["Command Line Interface"]

File_Discovery_and_Job_Management["File Discovery and Job Management"]

Read_Preprocessing_Quality_Control["Read Preprocessing & Quality Control"]

Debubbling_Algorithm["Debubbling Algorithm"]

Application_Orchestrator -- "configures using" --> Command_Line_Interface

Application_Orchestrator -- "manages file processing and parallel execution via" --> File_Discovery_and_Job_Management

File_Discovery_and_Job_Management -- "delegates data processing to" --> Read_Preprocessing_Quality_Control

Application_Orchestrator -- "initiates" --> Debubbling_Algorithm

Read_Preprocessing_Quality_Control -- "consumes output from" --> Debubbling_Algorithm

```

[![CodeBoarding](https://img.shields.io/badge/Generated%20by-CodeBoarding-9cf?style=flat-square)](https://github.com/CodeBoarding/GeneratedOnBoardings)[![Demo](https://img.shields.io/badge/Try%20our-Demo-blue?style=flat-square)](https://www.codeboarding.org/demo)[![Contact](https://img.shields.io/badge/Contact%20us%20-%20contact@codeboarding.org-lightgrey?style=flat-square)](mailto:contact@codeboarding.org)



## Component Details



The AfterQC pipeline is orchestrated by the Application Orchestrator, which handles command-line argument parsing, discovers FASTQ files for processing, and manages the parallel execution of preprocessing, quality control, and debubbling tasks. It delegates specific functionalities to dedicated components for efficient and modular data analysis.



### Application Orchestrator

The Application Orchestrator component, embodied by the `after.py` script, serves as the central control unit for the AfterQC pipeline. It is responsible for parsing command-line arguments, discovering input FASTQ files, initiating parallel processing jobs, and coordinating the overall workflow by delegating tasks to the Read Preprocessing & Quality Control and Structural Anomaly Processing components.





**Related Classes/Methods**:



- <a href="https://github.com/OpenGene/AfterQC/blob/master/after.py#L13-L92" target="_blank" rel="noopener noreferrer">`after.parseCommand` (13:92)</a>

- <a href="https://github.com/OpenGene/AfterQC/blob/master/after.py#L100-L170" target="_blank" rel="noopener noreferrer">`after.processDir` (100:170)</a>

- <a href="https://github.com/OpenGene/AfterQC/blob/master/after.py#L172-L174" target="_blank" rel="noopener noreferrer">`after.processOptions` (172:174)</a>

- <a href="https://github.com/OpenGene/AfterQC/blob/master/after.py#L176-L183" target="_blank" rel="noopener noreferrer">`after.runDebubble` (176:183)</a>





### Command Line Interface

This component is responsible for defining and parsing command-line arguments, allowing users to configure various parameters for the AfterQC tool, such as input/output paths, trimming settings, and quality control thresholds.





**Related Classes/Methods**:



- <a href="https://github.com/OpenGene/AfterQC/blob/master/after.py#L13-L92" target="_blank" rel="noopener noreferrer">`after.parseCommand` (13:92)</a>





### File Discovery and Job Management

This component automates the discovery of relevant FASTQ files within a specified directory, prepares unique processing options for each identified file set, and manages the creation and execution of multiprocessing jobs to enable parallel processing of sequencing data.





**Related Classes/Methods**:



- <a href="https://github.com/OpenGene/AfterQC/blob/master/after.py#L100-L170" target="_blank" rel="noopener noreferrer">`after.processDir` (100:170)</a>

- <a href="https://github.com/OpenGene/AfterQC/blob/master/util.py#L28-L33" target="_blank" rel="noopener noreferrer">`util.parseBool` (28:33)</a>





### Read Preprocessing & Quality Control

This component performs the core preprocessing and quality control operations on sequencing data. It applies trimming, assesses base quality, handles barcode sequences, and conducts overlap analysis, generating quality statistics and filtering reads based on user-defined criteria.





**Related Classes/Methods**:



- <a href="https://github.com/OpenGene/AfterQC/blob/master/preprocesser.py#L140-L818" target="_blank" rel="noopener noreferrer">`preprocesser.seqFilter` (140:818)</a>

- <a href="https://github.com/OpenGene/AfterQC/blob/master/after.py#L172-L174" target="_blank" rel="noopener noreferrer">`after.processOptions` (172:174)</a>





### Debubbling Algorithm

This component implements the debubbling algorithm to identify and remove 'bubble' reads from sequencing data, which are often indicative of sequencing errors or artifacts. It processes input directories to generate and utilize bubble circle information for filtering.





**Related Classes/Methods**:



- <a href="https://github.com/OpenGene/AfterQC/blob/master/debubble.py#L35-L52" target="_blank" rel="noopener noreferrer">`debubble.debubbleDir` (35:52)</a>

- <a href="https://github.com/OpenGene/AfterQC/blob/master/after.py#L176-L183" target="_blank" rel="noopener noreferrer">`after.runDebubble` (176:183)</a>

- <a href="https://github.com/OpenGene/AfterQC/blob/master/preprocesser.py#L156-L173" target="_blank" rel="noopener noreferrer">`preprocesser.seqFilter:loadBubbleCircles` (156:173)</a>

- <a href="https://github.com/OpenGene/AfterQC/blob/master/preprocesser.py#L175-L203" target="_blank" rel="noopener noreferrer">`preprocesser.seqFilter:isInBubble` (175:203)</a>









### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq)
143 changes: 143 additions & 0 deletions .codeboarding/Data I-O & Utilities.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
```mermaid

graph LR

FastqReader["FastqReader"]

FastqWriter["FastqWriter"]

SequenceAnalysisUtilities["SequenceAnalysisUtilities"]

GeneralUtilities["GeneralUtilities"]

FastqReader -- "provides raw sequence data" --> SequenceAnalysisUtilities

SequenceAnalysisUtilities -- "processes data from" --> FastqReader

SequenceAnalysisUtilities -- "provides processed sequence data" --> FastqWriter

FastqWriter -- "receives data from" --> SequenceAnalysisUtilities

```

[![CodeBoarding](https://img.shields.io/badge/Generated%20by-CodeBoarding-9cf?style=flat-square)](https://github.com/CodeBoarding/GeneratedOnBoardings)[![Demo](https://img.shields.io/badge/Try%20our-Demo-blue?style=flat-square)](https://www.codeboarding.org/demo)[![Contact](https://img.shields.io/badge/Contact%20us%20-%20contact@codeboarding.org-lightgrey?style=flat-square)](mailto:contact@codeboarding.org)



## Component Details



The Data I/O & Utilities component serves as the foundational layer for handling FASTQ sequencing data within the AfterQC project. It provides robust functionalities for reading and writing FASTQ files, supporting various compression formats. Additionally, it offers a suite of general-purpose and sequence-specific utility functions for data manipulation, quality assessment, and sequence analysis, promoting modularity and reusability across the project's data processing workflows.



### FastqReader

Manages the reading of FASTQ files, supporting gzipped and bzipped formats. It initializes file handles and provides functionality to iterate through reads. It also includes a utility to check if a file is a FASTQ file.





**Related Classes/Methods**:



- <a href="https://github.com/OpenGene/AfterQC/blob/master/fastq.py#L18-L30" target="_blank" rel="noopener noreferrer">`fastq.Reader.__init__` (18:30)</a>

- <a href="https://github.com/OpenGene/AfterQC/blob/master/fastq.py#L36-L48" target="_blank" rel="noopener noreferrer">`fastq.Reader.nextRead` (36:48)</a>

- <a href="https://github.com/OpenGene/AfterQC/blob/master/fastq.py#L50-L51" target="_blank" rel="noopener noreferrer">`fastq.Reader.isEOF` (50:51)</a>

- <a href="https://github.com/OpenGene/AfterQC/blob/master/fastq.py#L6-L11" target="_blank" rel="noopener noreferrer">`fastq.isFastq` (6:11)</a>





### FastqWriter

Handles the writing of data to FASTQ files, including support for gzipped output. It provides methods to write individual lines or complete sequence reads and to manage file stream operations like flushing and closing.





**Related Classes/Methods**:



- <a href="https://github.com/OpenGene/AfterQC/blob/master/fastq.py#L62-L75" target="_blank" rel="noopener noreferrer">`fastq.Writer.__init__` (62:75)</a>

- <a href="https://github.com/OpenGene/AfterQC/blob/master/fastq.py#L77-L79" target="_blank" rel="noopener noreferrer">`fastq.Writer.flush` (77:79)</a>

- <a href="https://github.com/OpenGene/AfterQC/blob/master/fastq.py#L81-L84" target="_blank" rel="noopener noreferrer">`fastq.Writer.close` (81:84)</a>

- <a href="https://github.com/OpenGene/AfterQC/blob/master/fastq.py#L86-L92" target="_blank" rel="noopener noreferrer">`fastq.Writer.writeLines` (86:92)</a>

- <a href="https://github.com/OpenGene/AfterQC/blob/master/fastq.py#L94-L103" target="_blank" rel="noopener noreferrer">`fastq.Writer.writeRead` (94:103)</a>





### SequenceAnalysisUtilities

Provides core utility functions for sequence manipulation and analysis, including calculating edit distances, Hamming distances, determining overlaps using various algorithms, and generating reverse complements. It also includes functions for quality score conversion.





**Related Classes/Methods**:



- <a href="https://github.com/OpenGene/AfterQC/blob/master/util.py#L35-L36" target="_blank" rel="noopener noreferrer">`util.complement` (35:36)</a>

- <a href="https://github.com/OpenGene/AfterQC/blob/master/util.py#L38-L39" target="_blank" rel="noopener noreferrer">`util.qualNum` (38:39)</a>

- <a href="https://github.com/OpenGene/AfterQC/blob/master/util.py#L41-L50" target="_blank" rel="noopener noreferrer">`util.reverseComplement` (41:50)</a>

- <a href="https://github.com/OpenGene/AfterQC/blob/master/util.py#L55-L61" target="_blank" rel="noopener noreferrer">`util.hammingDistance` (55:61)</a>

- <a href="https://github.com/OpenGene/AfterQC/blob/master/util.py#L64-L82" target="_blank" rel="noopener noreferrer">`util.editDistance` (64:82)</a>

- <a href="https://github.com/OpenGene/AfterQC/blob/master/util.py#L84-L85" target="_blank" rel="noopener noreferrer">`util.distance_threshold` (84:85)</a>

- <a href="https://github.com/OpenGene/AfterQC/blob/master/util.py#L87-L88" target="_blank" rel="noopener noreferrer">`util.overlap` (87:88)</a>

- <a href="https://github.com/OpenGene/AfterQC/blob/master/util.py#L90-L154" target="_blank" rel="noopener noreferrer">`util.overlap_ed` (90:154)</a>

- <a href="https://github.com/OpenGene/AfterQC/blob/master/util.py#L157-L211" target="_blank" rel="noopener noreferrer">`util.overlap_hm` (157:211)</a>





### GeneralUtilities

Contains general-purpose helper functions not specific to sequence data or FASTQ files, such as boolean parsing and string reversal.





**Related Classes/Methods**:



- <a href="https://github.com/OpenGene/AfterQC/blob/master/util.py#L28-L33" target="_blank" rel="noopener noreferrer">`util.parseBool` (28:33)</a>

- <a href="https://github.com/OpenGene/AfterQC/blob/master/util.py#L52-L53" target="_blank" rel="noopener noreferrer">`util.reverse` (52:53)</a>









### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq)
Loading