Metadata-Version: 2.1
Name: VaRaPS
Version: 0.7.3
Summary: VaRaPS : Variants Ratios from Pooled Sequencing
Author-email: DJAOUT El Hacene <djaout@lpsm.paris>
Description-Content-Type: text/markdown
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: pandas
Requires-Dist: pysam
Requires-Dist: cigar
Requires-Dist: tqdm


# VaRaPS

VaRaPS (Variant Read Proportion System) is a specialized tool designed for calculating the proportions of each variant from sequencing data, primarily focusing on BAM and CRAM file formats. This package provides targeted functionalities to accurately determine variant distributions, essential for detailed genomic analysis and research.

## Functionality

#### Mode 1
Mode 1 is focused on analyzing sequencing data from files in BAM or CRAM format. It is designed to process this data to calculate and report the proportions of each variant present in the sequencing. This mode is essential for the initial analysis and provides a foundation for more detailed variant proportion calculations.

### Mode 2

Mode 2 is utilized for calculating proportions from the output generated by Mode 1. This mode involves parameters such as number of bootstraps, initial alpha values, and optimization flags. It offers a deeper level of analysis, building upon the foundational data prepared in Mode 1.

### Mode 3

Mode 3 combines the functionalities of Modes 1 and 2. It starts by performing an analysis similar to Mode 1, creating a temporary directory for intermediate outputs. After processing the initial data, it then proceeds to Mode 2's detailed analysis, leveraging the intermediate data for comprehensive variant proportion calculations. This mode is particularly useful for extensive datasets requiring sequential processing stages.

These modes collectively provide a versatile toolset for genomic researchers to analyze sequencing data with precision and depth, specifically focusing on the proportions of various genetic variants.

## Installation

You can easily install VaRaPS from PyPI using pip:

```bash
pip install VaRaPS
```

## Usage

VaRaPS can be utilized in three distinct modes, each tailored for specific aspects of sequencing data analysis. Below are the detailed instructions for each mode:

### Mode 1

Use the following command structure to analyze your BAM/CRAM files:
        
    `varaps -m 1 --path [PATH_TO_BAM/CRAM] --ref [PATH_TO_REFERENCE] --output [OUTPUT_DIRECTORY] --filter_per [FILTER_PERCENTAGE] --filter_num [FILTER_NUMBER]` 
    
    Replace the placeholders with your data:
    * `[PATH_TO_BAM/CRAM]`: Path to the BAM/CRAM file or directory.
    * `[PATH_TO_REFERENCE]`: Path to the reference genome file.
    * `[OUTPUT_DIRECTORY]`: Directory for saving the output.
    * `[FILTER_PERCENTAGE]`: Percentage for filtering (optional).
    * `[FILTER_NUMBER]`: Number for filtering (optional).

### Mode 2

To use VaRaPS in Mode 2 for calculating variant proportions from Mode 1 output:

1.  **Prepare Mode 1 Output:** Ensure that the output from Mode 1, typically in CSV format, is available.
2.  **Run the analysis:** Execute the following command:
        
    `varaps -m 2 --path [PATH_TO_MODE1_OUTPUT] --M [VALUE] --output [OUTPUT_DIRECTORY] --NbBootstraps [BOOTSTRAPS] --alphaInit [ALPHA_INIT] --optibyAlpha [OPTIMIZE_BY_ALPHA] --deconv_method [DECONVOLUTION_METHOD]` 
    
    Replace the placeholders with appropriate values:
    * `[PATH_TO_MODE1_OUTPUT]`: Path to the folder or file containing Mode 1's output.
    * `[VALUE]`: Specify the M parameter value.
    * `[OUTPUT_DIRECTORY]`: Directory for saving the output.
    * `[BOOTSTRAPS]`: Number of bootstraps.
    * `[ALPHA_INIT]`: Initial alpha value.
    * `[OPTIMIZE_BY_ALPHA]`: Boolean flag to optimize by alpha (true/false).
    * `[DECONVOLUTION_METHOD]`: Method of deconvolution to use (numerical value).

### Mode 3

For using VaRaPS in Mode 3, which combines the functionalities of Modes 1 and 2:

1.  **Run the analysis:** Execute the following command:
        
    `varaps -m 3 --path [PATH_TO_DATA] --ref [REFERENCE_PATH] --output [OUTPUT_DIRECTORY] --filter_per [FILTER_PERCENTAGE] --filter_num [FILTER_NUMBER] --M [VALUE] --NbBootstraps [BOOTSTRAPS] --alphaInit [ALPHA_INIT] --optibyAlpha [OPTIMIZE_BY_ALPHA] --deconv_method [DECONVOLUTION_METHOD]` 
    
    The placeholders should be filled as follows:
    * `[PATH_TO_DATA]`: Path to the BAM/CRAM files or the directory containing them.
    * `[REFERENCE_PATH]`: Path to the reference file.
    * `[OUTPUT_DIRECTORY]`: Directory for saving the output.
    * `[FILTER_PERCENTAGE]` and `[FILTER_NUMBER]`: Filtering criteria for the initial analysis (Mode 1 part).
    * `[VALUE]`, `[BOOTSTRAPS]`, `[ALPHA_INIT]`, `[OPTIMIZE_BY_ALPHA]`, `[DECONVOLUTION_METHOD]`: Parameters for the detailed analysis (Mode 2 part).

## Contributing

Contributions to VaRaPS are welcome. If you have suggestions or improvements, feel free to mail me at djaout[at]lpsm.paris

## License

GNU General Public License v3 or later (GPLv3+)
## Contact

For any questions or feedback regarding VaRaPS, feel free to reach out through by mail at djaout[at]lpsm.paris

