├── .gitignore
├── Docker
├── Dockerfile
└── Readme.md
├── Images
├── Fig 5.png
├── Fig1.png
├── Fig2.png
├── Fig3.png
└── Fig4.png
├── LICENSE
├── NPfiles
├── editingStats.txt
├── editing_sorted.txt
└── sample_information_file.txt
├── NPscripts
├── REDItoolDnaRnav13.py
├── collect_editing_candidates.py
├── conda_pckg_installer_docker.py
├── conda_pckgs_installer.py
├── download-prepare-data-NP.py
├── download-prepare-data-NP_docker.py
└── get_Statistics.py
├── PKG-INFO
├── README.md
├── README_1.md
├── README_2.md
├── accessory
├── AnnotateTable.py
├── FilterTable.py
├── GFFtoTabix.py
├── Readme.md
├── SearchInTable.py
├── SortGFF.py
├── SortTable.py
├── TableToGFF.py
├── get_DE_events.py
├── readPsl.py
├── rediportal2recoding.py
├── selectPositions.py
├── subCount.py
├── subCount2.py
└── tableToTabix.py
├── main
├── REDItoolDenovo.py
├── REDItoolDnaRna.py
└── REDItoolKnown.py
└── setup.py
/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | *.py[cod]
4 | *$py.class
5 |
6 | # C extensions
7 | *.so
8 |
9 | # Distribution / packaging
10 | .Python
11 | build/
12 | develop-eggs/
13 | dist/
14 | downloads/
15 | eggs/
16 | .eggs/
17 | lib/
18 | lib64/
19 | parts/
20 | sdist/
21 | var/
22 | wheels/
23 | *.egg-info/
24 | .installed.cfg
25 | *.egg
26 | MANIFEST
27 |
28 | # PyInstaller
29 | # Usually these files are written by a python script from a template
30 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
31 | *.manifest
32 | *.spec
33 |
34 | # Installer logs
35 | pip-log.txt
36 | pip-delete-this-directory.txt
37 |
38 | # Unit test / coverage reports
39 | htmlcov/
40 | .tox/
41 | .coverage
42 | .coverage.*
43 | .cache
44 | nosetests.xml
45 | coverage.xml
46 | *.cover
47 | .hypothesis/
48 | .pytest_cache/
49 |
50 | # Translations
51 | *.mo
52 | *.pot
53 |
54 | # Django stuff:
55 | *.log
56 | local_settings.py
57 | db.sqlite3
58 |
59 | # Flask stuff:
60 | instance/
61 | .webassets-cache
62 |
63 | # Scrapy stuff:
64 | .scrapy
65 |
66 | # Sphinx documentation
67 | docs/_build/
68 |
69 | # PyBuilder
70 | target/
71 |
72 | # Jupyter Notebook
73 | .ipynb_checkpoints
74 |
75 | # pyenv
76 | .python-version
77 |
78 | # celery beat schedule file
79 | celerybeat-schedule
80 |
81 | # SageMath parsed files
82 | *.sage.py
83 |
84 | # Environments
85 | .env
86 | .venv
87 | env/
88 | venv/
89 | ENV/
90 | env.bak/
91 | venv.bak/
92 |
93 | # Spyder project settings
94 | .spyderproject
95 | .spyproject
96 |
97 | # Rope project settings
98 | .ropeproject
99 |
100 | # mkdocs documentation
101 | /site
102 |
103 | # mypy
104 | .mypy_cache/
105 |
--------------------------------------------------------------------------------
/Docker/Dockerfile:
--------------------------------------------------------------------------------
1 | #Download base image centos latest
2 | FROM centos
3 |
4 | #Dockerfile Mantainer
5 | LABEL mantainer="clalogiudice@gmail.com"
6 |
7 | #Update the centos software with yum package-manager
8 | RUN yum update -y && yum clean all
9 |
10 | #Install git, wget and nano package
11 | RUN yum -y install git wget nano && yum clean all
12 |
13 | #Clone Nature_protocol Git repository
14 | RUN git clone https://github.com/BioinfoUNIBA/REDItools
15 |
16 | WORKDIR "/REDItools/NPscripts/"
17 |
18 | #Install miniconda with conda packages required by the nature_protocol
19 | RUN chmod +x conda_pckg_installer_docker.py
20 | RUN ./conda_pckg_installer_docker.py
21 | ENV PATH /miniconda2/bin:$PATH
22 | RUN echo "source activate nature_protocol" >> ~/.bashrc
23 |
24 | #PREPARE NATURE_PROTOCOL environment
25 | WORKDIR "/"
26 | RUN echo "python ./REDItools/NPscripts/download-prepare-data-NP_docker.py" >> /root/.bashrc
27 |
--------------------------------------------------------------------------------
/Docker/Readme.md:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 | DOCKER BASIC COMMANDS
9 | This Dockerfile and its related image are part of the supplemental material for the paper
10 | "Investigating RNA editing in deep transcriptome datasets with REDItools and REDIportal"
11 |
12 | You can compile an image from this dockerfile with:
13 |
docker build -t [image_name] .
14 | eg. docker build -t rna_editing_protocol .
15 |
16 | and run a container with:
17 | docker run -it [image_name] bash
18 | eg. docker run -it rna_editing_protocol bash
19 |
20 |
21 | OR
22 |
23 |
24 | Download a pre-built image from Docker hub with:
25 |
docker pull claudiologiudice/rna_editing_protocol:latest
26 |
27 | and run a container with:
28 | docker run -it claudiologiudice/rna_editing_protocol:latest bash
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/Images/Fig 5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BioinfoUNIBA/REDItools/822cee595a2584a7bcf6fc4a4da3857ba1c8e8ca/Images/Fig 5.png
--------------------------------------------------------------------------------
/Images/Fig1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BioinfoUNIBA/REDItools/822cee595a2584a7bcf6fc4a4da3857ba1c8e8ca/Images/Fig1.png
--------------------------------------------------------------------------------
/Images/Fig2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BioinfoUNIBA/REDItools/822cee595a2584a7bcf6fc4a4da3857ba1c8e8ca/Images/Fig2.png
--------------------------------------------------------------------------------
/Images/Fig3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BioinfoUNIBA/REDItools/822cee595a2584a7bcf6fc4a4da3857ba1c8e8ca/Images/Fig3.png
--------------------------------------------------------------------------------
/Images/Fig4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BioinfoUNIBA/REDItools/822cee595a2584a7bcf6fc4a4da3857ba1c8e8ca/Images/Fig4.png
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 BioinfoUNIBA
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/NPfiles/editingStats.txt:
--------------------------------------------------------------------------------
1 | SubType ALU REPnonALU NONREP ALL
2 | AC 0.244897959184 0.0 0.0 0.24
3 | GT 0.571428571429 0.0 0.0 0.56
4 | AG 92.4897959184 0.0 100.0 92.64
5 | CA 0.326530612245 0.0 0.0 0.32
6 | CG 0.244897959184 0.0 0.0 0.24
7 | GC 0.489795918367 0.0 0.0 0.48
8 | AT 0.571428571429 0.0 0.0 0.56
9 | GA 1.22448979592 0.0 0.0 1.2
10 | TG 0.244897959184 0.0 0.0 0.24
11 | CT 1.55102040816 0.0 0.0 1.52
12 | TC 1.87755102041 0.0 0.0 1.84
13 | TA 0.163265306122 0.0 0.0 0.16
14 |
--------------------------------------------------------------------------------
/NPfiles/sample_information_file.txt:
--------------------------------------------------------------------------------
1 | Sample,Status
2 | SRR3306823,DIS
3 | SRR3306824,DIS
4 | SRR3306825,DIS
5 | SRR3306826,DIS
6 | SRR3306827,DIS
7 | SRR3306828,DIS
8 | SRR3306829,DIS
9 | SRR3306830,CTRL
10 | SRR3306831,CTRL
11 | SRR3306832,CTRL
12 | SRR3306833,CTRL
13 | SRR3306834,CTRL
14 | SRR3306835,CTRL
15 | SRR3306836,CTRL
--------------------------------------------------------------------------------
/NPscripts/collect_editing_candidates.py:
--------------------------------------------------------------------------------
1 |
2 | import sys, os
3 | import glob
4 |
5 | atab=glob.glob('firstalu/DnaRna_*/outTable_*')[0] #alu refined
6 | ftab=glob.glob('second/DnaRna_*/outTable_*')[0]
7 | if not os.path.exists('knownEditing'): sys.exit('knownEditing file not found.')
8 | if not os.path.exists('pos.txt'): sys.exit('pos.txt file not found.')
9 | if not os.path.exists('posalu.txt'): sys.exit('posalu.txt file not found.')
10 |
11 | o=open('editing.txt','w')
12 | f=open('knownEditing')
13 | for i in f: o.write(i)
14 | f.close()
15 | if os.path.exists(ftab):
16 | f=open(ftab)
17 | d={}
18 | for i in f:
19 | if i.startswith('Region'): continue
20 | l=(i.strip()).split('\t')
21 | d[(l[0],l[1])]=0
22 | f.close()
23 | f=open('pos.txt')
24 | for i in f:
25 | if i.startswith('Region'): continue
26 | l=(i.strip()).split('\t')
27 | if d.has_key((l[0],l[1])): o.write(i)
28 | f.close()
29 | f=open(atab)
30 | d={}
31 | for i in f:
32 | if i.startswith('Region'): continue
33 | l=(i.strip()).split('\t')
34 | d[(l[0],l[1])]=0
35 | f.close()
36 | f=open('posalu.txt')
37 | for i in f:
38 | if i.startswith('Region'): continue
39 | l=(i.strip()).split('\t')
40 | if d.has_key((l[0],l[1])): o.write(i)
41 | f.close()
42 |
--------------------------------------------------------------------------------
/NPscripts/conda_pckg_installer_docker.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # Mantainer clalogiudice@gmail.com
3 | # Permission is hereby granted, free of charge, to any person obtaining a copy
4 | # of this software and associated documentation files (the "Software"), to deal
5 | # in the Software without restriction, including without limitation the rights
6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | # copies of the Software, and to permit persons to whom the Software is
8 | # furnished to do so, subject to the following conditions:
9 | #
10 | # The above copyright notice and this permission notice shall be included in
11 | # all copies or substantial portions of the Software.
12 | #
13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | # THE SOFTWARE.
20 |
21 | import os, commands
22 |
23 | def install_conda_packages(conda_bin):
24 | """Installs conda packages required by the protocol"""
25 | install_cmd = os.system(cmd + ' install -n nature_protocol bcftools==1.9 bedtools==2.28.0 \
26 | bzip2==1.0.6 bwa==0.7.17 bx-python==0.8.2 fastp==0.20.0 fastqc==0.11.8 \
27 | fisher==0.1.4 git==2.21.0 gmap==2018.07.04 htslib==1.9 libdeflate==1.0 \
28 | numpy==1.16.2 pysam==0.15.2 rseqc==2.6.4 samtools==1.9 scipy==1.2.1 \
29 | star==2.7.0f wget==1.20.1')
30 | return install_cmd
31 |
32 |
33 | cwd = os.getcwd()
34 | installation_path = cwd + '/opt'
35 | if not os.path.exists(installation_path):
36 | os.mkdir(installation_path)
37 | os.chdir('./opt')
38 | conda_url = 'wget https://repo.anaconda.com/miniconda/Miniconda2-latest-Linux-x86_64.sh'
39 | i = 0
40 | while os.system(conda_url) != 0 and i <= 5:
41 | os.system(conda_url)
42 | i+=1
43 | os.system('chmod +x Miniconda2-latest-Linux-x86_64.sh')
44 | #os.system('bash Miniconda2-latest-Linux-x86_64.sh -b -p /REDItools/NPscripts/miniconda2/')
45 | os.system('bash Miniconda2-latest-Linux-x86_64.sh -b -p /miniconda2/')
46 | os.chdir('../')
47 | os.system('rm -rf opt/')
48 | cmd = '/miniconda2/bin/conda'
49 | os.system(cmd + ' config --add channels defaults')
50 | os.system(cmd + ' config --add channels bioconda')
51 | os.system(cmd + ' config --add channels conda-forge')
52 | os.system(cmd + ' create -n nature_protocol python=2.7 anaconda -y')
53 |
54 | install_conda_packages(cmd)
55 |
56 |
57 |
--------------------------------------------------------------------------------
/NPscripts/conda_pckgs_installer.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 | #
3 | # Permission is hereby granted, free of charge, to any person obtaining a copy
4 | # of this software and associated documentation files (the "Software"), to deal
5 | # in the Software without restriction, including without limitation the rights
6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | # copies of the Software, and to permit persons to whom the Software is
8 | # furnished to do so, subject to the following conditions:
9 | #
10 | # The above copyright notice and this permission notice shall be included in
11 | # all copies or substantial portions of the Software.
12 | #
13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | # THE SOFTWARE.
20 |
21 | import os, subprocess
22 |
23 | def install_conda_packages(conda_bin):
24 | """Installs conda packages required by the protocol"""
25 | install_cmd = os.system(cmd + ' install -n nature_protocol bcftools==1.9 bedtools==2.28.0 \
26 | bzip2==1.0.6 bwa==0.7.17 bx-python==0.8.2 fastp==0.20.0 fastqc==0.11.8 \
27 | fisher==0.1.4 git==2.21.0 gmap==2018.07.04 htslib==1.9 libdeflate==1.0 \
28 | numpy==1.16.2 pysam==0.15.2 rseqc==2.6.4 samtools==1.9 scipy==1.2.1 \
29 | star==2.7.0f wget==1.20.1')
30 | return install_cmd
31 |
32 | if subprocess.getstatusoutput('conda')[0] != 0:
33 | cwd = os.getcwd()
34 | installation_path = cwd + '/opt'
35 | if not os.path.exists(installation_path):
36 | os.mkdir(installation_path)
37 | os.chdir('./opt')
38 | conda_url = 'wget https://repo.anaconda.com/miniconda/Miniconda2-latest-Linux-x86_64.sh'
39 | i = 0
40 | while os.system(conda_url) != 0 and i <= 5:
41 | os.system(conda_url)
42 | i+=1
43 | os.system('chmod +x Miniconda2-latest-Linux-x86_64.sh')
44 | os.system('bash Miniconda2-latest-Linux-x86_64.sh')
45 | home_folder = os.path.expanduser('~')
46 | cmd = home_folder + '/miniconda2/bin/conda'
47 | os.system(cmd + ' config --add channels defaults')
48 | os.system(cmd + ' config --add channels bioconda')
49 | os.system(cmd + ' config --add channels conda-forge')
50 | os.system(cmd + ' create -n nature_protocol python=2.7 anaconda')
51 | install_conda_packages(cmd)
52 | print("Your conda environment has been succesfully created, now close your terminal and open a new one." + "\n" + \
53 | "Type in order:" + "\n" + \
54 | "source " + home_folder + "/.bashrc" + "\n" + \
55 | "conda activate nature_protocol")
56 | else:
57 | home_folder = os.path.expanduser('~')
58 | cmd = home_folder + '/miniconda2/bin/conda'
59 | os.system(cmd + ' config --add channels defaults')
60 | os.system(cmd + ' config --add channels bioconda')
61 | os.system(cmd + ' config --add channels conda-forge')
62 | os.system(cmd + ' create -n nature_protocol python=2.7 anaconda')
63 | install_conda_packages(cmd)
64 | print("Your conda environment has been succesfully created, now close your terminal and open a new one." + "\n" +
65 | "Type in order:" + "\n" + \
66 | "source " + home_folder + "/.bashrc" + "\n" + \
67 | "conda activate nature_protocol")
68 |
69 |
--------------------------------------------------------------------------------
/NPscripts/download-prepare-data-NP.py:
--------------------------------------------------------------------------------
1 | import sys, os, time
2 | import commands
3 | import distutils.spawn
4 |
5 | try:
6 | wdir=sys.argv[1] # working directory
7 | redipath=sys.argv[2] # path to REDItools folder
8 | usepath=sys.argv[3]
9 | except:
10 | sys.exit('