Skip to content

Commit

Permalink
Merge branch 'dev' into 'master'
Browse files Browse the repository at this point in the history
dev into master

See merge request tron/easyquant!16
  • Loading branch information
patricksorn committed Nov 24, 2023
2 parents 451a3e6 + 04abb67 commit 3afde1c
Show file tree
Hide file tree
Showing 21 changed files with 1,109 additions and 467 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ example_out*
*.pyc

*.Rproj

.idea/
dist
easy_quant.egg-info
build
19 changes: 19 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
stages:
- test
- deploy

test_pipeline:
image: condaforge/mambaforge:23.3.1-0
stage: test
script:
- mamba env create -f environment.yml --prefix conda_env/
- source /opt/conda/bin/activate conda_env/
- pip install .
- bash run_test.sh

deploy-job: # This job runs in the deploy stage.
stage: deploy # It only runs when *both* jobs in the test stage complete successfully.
environment: production
script:
- echo "Deploying application..."
- echo "Application successfully deployed."
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include requirements.txt
72 changes: 44 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# easyquant
# bp-quant

*Quantification of reads at defined positions to verify custom input sequences.*

Expand All @@ -13,67 +13,83 @@ breakpoint (spanning pairs).
- Input:
- Table with target sequences and breakpoints position (CSV/TSV format)
- fastq files / BAM file (BAM input only works in combination with STAR as aligner)
- Convert target sequences to FASTA format (`bp_quant csv2fasta`)
- Map reads against sequences using STAR/Bowtie2/BWA
- Generate Index of sequences as reference
- Map reads
- Count reads using `requantify.py`
- Generate Index of sequences as reference (`bp_quant index`)
- Map reads (`bp_quant align`)
- Count reads using `bp_quant count`
- Output:
- Table with read counts per input sequence

## Dependencies

- Python 3
- pysam (>= 0.16.0.1)
- STAR (>= 2.7.8a)
- samtools (>= 1.9)
- bowtie2 (>= 2.4.4)
- bwa (>= 0.7.17)
Look at this [environment.yml](https://github.com/TRON-Bioinformatics/easyquant/blob/master/environment.yml) for the individual dependencies (Hint: File can also be used to build conda environment).


## Installation

```
# Create conda environment from above or add the dependencies to your path
pip install bp-quant
```

Alternatively, bp-quant can be installed from [github repository](https://github.com/TRON-Bioinformatics/easyquant.git):

```
git clone https://github.com/TRON-Bioinformatics/easyquant.git
mv config.ini.sample config.ini
cd easyquant
# If you have conda installed you can simply install the environment like this
conda env create -f environment.yml
conda env create -f environment.yml --prefix conda_env/
conda activate conda_env/
# Otherwise you have to adjust the path to the different tools in your config.ini
pip install .
```


## Usage


```
usage: easy_quant.py [-h] [-1 FQ1] [-2 FQ2] [-b BAM] -s SEQ_TAB -o OUTPUT_FOLDER [-d BP_DISTANCE] [--allow_mismatches]
[--interval_mode] [-m {star,bowtie2,bwa}] [-t NUM_THREADS] [--star_cmd_params STAR_CMD_PARAMS]
usage: bp_quant pipeline [-h] [-1 FQ1] [-2 FQ2] [-b BAM] -s SEQ_TAB -o
OUTPUT_FOLDER [-d BP_DISTANCE] [--allow_mismatches]
[--interval_mode] [-m {star,bowtie2,bwa}]
[-t NUM_THREADS]
[--star_cmd_params STAR_CMD_PARAMS]
[--keep_bam | --keep_all]
Processing of demultiplexed FASTQs
Runs the complete EasyQuant pipeline
optional arguments:
-h, --help show this help message and exit
-1 FQ1, --fq1 FQ1 Specify path to Read 1 (R1) FASTQ file
-2 FQ2, --fq2 FQ2 Specify path to Read 2 (R2) FASTQ file
-b BAM, --bam_file BAM
Specify path to input BAM file as alternative to FASTQ input
Specify path to input BAM file as alternative to FASTQ
input
-s SEQ_TAB, --sequence_tab SEQ_TAB
Specify the reference sequences as table with colums name, sequence, and position
-o OUTPUT_FOLDER, --output-folder OUTPUT_FOLDER
Specify the reference sequences as table with colums
name, sequence, and position
-o OUTPUT_FOLDER, --output_folder OUTPUT_FOLDER
Specify the folder to save the results into.
-d BP_DISTANCE, --bp_distance BP_DISTANCE
Threshold in base pairs for the required overlap size of reads on both sides of the breakpoint for
Threshold in base pairs for the required overlap size
of reads on both sides of the breakpoint for
junction/spanning read counting
--allow_mismatches Allow mismatches within the region around the breakpoint determined by the bp_distance parameter
--allow_mismatches Allow mismatches within the region around the
breakpoint determined by the bp_distance parameter
--interval_mode Specify if interval mode shall be used
-m {star,bowtie2,bwa}, --method {star,bowtie2,bwa}
Specify alignment software to generate the index
-t NUM_THREADS, --threads NUM_THREADS
Specify number of threads to use for the alignment
--star_cmd_params STAR_CMD_PARAMS
Specify STAR commandline parameters to use for the alignment
Specify STAR commandline parameters to use for the
alignment
--keep_bam Do not delete alignment in BAM format during clean up
step
--keep_all Do not perform clean up step after re-quantification
Copyright (c) 2023 TRON gGmbH (See LICENSE for licensing details)
```

### Use case with example data
Expand All @@ -84,28 +100,28 @@ with input sequences and positions, as well as two fastq files / one BAM file.
Fastqs as input:

```
python easy_quant.py \
bp_quant pipeline \
-1 example_data/example_rna-seq_R1_001.fastq.gz \
-2 example_data/example_rna-seq_R1_001.fastq.gz \
-s example_data/CLDN18_Context_seq.csv \
-d 10 \
-o example_out \
-m star \
-t 6
[--interval-mode]
[--interval_mode]
```

BAM as input:

```
python easy_quant.py \
bp_quant pipeline \
-b example_data/example_rna-seq.bam \
-s example_data/CLDN18_Context_seq.csv \
-d 10 \
-o example_out \
-m star \
-t 6
[--interval-mode]
[--interval_mode]
```


Expand Down
8 changes: 0 additions & 8 deletions config.ini.sample

This file was deleted.

Loading

0 comments on commit 3afde1c

Please sign in to comment.