SLRanger 0.0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- slranger-0.0.0.1/PKG-INFO +139 -0
- slranger-0.0.0.1/README.md +115 -0
- slranger-0.0.0.1/SLRanger/SL_detect.py +512 -0
- slranger-0.0.0.1/SLRanger/__init__.py +1 -0
- slranger-0.0.0.1/SLRanger/operon_predict.py +472 -0
- slranger-0.0.0.1/SLRanger/run_ex_function.py +54 -0
- slranger-0.0.0.1/SLRanger/visualization.py +412 -0
- slranger-0.0.0.1/SLRanger.egg-info/PKG-INFO +139 -0
- slranger-0.0.0.1/SLRanger.egg-info/SOURCES.txt +12 -0
- slranger-0.0.0.1/SLRanger.egg-info/dependency_links.txt +1 -0
- slranger-0.0.0.1/SLRanger.egg-info/requires.txt +11 -0
- slranger-0.0.0.1/SLRanger.egg-info/top_level.txt +1 -0
- slranger-0.0.0.1/setup.cfg +4 -0
- slranger-0.0.0.1/setup.py +36 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: SLRanger
|
|
3
|
+
Version: 0.0.0.1
|
|
4
|
+
Summary: An integrated approach for spliced leader detection and operon prediction in eukaryotes using long RNA reads
|
|
5
|
+
Home-page: https://github.com/lrslab/SLRanger
|
|
6
|
+
Author: GUO Zhihao
|
|
7
|
+
Author-email: qhuozhihao@icloud.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.7.0,<=3.11.7
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
Requires-Dist: bio>=1.5.0
|
|
14
|
+
Requires-Dist: numpy<2.0.0,>=1.23.0
|
|
15
|
+
Requires-Dist: pandas>=2.1.0
|
|
16
|
+
Requires-Dist: plotnine>=0.12.4
|
|
17
|
+
Requires-Dist: tqdm>=4.62.0
|
|
18
|
+
Requires-Dist: pysam>=0.21.0
|
|
19
|
+
Requires-Dist: biopython>=1.80
|
|
20
|
+
Requires-Dist: pyssw==0.1.7
|
|
21
|
+
Requires-Dist: trackcluster==0.1.7
|
|
22
|
+
Requires-Dist: scikit-learn>=1.2.2
|
|
23
|
+
Requires-Dist: tabulate>=0.8.0
|
|
24
|
+
|
|
25
|
+
# SLRanger
|
|
26
|
+
An integrated approach for spliced leader detection and operon prediction in eukaryotes using long RNA reads
|
|
27
|
+
|
|
28
|
+
## Workflow
|
|
29
|
+
|
|
30
|
+
<div align="center">
|
|
31
|
+
<img src="document/workflow.png" width="700" alt="Workflow">
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
**(A)** A flow chart illustrates the direct RNA sequencing procedure of the species with the spliced leader and trans-splicing mechanism. SL RNA joins to pre-mRNA through trans-splicing, adding an SL sequence to the 5′ end. This forms a mature mRNA with the SL sequence, which is then sequenced using Nanopore sequencing. Long RNA reads were mapped to genome reference.
|
|
35
|
+
**(B)** A flow chart illustrates the workflow of the function of SL detection using SLRanger. After long RNA reads are mapped to reference, the 5’ unaligned end sequences will be extracted for alignment to SL sequence references and random sequences (as control). Based on the scoring system produced by SLRanger, we obtained the “SL score” on the possibility that one read has an SL sequence and the distribution of different SL types.
|
|
36
|
+
**(C)** The plot of the principle on how SLRanger predicts operon with. Based on the information of whether each read has a high-confident SL sequence, we predict the operon structure through the mapping information of each read and the relative position of the gene. A high proportion of reads of the SL1 type will be regarded as operon upstream genes, while a high proportion of SL2 type reads or multiple reads supported by SL2 types will be regarded as operon downstream genes.
|
|
37
|
+
|
|
38
|
+
## Installation
|
|
39
|
+
The pipeline is invoked using a CLI written in Python(3.9-3.11) and requires a Unix-based operating system.
|
|
40
|
+
### a. Conda method
|
|
41
|
+
1. Prepare a new conda env
|
|
42
|
+
```
|
|
43
|
+
conda create -n SLRanger_env python=3.9
|
|
44
|
+
conda activate SLRanger_env
|
|
45
|
+
conda install -c bioconda bedtools minimap2 samtools
|
|
46
|
+
git clone https://github.com/lrslab/SLRanger.git
|
|
47
|
+
cd SLRanger/
|
|
48
|
+
pip install -r requirments.txt
|
|
49
|
+
```
|
|
50
|
+
2. Install from **Pypi** or clone from **github**
|
|
51
|
+
```
|
|
52
|
+
pip install SLRanger
|
|
53
|
+
# or
|
|
54
|
+
git clone https://github.com/lrslab/SLRanger.git
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### b. Docker method
|
|
58
|
+
```
|
|
59
|
+
docker pull zhihaguo/slranger_env
|
|
60
|
+
```
|
|
61
|
+
## Manual
|
|
62
|
+
SLRanger encompasses two primary functions, spliced leader (SL) detection and operon prediction, used to determine whether long RNA reads carry SL sequences and predict the operon structure based on the SL information.
|
|
63
|
+
### 1. Preprocessing
|
|
64
|
+
#### Reference and annotation selection
|
|
65
|
+
The long RNA reads will be mapped to the genome reference. The genome reference (**fasta/fa/fna** file) and annotation file (**GFF** file) should be determined before running SLRanger.
|
|
66
|
+
These can be downloaded from [NCBI](https://www.ncbi.nlm.nih.gov/datasets/genome/) or assembled independently.
|
|
67
|
+
|
|
68
|
+
In our sample folder,we provided _C. elegans_ annotation file.
|
|
69
|
+
#### Long reads alignment
|
|
70
|
+
Additionally, we require users to provide their own alignment file (**BAM** file). For long reads, minimap2 is the recommended software.
|
|
71
|
+
In the sample folder, we have provided **test.bam**, which was generated using the following command.
|
|
72
|
+
```
|
|
73
|
+
minimap2 -ax splice -uf -t 80 -k14 --MD --secondary=no $reference $basecall_file > tmp.sam
|
|
74
|
+
samtools view -hbS tmp.sam | samtools sort -@ 32 -F 260 -o test.bam
|
|
75
|
+
samtools index test.bam
|
|
76
|
+
```
|
|
77
|
+
### 2. Spliced Leader detection
|
|
78
|
+
`SL_detect.py` is designed to detect spliced leaders.
|
|
79
|
+
#### Command options
|
|
80
|
+
Available options can be viewed by running `python SL_detect.py -h` in the command line.
|
|
81
|
+
```
|
|
82
|
+
python ../SL_detect.py -h
|
|
83
|
+
usage: SL_detect.py [-h] -r REF -b BAM [-o OUTPUT] [--visualization] [-t CPU]
|
|
84
|
+
|
|
85
|
+
help to know spliced leader and distinguish SL1 and SL2
|
|
86
|
+
|
|
87
|
+
options:
|
|
88
|
+
-h, --help show this help message and exit
|
|
89
|
+
-r REF, --ref REF SL reference (fasta file recording SL sequence, required)
|
|
90
|
+
-b BAM, --bam BAM input the bam file (required)
|
|
91
|
+
-o OUTPUT, --output OUTPUT
|
|
92
|
+
output file (default: SLRanger.txt)
|
|
93
|
+
--visualization Turn on the visualization mode
|
|
94
|
+
-t CPU, --cpu CPU CPU number (default: 4)
|
|
95
|
+
```
|
|
96
|
+
#### Output description
|
|
97
|
+
##### i. result table
|
|
98
|
+
|
|
99
|
+
##### ii. visualization result
|
|
100
|
+
The summary table and figures, including the Data Summary Table and the pictures including Cumulative Counts (SW), Cumulative Counts (SL), Query Length Distribution, Aligned Length Distribution, SL Type Distribution.
|
|
101
|
+
will be output in a webpage format. An example is provided [here](sample/SLRange_view/visualization_results.md).
|
|
102
|
+
|
|
103
|
+
#### Example
|
|
104
|
+
We provided test data to run as below.
|
|
105
|
+
```
|
|
106
|
+
git clone https://github.com/lrslab/SLRanger.git
|
|
107
|
+
cd sample/
|
|
108
|
+
unzip data.zip
|
|
109
|
+
python SL_detect.py --ref SL_list_cel.fa --bam test.bam -o SLRanger.txt -t 4 --visualization
|
|
110
|
+
```
|
|
111
|
+
### 3. Operon prediction
|
|
112
|
+
`operon_predict.py` is designed to predict operons.
|
|
113
|
+
#### Command options
|
|
114
|
+
Available options can be viewed by running `python operon_predict.py -h` in the command line.
|
|
115
|
+
```
|
|
116
|
+
python ../operon_predict.py -h
|
|
117
|
+
usage: operon_predict.py [-h] -g GFF -b BAM -i INPUT [-o OUTPUT] [-d DISTANCE]
|
|
118
|
+
help to know spliced leader and distinguish SL1 and SL2
|
|
119
|
+
|
|
120
|
+
options:
|
|
121
|
+
-h, --help show this help message and exit
|
|
122
|
+
-g GFF, --gff GFF GFF annotation file (required)
|
|
123
|
+
-b BAM, --bam BAM bam file (required)
|
|
124
|
+
-i INPUT, --input INPUT
|
|
125
|
+
input the SL detection file (result file from SL_detect.py, required)
|
|
126
|
+
-o OUTPUT, --output OUTPUT
|
|
127
|
+
output operon detection file ( default: SLRanger.gff)
|
|
128
|
+
-d DISTANCE, --distance DISTANCE
|
|
129
|
+
promoter scope (default: 5000)
|
|
130
|
+
```
|
|
131
|
+
#### Output description
|
|
132
|
+
A GFF file will be returned.
|
|
133
|
+
|
|
134
|
+
#### Example
|
|
135
|
+
We provided test data to run as below (should be run after `SL_detect.py`).
|
|
136
|
+
```
|
|
137
|
+
cd sample/
|
|
138
|
+
python operon_predict.py -g cel_wormbase.gff -b test.bam -i SLRanger.txt -o test.gff
|
|
139
|
+
```
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# SLRanger
|
|
2
|
+
An integrated approach for spliced leader detection and operon prediction in eukaryotes using long RNA reads
|
|
3
|
+
|
|
4
|
+
## Workflow
|
|
5
|
+
|
|
6
|
+
<div align="center">
|
|
7
|
+
<img src="document/workflow.png" width="700" alt="Workflow">
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
**(A)** A flow chart illustrates the direct RNA sequencing procedure of the species with the spliced leader and trans-splicing mechanism. SL RNA joins to pre-mRNA through trans-splicing, adding an SL sequence to the 5′ end. This forms a mature mRNA with the SL sequence, which is then sequenced using Nanopore sequencing. Long RNA reads were mapped to genome reference.
|
|
11
|
+
**(B)** A flow chart illustrates the workflow of the function of SL detection using SLRanger. After long RNA reads are mapped to reference, the 5’ unaligned end sequences will be extracted for alignment to SL sequence references and random sequences (as control). Based on the scoring system produced by SLRanger, we obtained the “SL score” on the possibility that one read has an SL sequence and the distribution of different SL types.
|
|
12
|
+
**(C)** The plot of the principle on how SLRanger predicts operon with. Based on the information of whether each read has a high-confident SL sequence, we predict the operon structure through the mapping information of each read and the relative position of the gene. A high proportion of reads of the SL1 type will be regarded as operon upstream genes, while a high proportion of SL2 type reads or multiple reads supported by SL2 types will be regarded as operon downstream genes.
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
The pipeline is invoked using a CLI written in Python(3.9-3.11) and requires a Unix-based operating system.
|
|
16
|
+
### a. Conda method
|
|
17
|
+
1. Prepare a new conda env
|
|
18
|
+
```
|
|
19
|
+
conda create -n SLRanger_env python=3.9
|
|
20
|
+
conda activate SLRanger_env
|
|
21
|
+
conda install -c bioconda bedtools minimap2 samtools
|
|
22
|
+
git clone https://github.com/lrslab/SLRanger.git
|
|
23
|
+
cd SLRanger/
|
|
24
|
+
pip install -r requirments.txt
|
|
25
|
+
```
|
|
26
|
+
2. Install from **Pypi** or clone from **github**
|
|
27
|
+
```
|
|
28
|
+
pip install SLRanger
|
|
29
|
+
# or
|
|
30
|
+
git clone https://github.com/lrslab/SLRanger.git
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### b. Docker method
|
|
34
|
+
```
|
|
35
|
+
docker pull zhihaguo/slranger_env
|
|
36
|
+
```
|
|
37
|
+
## Manual
|
|
38
|
+
SLRanger encompasses two primary functions, spliced leader (SL) detection and operon prediction, used to determine whether long RNA reads carry SL sequences and predict the operon structure based on the SL information.
|
|
39
|
+
### 1. Preprocessing
|
|
40
|
+
#### Reference and annotation selection
|
|
41
|
+
The long RNA reads will be mapped to the genome reference. The genome reference (**fasta/fa/fna** file) and annotation file (**GFF** file) should be determined before running SLRanger.
|
|
42
|
+
These can be downloaded from [NCBI](https://www.ncbi.nlm.nih.gov/datasets/genome/) or assembled independently.
|
|
43
|
+
|
|
44
|
+
In our sample folder,we provided _C. elegans_ annotation file.
|
|
45
|
+
#### Long reads alignment
|
|
46
|
+
Additionally, we require users to provide their own alignment file (**BAM** file). For long reads, minimap2 is the recommended software.
|
|
47
|
+
In the sample folder, we have provided **test.bam**, which was generated using the following command.
|
|
48
|
+
```
|
|
49
|
+
minimap2 -ax splice -uf -t 80 -k14 --MD --secondary=no $reference $basecall_file > tmp.sam
|
|
50
|
+
samtools view -hbS tmp.sam | samtools sort -@ 32 -F 260 -o test.bam
|
|
51
|
+
samtools index test.bam
|
|
52
|
+
```
|
|
53
|
+
### 2. Spliced Leader detection
|
|
54
|
+
`SL_detect.py` is designed to detect spliced leaders.
|
|
55
|
+
#### Command options
|
|
56
|
+
Available options can be viewed by running `python SL_detect.py -h` in the command line.
|
|
57
|
+
```
|
|
58
|
+
python ../SL_detect.py -h
|
|
59
|
+
usage: SL_detect.py [-h] -r REF -b BAM [-o OUTPUT] [--visualization] [-t CPU]
|
|
60
|
+
|
|
61
|
+
help to know spliced leader and distinguish SL1 and SL2
|
|
62
|
+
|
|
63
|
+
options:
|
|
64
|
+
-h, --help show this help message and exit
|
|
65
|
+
-r REF, --ref REF SL reference (fasta file recording SL sequence, required)
|
|
66
|
+
-b BAM, --bam BAM input the bam file (required)
|
|
67
|
+
-o OUTPUT, --output OUTPUT
|
|
68
|
+
output file (default: SLRanger.txt)
|
|
69
|
+
--visualization Turn on the visualization mode
|
|
70
|
+
-t CPU, --cpu CPU CPU number (default: 4)
|
|
71
|
+
```
|
|
72
|
+
#### Output description
|
|
73
|
+
##### i. result table
|
|
74
|
+
|
|
75
|
+
##### ii. visualization result
|
|
76
|
+
The summary table and figures, including the Data Summary Table and the pictures including Cumulative Counts (SW), Cumulative Counts (SL), Query Length Distribution, Aligned Length Distribution, SL Type Distribution.
|
|
77
|
+
will be output in a webpage format. An example is provided [here](sample/SLRange_view/visualization_results.md).
|
|
78
|
+
|
|
79
|
+
#### Example
|
|
80
|
+
We provided test data to run as below.
|
|
81
|
+
```
|
|
82
|
+
git clone https://github.com/lrslab/SLRanger.git
|
|
83
|
+
cd sample/
|
|
84
|
+
unzip data.zip
|
|
85
|
+
python SL_detect.py --ref SL_list_cel.fa --bam test.bam -o SLRanger.txt -t 4 --visualization
|
|
86
|
+
```
|
|
87
|
+
### 3. Operon prediction
|
|
88
|
+
`operon_predict.py` is designed to predict operons.
|
|
89
|
+
#### Command options
|
|
90
|
+
Available options can be viewed by running `python operon_predict.py -h` in the command line.
|
|
91
|
+
```
|
|
92
|
+
python ../operon_predict.py -h
|
|
93
|
+
usage: operon_predict.py [-h] -g GFF -b BAM -i INPUT [-o OUTPUT] [-d DISTANCE]
|
|
94
|
+
help to know spliced leader and distinguish SL1 and SL2
|
|
95
|
+
|
|
96
|
+
options:
|
|
97
|
+
-h, --help show this help message and exit
|
|
98
|
+
-g GFF, --gff GFF GFF annotation file (required)
|
|
99
|
+
-b BAM, --bam BAM bam file (required)
|
|
100
|
+
-i INPUT, --input INPUT
|
|
101
|
+
input the SL detection file (result file from SL_detect.py, required)
|
|
102
|
+
-o OUTPUT, --output OUTPUT
|
|
103
|
+
output operon detection file ( default: SLRanger.gff)
|
|
104
|
+
-d DISTANCE, --distance DISTANCE
|
|
105
|
+
promoter scope (default: 5000)
|
|
106
|
+
```
|
|
107
|
+
#### Output description
|
|
108
|
+
A GFF file will be returned.
|
|
109
|
+
|
|
110
|
+
#### Example
|
|
111
|
+
We provided test data to run as below (should be run after `SL_detect.py`).
|
|
112
|
+
```
|
|
113
|
+
cd sample/
|
|
114
|
+
python operon_predict.py -g cel_wormbase.gff -b test.bam -i SLRanger.txt -o test.gff
|
|
115
|
+
```
|