2024-07-05 13:14:38 +08:00
# RGB EPP
Reference Genome based Exon Phylogeny Pipeline
License: GPL-2.0-only
2024-07-05 13:22:50 +08:00
2024-07-05 13:14:38 +08:00
Author: Guoyi Zhang
2024-07-05 15:17:31 +08:00
## Requirements
2024-07-05 13:14:38 +08:00
2024-07-05 15:17:31 +08:00
### External software
2024-07-05 13:14:38 +08:00
- fastp
- spades.py (provided by spades)
- diamond
2024-12-09 14:24:08 +08:00
- bowtie2
- samtools
- bcftools
- exonerate (optional, only for --codon)
2024-07-05 13:14:38 +08:00
- java
- macse (default recognized path: /usr/share/java/macse.jar)
2024-12-09 14:24:08 +08:00
- trimal
2024-07-05 13:14:38 +08:00
2024-07-05 15:17:31 +08:00
### Internal software
2024-07-05 13:14:38 +08:00
- sortdiamond (default recognized path: /usr/bin/sortdiamond)
2024-12-09 14:24:08 +08:00
- delstop (default recognized path: /usr/bin/delstop)
2024-07-05 13:14:38 +08:00
2024-07-05 15:17:31 +08:00
## Arguments
2024-07-05 13:14:38 +08:00
2024-07-05 15:17:31 +08:00
### Details
2024-07-05 13:14:38 +08:00
```
2024-12-09 14:45:12 +08:00
-c --config config file for software path (optional)
-g --genes gene file path (optional, if -r is specified)
-f --functions functions type (optional): all clean assembly
map postmap varcall consen codon align trim
-h --help show this information
-l --list list file path
-m --memory memory settings (optional, default 16 GB)
-r --reference reference genome path
-t --threads threads setting (optional, default 8 threads)
--codon Only use the codon region (optional)
--fastp Fastp path (optional)
--spades Spades python path (optional)
--diamond Diamond python path (optional)
--sortdiamond SortDiamond python path (optional)
--bowtie2 Bowtie2 path (optional)
--samtools Samtools path (optional)
--bcftools Bcftools path (optional)
--exonerate Exonerate path (optional)
--macse Macse jarfile path (optional)
--delstop Delstop path (optional)
--trimal Trimal path (optional)
for example: ./RGBEPP -f all -l list -t 8 -r reference.fasta
2024-07-05 13:14:38 +08:00
```
2024-07-05 15:17:31 +08:00
### Directories Design
2024-07-05 13:14:38 +08:00
```
.
├── 00_raw
├── 01_fastp
├── 02_spades
2024-12-09 14:24:08 +08:00
├── 03_bowtie2
├── 04_bam
├── 05_vcf
├── 06_consen
├── 07_macse
2024-07-05 13:14:38 +08:00
├── 08_macse
2024-12-09 14:24:08 +08:00
├── 08_trimal
2024-07-05 13:14:38 +08:00
├── list
2024-12-09 14:24:08 +08:00
├── gene
2024-07-05 13:14:38 +08:00
├── reference.aa.fasta
2024-12-09 14:24:08 +08:00
└── RGBEPP
2024-07-05 13:14:38 +08:00
```
2024-07-05 13:20:25 +08:00
Each directory corresponds to each function.
`00_raw` should conatin all raw fastq.gz data.
2024-07-05 13:14:38 +08:00
2024-07-05 15:17:31 +08:00
### Text Files
2024-07-05 13:14:38 +08:00
`list` is the text file containing all samples, if your raw data is following the style ${list_name}\_R1.fastq.gz and ${list_name}\_R2.fastq.gz, ${list_name} is what you should list in `list` file. The easy way to get it in Linux/Unix system is the following command
```
cd 00_raw
ls | sed "s@_R[12].fastq.gz@@g" > ../list
cd ..
```
`genes` is the text file containing all gene names from the reference fasta file. The easy way to get it in Linux/Unix system is the following command
```
grep '>' Reference.fasta | sed "s@>@@g" > genes
```
`reference.aa.fasta` can be replaced by another other name, but it must contain reference amino acids genome in fasta format
2024-07-05 15:17:31 +08:00
## Process
2024-07-05 13:14:38 +08:00
2024-12-09 14:24:08 +08:00
### RGBEPP functions
2024-07-05 13:14:38 +08:00
- Function clean: Quality control + trimming (fastp)
- Function assembly: de novo assembly (spades)
2024-12-09 14:24:08 +08:00
- Function map: local nucleic acids alignment search against amino acids subject sequence (diamond, sortdiamond), mapping raw reads to its scaffolds sequences (bowtie2)
- Function postmap: Sorting and marking the read read alignment (samtools)
- Function varcall: variant calling and filtering (bcftools)
- Function consen: get consensus fasta file from vcf files (bcftools), then sort sequences based on gene name and taxa name (RGBEPP)
- Function codon (optional): only extract the exon sequence (exonerate)
- Function align: multiple sequence align based on condon (macse)
- Function trim: trimming based on codon (trimal, delstop)
### Arguments reuqirements for functions
| Functions | -g/--gene | -l/--list | -r/--reference |
| --------- | --------- | --------- | -------------- |
| clean | | ✔ | |
| assembly | | ✔ | |
| map | | ✔ | ✔ |
| postmap | | ✔ | |
| varcall | | ✔ | |
| consen | ✔ | ✔ | |
| codon | ✔ | | ✔ |
| align | ✔ | | |
| trim | ✔ | | |
2024-07-05 13:14:38 +08:00
2024-07-05 15:17:31 +08:00
### Downstream process
2024-07-05 13:14:38 +08:00
- concatenate sequences via SeqCombGo or catsequences or sequencematrix
- coalescent / concatenated phylogeny
2024-12-09 14:24:08 +08:00
## Inner software
### sortdiamond
2024-07-05 15:17:31 +08:00
2024-12-09 14:37:16 +08:00
Usage: `sortdiamond diamond_output.m8 generated.fasta sseq,qstart,qend,bitscore/evalue,qseq(optional, default 1,6,7,11,17, start from 0) bitscore/evalue(optional, default bitscore)`
2024-07-05 15:17:31 +08:00
Default sseq is column 2, qstart is column 8, etc.
Diamond default output format (--outfmt 6) does not contain qseq, you must custom the output format under output format 6.
2024-12-09 14:37:16 +08:00
### delstop
`delstop <fasta_aa> <fasta_nt> --delete`
Delete StopCondon generated by Macse. fasta_aa and fasta_nt should be macse output files, `--delete` should be used when downstream software is tirmal
2024-12-09 14:24:08 +08:00
### splitfasta
2024-07-05 15:17:31 +08:00
2024-12-09 14:37:16 +08:00
Usage: `splitfasta sample.fasta`
2024-07-05 15:17:31 +08:00
It always creates directories in the path that you run the splitfasta, and puts split fasta into the directory.
2024-07-05 13:14:38 +08:00