├── ChorusGUI ├── __init__.py ├── setup.py ├── ChorusGUI.ui ├── test_mplOV.ui ├── Probes.py ├── test_mplOV.py ├── run_test_OV.py ├── mplwidget.py ├── mplOVwidget.py ├── welcomeGUI.ui ├── ChorusGUI ├── welcomeGUI.py ├── run_Chorus.py ├── newProject.ui └── newProject.py ├── Choruslib ├── __init__.py ├── revcom.py ├── prefilter.py ├── subprocesspath.py ├── Baminfo.py ├── chorusio.py ├── loadfa.py ├── openBam.py ├── spgenome.py ├── Blatres.py ├── probecompare.py ├── primer3_filter.py ├── bamdepth.py ├── bcftools.py ├── exonerate.py ├── blat.py └── pbsearch.py ├── img ├── F1.jpg ├── F2.jpg ├── F3.jpg └── F4.jpg ├── docs ├── _build │ ├── html │ │ ├── _static │ │ │ ├── custom.css │ │ │ ├── F1.jpg │ │ │ ├── F2.jpg │ │ │ ├── F3.jpg │ │ │ ├── down.png │ │ │ ├── file.png │ │ │ ├── plus.png │ │ │ ├── up.png │ │ │ ├── minus.png │ │ │ ├── comment.png │ │ │ ├── ajax-loader.gif │ │ │ ├── docker_GUI.jpg │ │ │ ├── docker_GUI.tiff │ │ │ ├── up-pressed.png │ │ │ ├── comment-bright.png │ │ │ ├── comment-close.png │ │ │ ├── down-pressed.png │ │ │ ├── documentation_options.js │ │ │ ├── translations.js │ │ │ ├── pygments.css │ │ │ └── doctools.js │ │ ├── objects.inv │ │ ├── .doctrees │ │ │ ├── index.doctree │ │ │ ├── install.doctree │ │ │ ├── tutorial.doctree │ │ │ └── environment.pickle │ │ ├── _images │ │ │ ├── docker_GUI.jpg │ │ │ └── docker_GUI.tiff │ │ ├── .buildinfo │ │ ├── _sources │ │ │ ├── index.txt │ │ │ ├── index.rst.txt │ │ │ ├── install.txt │ │ │ └── Tutorial.txt │ │ ├── genindex.html │ │ ├── search.html │ │ ├── index.html │ │ └── searchindex.js │ ├── doctrees │ │ ├── index.doctree │ │ ├── Tutorial.doctree │ │ ├── install.doctree │ │ └── environment.pickle │ └── locale │ │ ├── .doctrees │ │ ├── index.doctree │ │ ├── install.doctree │ │ ├── tutorial.doctree │ │ └── environment.pickle │ │ ├── index.pot │ │ ├── tutorial.pot │ │ └── install.pot ├── _static │ ├── F1.jpg │ ├── F2.jpg │ ├── F3.jpg │ ├── F4.jpg │ ├── open_wsl.png │ ├── ChorusPBGUI.png │ ├── docker_GUI.jpg │ ├── instal_ubuntu.jpg │ ├── ChorusGUI_ubuntu.png │ └── ChorusGUI_parameter.png ├── locale │ └── zh_CN │ │ └── LC_MESSAGES │ │ ├── index.mo │ │ ├── install.mo │ │ ├── tutorial.mo │ │ ├── index.po │ │ ├── tutorial.po │ │ └── install.po ├── index.rst ├── videos.rst ├── Makefile ├── make.bat └── best practices.rst ├── requirements.txt ├── requirements_GUI.txt ├── MANIFEST.in ├── bin ├── Chorus2 ├── ChorusHomo ├── ChorusNoRef ├── ChorusPBGUI ├── ChorusNGSfilter ├── ChorusNGSselect └── ChorusDraftPrebuild ├── Docker ├── base │ ├── script │ │ └── Chorus.sh │ └── Dockerfile ├── tui │ ├── script │ │ └── Chorus.sh │ └── Dockerfile └── gui │ └── Dockerfile ├── LICENSE ├── setup.py ├── ChorusDraftPrebuild.py ├── ChorusNGSselect.py └── README.md /ChorusGUI/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Choruslib/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /img/F1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/img/F1.jpg -------------------------------------------------------------------------------- /img/F2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/img/F2.jpg -------------------------------------------------------------------------------- /img/F3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/img/F3.jpg -------------------------------------------------------------------------------- /img/F4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/img/F4.jpg -------------------------------------------------------------------------------- /docs/_build/html/_static/custom.css: -------------------------------------------------------------------------------- 1 | /* This file intentionally left blank. */ 2 | -------------------------------------------------------------------------------- /docs/_static/F1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_static/F1.jpg -------------------------------------------------------------------------------- /docs/_static/F2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_static/F2.jpg -------------------------------------------------------------------------------- /docs/_static/F3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_static/F3.jpg -------------------------------------------------------------------------------- /docs/_static/F4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_static/F4.jpg -------------------------------------------------------------------------------- /docs/_static/open_wsl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_static/open_wsl.png -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | Cython 2 | numpy 3 | pyfasta 4 | primer3-py 5 | pandas<2 6 | pyBigWig 7 | pybedtools 8 | -------------------------------------------------------------------------------- /docs/_build/html/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/html/objects.inv -------------------------------------------------------------------------------- /docs/_static/ChorusPBGUI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_static/ChorusPBGUI.png -------------------------------------------------------------------------------- /docs/_static/docker_GUI.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_static/docker_GUI.jpg -------------------------------------------------------------------------------- /docs/_static/instal_ubuntu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_static/instal_ubuntu.jpg -------------------------------------------------------------------------------- /docs/_build/html/_static/F1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/html/_static/F1.jpg -------------------------------------------------------------------------------- /docs/_build/html/_static/F2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/html/_static/F2.jpg -------------------------------------------------------------------------------- /docs/_build/html/_static/F3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/html/_static/F3.jpg -------------------------------------------------------------------------------- /docs/_build/html/_static/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/html/_static/down.png -------------------------------------------------------------------------------- /docs/_build/html/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/html/_static/file.png -------------------------------------------------------------------------------- /docs/_build/html/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/html/_static/plus.png -------------------------------------------------------------------------------- /docs/_build/html/_static/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/html/_static/up.png -------------------------------------------------------------------------------- /docs/_static/ChorusGUI_ubuntu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_static/ChorusGUI_ubuntu.png -------------------------------------------------------------------------------- /docs/_build/doctrees/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/doctrees/index.doctree -------------------------------------------------------------------------------- /docs/_build/html/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/html/_static/minus.png -------------------------------------------------------------------------------- /docs/_build/doctrees/Tutorial.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/doctrees/Tutorial.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/install.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/doctrees/install.doctree -------------------------------------------------------------------------------- /docs/_build/html/_static/comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/html/_static/comment.png -------------------------------------------------------------------------------- /docs/_static/ChorusGUI_parameter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_static/ChorusGUI_parameter.png -------------------------------------------------------------------------------- /docs/locale/zh_CN/LC_MESSAGES/index.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/locale/zh_CN/LC_MESSAGES/index.mo -------------------------------------------------------------------------------- /docs/_build/doctrees/environment.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/doctrees/environment.pickle -------------------------------------------------------------------------------- /docs/_build/html/.doctrees/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/html/.doctrees/index.doctree -------------------------------------------------------------------------------- /docs/_build/html/_images/docker_GUI.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/html/_images/docker_GUI.jpg -------------------------------------------------------------------------------- /docs/_build/html/_images/docker_GUI.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/html/_images/docker_GUI.tiff -------------------------------------------------------------------------------- /docs/_build/html/_static/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/html/_static/ajax-loader.gif -------------------------------------------------------------------------------- /docs/_build/html/_static/docker_GUI.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/html/_static/docker_GUI.jpg -------------------------------------------------------------------------------- /docs/_build/html/_static/docker_GUI.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/html/_static/docker_GUI.tiff -------------------------------------------------------------------------------- /docs/_build/html/_static/up-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/html/_static/up-pressed.png -------------------------------------------------------------------------------- /docs/locale/zh_CN/LC_MESSAGES/install.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/locale/zh_CN/LC_MESSAGES/install.mo -------------------------------------------------------------------------------- /docs/_build/html/.doctrees/install.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/html/.doctrees/install.doctree -------------------------------------------------------------------------------- /docs/_build/html/.doctrees/tutorial.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/html/.doctrees/tutorial.doctree -------------------------------------------------------------------------------- /docs/_build/html/_static/comment-bright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/html/_static/comment-bright.png -------------------------------------------------------------------------------- /docs/_build/html/_static/comment-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/html/_static/comment-close.png -------------------------------------------------------------------------------- /docs/_build/html/_static/down-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/html/_static/down-pressed.png -------------------------------------------------------------------------------- /docs/_build/locale/.doctrees/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/locale/.doctrees/index.doctree -------------------------------------------------------------------------------- /docs/locale/zh_CN/LC_MESSAGES/tutorial.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/locale/zh_CN/LC_MESSAGES/tutorial.mo -------------------------------------------------------------------------------- /docs/_build/html/.doctrees/environment.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/html/.doctrees/environment.pickle -------------------------------------------------------------------------------- /docs/_build/locale/.doctrees/install.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/locale/.doctrees/install.doctree -------------------------------------------------------------------------------- /docs/_build/locale/.doctrees/tutorial.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/locale/.doctrees/tutorial.doctree -------------------------------------------------------------------------------- /requirements_GUI.txt: -------------------------------------------------------------------------------- 1 | Cython 2 | numpy 3 | pyfasta 4 | primer3-py 5 | pandas<2 6 | pyBigWig 7 | matplotlib 8 | PyQt5<5.11 9 | SIP>=4 10 | -------------------------------------------------------------------------------- /docs/_build/locale/.doctrees/environment.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangtaolab/Chorus2/master/docs/_build/locale/.doctrees/environment.pickle -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include LICENSE 2 | include *.txt 3 | include README.md 4 | include ChorusGUI/* 5 | include docs/*.rst 6 | exclude img/* 7 | exclude Docker/* 8 | -------------------------------------------------------------------------------- /bin/Chorus2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #-*- coding: utf-8 -*- 3 | 4 | from Chorus2 import main 5 | import sys 6 | 7 | if __name__ == "__main__": 8 | 9 | main() 10 | -------------------------------------------------------------------------------- /bin/ChorusHomo: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #-*- coding: utf-8 -*- 3 | 4 | from ChorusHomo import main 5 | import sys 6 | 7 | if __name__ == "__main__": 8 | 9 | main() 10 | -------------------------------------------------------------------------------- /bin/ChorusNoRef: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #-*- coding: utf-8 -*- 3 | 4 | from ChorusNoRef import main 5 | import sys 6 | 7 | if __name__ == "__main__": 8 | 9 | main() 10 | -------------------------------------------------------------------------------- /bin/ChorusPBGUI: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #-*- coding: utf-8 -*- 3 | 4 | from ChorusPBGUI import main 5 | import sys 6 | 7 | if __name__ == "__main__": 8 | 9 | main() 10 | -------------------------------------------------------------------------------- /bin/ChorusNGSfilter: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #-*- coding: utf-8 -*- 3 | 4 | from ChorusNGSfilter import main 5 | import sys 6 | 7 | if __name__ == "__main__": 8 | 9 | main() 10 | -------------------------------------------------------------------------------- /bin/ChorusNGSselect: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #-*- coding: utf-8 -*- 3 | 4 | from ChorusNGSselect import main 5 | import sys 6 | 7 | if __name__ == "__main__": 8 | 9 | main() 10 | -------------------------------------------------------------------------------- /bin/ChorusDraftPrebuild: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #-*- coding: utf-8 -*- 3 | 4 | from ChorusDraftPrebuild import main 5 | import sys 6 | 7 | if __name__ == "__main__": 8 | 9 | main() 10 | -------------------------------------------------------------------------------- /Choruslib/revcom.py: -------------------------------------------------------------------------------- 1 | def revcom(sequence): 2 | 3 | revdic = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C','a':'t','t':'a','c':'g','g':'c'} 4 | 5 | return "".join([revdic[base] for base in reversed(sequence)]) -------------------------------------------------------------------------------- /docs/_build/html/.buildinfo: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: 517fa392e53be835a1a4c217e34ef2fa 4 | tags: 645f666f9bcd5a90fca523b33c5a78b7 5 | -------------------------------------------------------------------------------- /docs/_build/html/_static/documentation_options.js: -------------------------------------------------------------------------------- 1 | var DOCUMENTATION_OPTIONS = { 2 | URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), 3 | VERSION: '2.0', 4 | LANGUAGE: 'None', 5 | COLLAPSE_INDEX: false, 6 | BUILDER: 'html', 7 | FILE_SUFFIX: '.html', 8 | LINK_SUFFIX: '.html', 9 | HAS_SOURCE: true, 10 | SOURCELINK_SUFFIX: '.txt', 11 | NAVIGATION_WITH_KEYS: false 12 | }; -------------------------------------------------------------------------------- /ChorusGUI/setup.py: -------------------------------------------------------------------------------- 1 | from cx_Freeze import setup, Executable 2 | 3 | # Dependencies are automatically detected, but it might need 4 | # fine tuning. 5 | buildOptions = dict(packages = [], excludes = []) 6 | 7 | base = 'Console' 8 | 9 | executables = [ 10 | Executable('run_probMW.py', base=base) 11 | ] 12 | 13 | setup(name='probMW', 14 | version = '1.0', 15 | description = '', 16 | options = dict(build_exe = buildOptions), 17 | executables = executables) 18 | -------------------------------------------------------------------------------- /Choruslib/prefilter.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | 4 | def atcg_filter(sequence, rept=7): 5 | 6 | nmatch = re.compile(r'[Nn]') 7 | 8 | nfilter = bool(nmatch.search(sequence)) 9 | 10 | atcgmatch = re.compile(r'[aA]{%s}|[tT]{%s}|[cC]{%s}|[Gg]{%s}|[Nn]{%s}' % (rept, rept, rept, rept, rept)) 11 | 12 | atcgfilter = bool(atcgmatch.search(sequence)) 13 | 14 | filterseq = nfilter or atcgfilter 15 | 16 | return filterseq 17 | 18 | 19 | def gc_filter(sequence, maxgc, mingc): 20 | 21 | pass 22 | -------------------------------------------------------------------------------- /Choruslib/subprocesspath.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | 4 | def subprocesspath(path): 5 | """ 6 | 7 | :param path: path 8 | :return: path, for subprocess, avoid white space error 9 | """ 10 | 11 | rpath = '\''+ os.path.abspath(path)+'\'' 12 | 13 | return rpath 14 | 15 | 16 | def which(filename): 17 | """docstring for which""" 18 | locations = os.environ.get("PATH").split(os.pathsep) 19 | candidates = [] 20 | for location in locations: 21 | candidate = os.path.join(location, filename) 22 | if os.path.isfile(candidate): 23 | candidates.append(candidate) 24 | return candidates 25 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/index.txt: -------------------------------------------------------------------------------- 1 | .. Chorus documentation master file, created by 2 | sphinx-quickstart on Wed Aug 24 14:09:36 2016. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Welcome to Chorus's documentation! 7 | ================================== 8 | 9 | Contents: 10 | 11 | .. toctree:: 12 | :maxdepth: 2 13 | 14 | install 15 | tutorial 16 | 17 | Indices and tables 18 | ================== 19 | 20 | * :ref:`genindex` 21 | * :ref:`modindex` 22 | * :ref:`search` 23 | * `Jiming Jiang's Lab`_ 24 | * taozhang.org_ 25 | 26 | .. _taozhang.org: http://taozhang.org 27 | .. _`Jiming Jiang's Lab`: http://jianglab.horticulture.wisc.edu/ 28 | 29 | -------------------------------------------------------------------------------- /Docker/base/script/Chorus.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo $CHORUS_USER $CHORUS_HOME 4 | 5 | BLUE='\033[0;34m' 6 | GREEN='\033[0;32m' 7 | NC='\033[0m' 8 | 9 | if ! id -u $CHORUS_USER > /dev/null 2>&1; then 10 | echo -e "use local user: ${BLUE}$CHORUS_USER${NC}" 11 | addgroup --gid $CHORUS_UID $CHORUS_USER 12 | adduser --force-badname --disabled-password --gecos "" --uid $CHORUS_UID --gid $CHORUS_UID $CHORUS_USER 13 | fi 14 | 15 | if [ -e $CHORUS_HOME ]; 16 | then 17 | echo -e "${GREEN}$CHORUS_HOME${NC} exists" 18 | chown -R $CHORUS_USER $CHORUS_HOME 19 | else 20 | mkdir -p $CHORUS_HOME 21 | chown -R $CHORUS_UID $CHORUS_HOME 22 | fi 23 | 24 | for arg in "$*" 25 | do 26 | exec python3 /opt/software/Chorus2/Chorus2.py --docker True $* 27 | done 28 | -------------------------------------------------------------------------------- /Docker/tui/script/Chorus.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo $CHORUS_USER $CHORUS_HOME 4 | 5 | BLUE='\033[0;34m' 6 | GREEN='\033[0;32m' 7 | NC='\033[0m' 8 | 9 | if ! id -u $CHORUS_USER > /dev/null 2>&1; then 10 | echo -e "use local user: ${BLUE}$CHORUS_USER${NC}" 11 | addgroup --gid $CHORUS_UID $CHORUS_USER 12 | adduser --force-badname --disabled-password --gecos "" --uid $CHORUS_UID --gid $CHORUS_UID $CHORUS_USER 13 | fi 14 | 15 | if [ -e $CHORUS_HOME ]; 16 | then 17 | echo -e "${GREEN}$CHORUS_HOME${NC} exists" 18 | chown -R $CHORUS_USER $CHORUS_HOME 19 | else 20 | mkdir -p $CHORUS_HOME 21 | chown -R $CHORUS_UID $CHORUS_HOME 22 | fi 23 | 24 | for arg in "$*" 25 | do 26 | exec python3 /opt/software/Chorus2/Chorus2.py --docker True $* 27 | done 28 | -------------------------------------------------------------------------------- /Choruslib/Baminfo.py: -------------------------------------------------------------------------------- 1 | from Choruslib import openBam 2 | 3 | 4 | class Baminfo: 5 | 6 | def __init__(self, bamfile): 7 | self.bamfile = bamfile 8 | 9 | self.samfile = openBam.openBam(self.bamfile) 10 | 11 | self.chrlen = self.getchrlen() 12 | 13 | def getchrlen(self): 14 | ref_lengths = self.samfile.lengths 15 | 16 | sam_ref = self.samfile.references 17 | 18 | refere_ncenumber = self.samfile.nreferences 19 | 20 | chrlen = dict() 21 | 22 | for i in range(refere_ncenumber): 23 | chr_length = ref_lengths[i] 24 | 25 | chrlen[sam_ref[i]] = chr_length 26 | 27 | return chrlen 28 | 29 | # if __name__ == '__main__': 30 | # 31 | # baminfo = Bamfile('../tests/inputfile/npstest.bam') 32 | # 33 | # print() 34 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | .. Chorus documentation master file, created by 2 | sphinx-quickstart on Wed Aug 24 14:09:36 2016. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Welcome to Chorus's documentation! 7 | ================================== 8 | 9 | Contents: 10 | 11 | .. toctree:: 12 | :maxdepth: 3 13 | 14 | install 15 | tutorial 16 | best practices 17 | videos 18 | functions 19 | 20 | Indices and tables 21 | ================== 22 | 23 | * :ref:`genindex` 24 | * :ref:`modindex` 25 | * :ref:`search` 26 | * `Jiming Jiang's Lab`_ 27 | * `ZhangTaoLab`_ 28 | * taozhang.org_ 29 | 30 | .. _taozhang.org: http://taozhang.org 31 | .. _ZhangTaoLab: http://zhangtaolab.org/ 32 | .. _`Jiming Jiang's Lab`: http://jianglab.plantbiology.msu.edu/ 33 | 34 | -------------------------------------------------------------------------------- /ChorusGUI/ChorusGUI.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 800 10 | 600 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 20 | 0 21 | 0 22 | 800 23 | 22 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/index.rst.txt: -------------------------------------------------------------------------------- 1 | .. Chorus documentation master file, created by 2 | sphinx-quickstart on Wed Aug 24 14:09:36 2016. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Welcome to Chorus's documentation! 7 | ================================== 8 | 9 | Contents: 10 | 11 | .. toctree:: 12 | :maxdepth: 3 13 | 14 | install 15 | tutorial 16 | videos 17 | functions 18 | 19 | Indices and tables 20 | ================== 21 | 22 | * :ref:`genindex` 23 | * :ref:`modindex` 24 | * :ref:`search` 25 | * `Jiming Jiang's Lab`_ 26 | * `ZhangTaoLab`_ 27 | * taozhang.org_ 28 | 29 | .. _taozhang.org: http://taozhang.org 30 | .. _ZhangTaoLab: http://zhangtaolab.org/ 31 | .. _`Jiming Jiang's Lab`: http://jianglab.horticulture.wisc.edu/ 32 | 33 | -------------------------------------------------------------------------------- /ChorusGUI/test_mplOV.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Form 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | OverView 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | MplOVWidget 25 | QWidget 26 |
mplOVwidget.h
27 | 1 28 |
29 |
30 | 31 | 32 |
33 | -------------------------------------------------------------------------------- /ChorusGUI/Probes.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | 3 | 4 | class Probes: 5 | 6 | def __init__(self, filename): 7 | 8 | self.filename = filename 9 | 10 | self.__readprobe() 11 | 12 | def readprobe(self): 13 | 14 | filename = self.filename 15 | 16 | probe = pd.read_table(filename, header=None) 17 | 18 | probe[3] = (probe[1]/1000).astype('int') 19 | 20 | print(probe) 21 | 22 | maxlength=probe[2][probe[2].idxmax(axis=1)] 23 | 24 | chrs = probe[0].unique().tolist() 25 | 26 | chrlens = dict() 27 | 28 | for chrnow in chrs: 29 | 30 | chrlen = max(probe[probe[0]==chrnow][3]) 31 | 32 | print(chrnow, chrlen) 33 | 34 | chrlens[chrnow] = chrlen + 1 35 | 36 | self.chrs = chrs 37 | 38 | self.maxlength = maxlength + 1 39 | 40 | self.probe = probe 41 | 42 | self.chrlens = chrlens 43 | 44 | __readprobe = readprobe -------------------------------------------------------------------------------- /Choruslib/chorusio.py: -------------------------------------------------------------------------------- 1 | from pyfasta import Fasta 2 | 3 | 4 | def writebed(probelist, outbedfile): 5 | 6 | '''probe list format: 7 | 8 | chr\tstart\tend 9 | 10 | ''' 11 | outio = open(outbedfile, 'w') 12 | 13 | for pbnow in probelist: 14 | 15 | print(pbnow, file=outio) 16 | 17 | outio.close() 18 | 19 | 20 | def writefa(genomefile, bedfile, outfile): 21 | 22 | fastafile = Fasta(genomefile) 23 | 24 | bedio = open(bedfile, 'r') 25 | 26 | outio = open(outfile, 'w') 27 | 28 | for lin in bedio.readlines(): 29 | 30 | lin = lin.rstrip() 31 | 32 | chrnow, start, end = lin.split('\t') 33 | 34 | seqid = '>' + chrnow + ':' + start + '-' + end 35 | 36 | nowseq = fastafile[chrnow][int(start):int(end)] 37 | 38 | print(seqid, file=outio) 39 | 40 | print(nowseq, file=outio) 41 | 42 | bedio.close() 43 | 44 | outio.close() 45 | 46 | # return True 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Choruslib/loadfa.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | 5 | class FastaNotFound(Exception): 6 | 7 | pass 8 | 9 | 10 | def loadfa(fastafile): 11 | 12 | if not os.path.exists(fastafile): 13 | raise FastaNotFound('"' + fastafile + '"') 14 | 15 | fh = open(fastafile, 'r') 16 | 17 | seqs = '' 18 | 19 | for line in fh: 20 | 21 | line = line.rstrip() 22 | # print (line) 23 | if not line: 24 | 25 | continue 26 | 27 | if line[0] == ">": 28 | 29 | pass 30 | 31 | else: 32 | 33 | seqs = seqs + line 34 | 35 | fh.close() 36 | 37 | return seqs 38 | 39 | 40 | # if __name__ == "__main__": 41 | # 42 | # try: 43 | # 44 | # fa = loadfa(fastafile='/Users/Forrest/Documents/Project/Chorus/Test/PGSC_DM_v4.03_pseudomolecules_genes_exon_test.fa') 45 | # 46 | # print(fa) 47 | # 48 | # except KeyboardInterrupt: 49 | # 50 | # sys.stderr.write("User interrupt\n") 51 | # 52 | # sys.exit(0) -------------------------------------------------------------------------------- /ChorusGUI/test_mplOV.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'test_mplOV.ui' 4 | # 5 | # Created: Thu Feb 5 10:35:34 2015 6 | # by: PyQt5 UI code generator 5.4 7 | # 8 | # WARNING! All changes made in this file will be lost! 9 | 10 | from PyQt5 import QtCore, QtGui, QtWidgets 11 | 12 | class Ui_Form(object): 13 | def setupUi(self, Form): 14 | Form.setObjectName("Form") 15 | Form.resize(400, 300) 16 | self.verticalLayout = QtWidgets.QVBoxLayout(Form) 17 | self.verticalLayout.setObjectName("verticalLayout") 18 | self.widgetOV = MplOVWidget(Form) 19 | self.widgetOV.setObjectName("widgetOV") 20 | self.verticalLayout.addWidget(self.widgetOV) 21 | 22 | self.retranslateUi(Form) 23 | QtCore.QMetaObject.connectSlotsByName(Form) 24 | 25 | def retranslateUi(self, Form): 26 | _translate = QtCore.QCoreApplication.translate 27 | Form.setWindowTitle(_translate("Form", "OverView")) 28 | 29 | from mplOVwidget import MplOVWidget 30 | -------------------------------------------------------------------------------- /docs/_build/locale/index.pot: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2016, Tao Zhang 3 | # This file is distributed under the same license as the Chorus package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: Chorus 1.0\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2016-08-25 11:27-0500\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | 19 | #: ../../index.rst:7 20 | msgid "Welcome to Chorus's documentation!" 21 | msgstr "" 22 | 23 | #: ../../index.rst:9 24 | msgid "Contents:" 25 | msgstr "" 26 | 27 | #: ../../index.rst:18 28 | msgid "Indices and tables" 29 | msgstr "" 30 | 31 | #: ../../index.rst:20 32 | msgid ":ref:`genindex`" 33 | msgstr "" 34 | 35 | #: ../../index.rst:21 36 | msgid ":ref:`modindex`" 37 | msgstr "" 38 | 39 | #: ../../index.rst:22 40 | msgid ":ref:`search`" 41 | msgstr "" 42 | 43 | -------------------------------------------------------------------------------- /Choruslib/openBam.py: -------------------------------------------------------------------------------- 1 | import pysam 2 | import sys 3 | import os.path 4 | 5 | 6 | def openBam(bamFile): 7 | try: 8 | bam = pysam.Samfile(bamFile, 'rb') 9 | 10 | except IOError: 11 | 12 | sys.exit("The file {} does not exist".format(bamFile)) 13 | 14 | except: 15 | 16 | sys.exit("The file {} does not have BAM format ".format(bamFile)) 17 | 18 | try: 19 | 20 | if 'check_index' in dir(bam): 21 | 22 | assert (bam.check_index()) 23 | 24 | else: 25 | # The proper check_index() function wasn't implemented until pysam 0.8.4! 26 | assert (bam._hasIndex()) 27 | 28 | except: 29 | 30 | sys.exit("{} does not appear to have an index. You MUST index the file first!".format(bamFile)) 31 | 32 | if bam.mapped == 0: 33 | sys.exit("Samtools reports that the number of mapped " 34 | "reads is zero for the file {}. Please check " 35 | "that the file is properly indexed and that " 36 | "it contains mapped reads.".format(bamFile)) 37 | 38 | return bam 39 | -------------------------------------------------------------------------------- /docs/locale/zh_CN/LC_MESSAGES/index.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2016, Tao Zhang 3 | # This file is distributed under the same license as the Chorus package. 4 | # FIRST AUTHOR , 2016. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: Chorus 1.0\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2016-08-25 11:27-0500\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=utf-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Generated-By: Babel 1.3\n" 19 | 20 | #: ../../index.rst:7 21 | msgid "Welcome to Chorus's documentation!" 22 | msgstr "" 23 | 24 | #: ../../index.rst:9 25 | msgid "Contents:" 26 | msgstr "" 27 | 28 | #: ../../index.rst:18 29 | msgid "Indices and tables" 30 | msgstr "" 31 | 32 | #: ../../index.rst:20 33 | msgid ":ref:`genindex`" 34 | msgstr "" 35 | 36 | #: ../../index.rst:21 37 | msgid ":ref:`modindex`" 38 | msgstr "" 39 | 40 | #: ../../index.rst:22 41 | msgid ":ref:`search`" 42 | msgstr "" 43 | 44 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 zhangtaolab 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 | -------------------------------------------------------------------------------- /ChorusGUI/run_test_OV.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | from PyQt5 import QtWidgets, QtGui, QtCore 3 | import sys 4 | from ChorusGUI.test_mplOV import Ui_Form 5 | from matplotlib.figure import Figure 6 | from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas 7 | 8 | class FMPT(QtWidgets.QDialog, Ui_Form): 9 | 10 | def __init__(self, parent=None): 11 | 12 | super(FMPT, self).__init__(parent) 13 | self.setupUi(self) 14 | 15 | self.x = np.arange(0.0, 5.0, 0.01) 16 | 17 | self.y = np.sin(2*np.pi*self.x) + 0.5*np.random.randn(len(self.x)) 18 | 19 | 20 | # self.fig = Figure() 21 | 22 | # self.ax1 = self.fig.add_subplot(211) 23 | 24 | # self.ax2 = self.fig.add_subplot(212) 25 | 26 | # self.widgetOV.canvas = FigureCanvas(self.fig) 27 | 28 | self.widgetOV.canvas.ax.plot(self.x, self.y, '-') 29 | 30 | # self.widgetOV.canvas.ax2.plot(self.x, self.y, '-') 31 | 32 | self.widgetOV.canvas.draw() 33 | 34 | 35 | if __name__ == '__main__': 36 | 37 | 38 | app = QtWidgets.QApplication(sys.argv) 39 | 40 | tb = FMPT() 41 | 42 | tb.show() 43 | 44 | 45 | sys.exit(app.exec_()) -------------------------------------------------------------------------------- /Choruslib/spgenome.py: -------------------------------------------------------------------------------- 1 | from pyfasta import Fasta 2 | from os import path 3 | 4 | def spgenome(fafile, outdir, maxsize=1000000000): 5 | 6 | 7 | spfiles = list() 8 | if path.exists(fafile): 9 | 10 | outfiles = dict() 11 | 12 | subfiles = dict() 13 | 14 | infa = Fasta(fafile) 15 | 16 | # nowsub = 0 17 | 18 | nowlen = 0 19 | 20 | for chrom in infa.keys(): 21 | 22 | chrlen = len(infa[chrom]) 23 | 24 | nowlen = nowlen+chrlen 25 | 26 | nowsub = int(nowlen/maxsize) 27 | 28 | if nowsub not in subfiles: 29 | 30 | subfilename = 'tmpfile' + str(nowsub) + '.fa' 31 | 32 | subfile = path.join(outdir,subfilename) 33 | 34 | spfiles.append(subfile) 35 | 36 | subfiles[nowsub] = open(subfile,'w') 37 | 38 | # outfiles[chrom] = nowsub 39 | 40 | print('>', chrom, sep='', file=subfiles[nowsub]) 41 | 42 | print(infa[chrom], file=subfiles[nowsub]) 43 | 44 | for nowsub in subfiles: 45 | 46 | subfiles[nowsub].close() 47 | 48 | 49 | else: 50 | print("Can't find ", fafile) 51 | 52 | return spfiles 53 | 54 | if __name__ == '__main__': 55 | 56 | pass -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import os 4 | from setuptools import setup 5 | from setuptools import find_packages 6 | 7 | def readme(fname): 8 | return open(os.path.join(os.path.dirname(__file__), fname)).read() 9 | 10 | setup(name='Chorus2', 11 | version='2.0', 12 | packages=find_packages(), 13 | author='Tao Zhang', 14 | author_email='zhangtao@yzu.edu.cn', 15 | scripts=['bin/Chorus2', 'bin/ChorusNGSfilter', 'bin/ChorusNGSselect', 'bin/ChorusHomo', 16 | 'bin/ChorusNoRef', 'bin/ChorusGUI', 'bin/ChorusPBGUI', 'bin/ChorusDraftPrebuild'], 17 | py_modules=['Chorus2', 'ChorusNGSfilter', 'ChorusNGSselect', 'ChorusHomo', 18 | 'ChorusNoRef', 'ChorusDraftPrebuild', 'ChorusGUI', 'ChorusPBGUI'], 19 | include_package_data=True, 20 | url='https://github.com/zhangtaolab/Chorus2', 21 | license='LICENSE', 22 | description='Chorus2 software for oligo-FISH probe design', 23 | long_description=readme('README.md'), 24 | classifiers=['Intended Audience :: Science/Research'], 25 | install_requires=["cython", "numpy", "pyfasta", "primer3-py", "pandas", "pyBigWig", 26 | "pybedtools", "matplotlib", "PyQt5<5.11", "SIP>=4"], 27 | zip_safe=False, 28 | ) 29 | -------------------------------------------------------------------------------- /Choruslib/Blatres.py: -------------------------------------------------------------------------------- 1 | class Blatres: 2 | 3 | def __init__(self, seq, blatlines): 4 | 5 | self.seq = seq 6 | 7 | self.blatlines = blatlines 8 | 9 | self.matchednumber = 0 10 | 11 | self.identicnumber = 0 12 | 13 | self.blatidenticlist = list() 14 | 15 | self._processblatline() 16 | 17 | def processblatline(self): 18 | 19 | for lin in self.blatlines: 20 | 21 | lin = lin.rstrip("\n") 22 | 23 | (match,mismatch,repmatch,Ns, qgapcount, qgapbase, tgapcount, tgapbases, 24 | strand, qname, qsize, qstart, qend, tname, tsize, tstart,tend,blockcount, 25 | blocksize,qStarts,qStarts) = lin.split("\t") 26 | 27 | nscore = int(mismatch)+int(repmatch)+int(qgapbase)+int(tgapbases) 28 | 29 | self.matchednumber += 1 30 | 31 | if nscore == 0: 32 | 33 | blatidenticres = dict() 34 | 35 | blatidenticres[qname] = qname 36 | 37 | blatidenticres[tname] = tname 38 | 39 | blatidenticres[tstart] = tstart 40 | 41 | blatidenticres[tend] = tend 42 | 43 | self.blatidenticlist.append(blatidenticres) 44 | 45 | self.identicnumber += 1 46 | 47 | _processblatline = processblatline -------------------------------------------------------------------------------- /ChorusGUI/mplwidget.py: -------------------------------------------------------------------------------- 1 | import matplotlib 2 | matplotlib.use("Qt5Agg") 3 | from PyQt5 import QtWidgets 4 | from matplotlib.figure import Figure 5 | from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas 6 | 7 | 8 | class MplCanvas(FigureCanvas): 9 | 10 | def __init__(self): 11 | # self.x = x 12 | self.fig = Figure() 13 | 14 | self.fig.set_tight_layout(True) 15 | 16 | self.ax1 = self.fig.add_subplot(211) 17 | 18 | self.ax1.set_title("Whole Chr (Mb)") 19 | 20 | self.ax2 = self.fig.add_subplot(212) 21 | 22 | self.ax2.set_title("Zoom in Region (Kb)") 23 | 24 | self.line2 = object() 25 | 26 | FigureCanvas.__init__(self, self.fig) 27 | 28 | FigureCanvas.setSizePolicy(self, 29 | QtWidgets.QSizePolicy.Expanding, 30 | QtWidgets.QSizePolicy.Expanding) 31 | 32 | FigureCanvas.updateGeometry(self) 33 | 34 | 35 | class MplWidget(QtWidgets.QWidget): 36 | 37 | def __init__(self, parent=None): 38 | 39 | QtWidgets.QWidget.__init__(self, parent) 40 | 41 | self.canvas = MplCanvas() 42 | 43 | self.vbl = QtWidgets.QVBoxLayout() 44 | 45 | self.vbl.addWidget(self.canvas) 46 | 47 | self.setLayout(self.vbl) 48 | 49 | -------------------------------------------------------------------------------- /Docker/base/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM forrestzhang/ubuntu-dev 2 | 3 | MAINTAINER Tao Zhang "forrestzhang1982@gmail.com" 4 | 5 | 6 | RUN apt-get update && apt-get install cython3 7 | 8 | 9 | RUN mkdir /opt/software 10 | WORKDIR /opt/software 11 | ADD https://github.com/gmarcais/Jellyfish/releases/download/v2.2.3/jellyfish-2.2.3.tar.gz /opt/software/ 12 | RUN tar zxvf jellyfish-2.2.3.tar.gz && mv jellyfish-2.2.3 jellyfish && cd jellyfish && ./configure && make && make install 13 | 14 | #WORKDIR /opt/software 15 | ADD https://github.com/forrestzhang/primer3-py/archive/unicode.zip /opt/software/ 16 | RUN unzip unicode.zip && cd primer3-py-unicode && python3 setup.py install 17 | 18 | #WORKDIR /opt/software 19 | RUN git clone https://github.com/lh3/bwa.git && cd bwa && make 20 | 21 | RUN pip3 install numpy pyfasta 22 | 23 | #RUN mkdir Chorus 24 | # RUN mkdir -p Chorus/Choruslib 25 | # ADD Chorus.py Chorus/ 26 | # ADD Choruslib/* Chorus/Choruslib/ 27 | WORKDIR /opt/software 28 | RUN git clone https://github.com/zhangtaolab/Chorus2.git 29 | 30 | 31 | ENV PATH /opt/software/bwa:/opt/software/jellyfish/bin:$PATH 32 | 33 | ENV CHORUS_USER=chorus \ 34 | CHORUS_UID=1555 \ 35 | CHORUS_GID=1555 \ 36 | CHORUS_HOME=/home/chorus 37 | 38 | RUN groupadd -r $CHORUS_USER -g $CHORUS_GID 39 | RUN useradd -u $CHORUS_UID -r -g $CHORUS_GID -d $CHORUS_HOME -c "Chorus user" $CHORUS_USER 40 | 41 | ADD ./script/Chorus.sh /usr/bin/Chorus 42 | RUN chmod +x /usr/bin/Chorus 43 | 44 | WORKDIR $CHORUS_HOME 45 | 46 | 47 | -------------------------------------------------------------------------------- /Docker/tui/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM forrestzhang/ubuntu-dev 2 | 3 | MAINTAINER Tao Zhang "forrestzhang1982@gmail.com" 4 | 5 | 6 | RUN apt-get update && apt-get install cython3 7 | 8 | 9 | RUN mkdir /opt/software 10 | WORKDIR /opt/software 11 | ADD https://github.com/gmarcais/Jellyfish/releases/download/v2.2.3/jellyfish-2.2.3.tar.gz /opt/software/ 12 | RUN tar zxvf jellyfish-2.2.3.tar.gz && mv jellyfish-2.2.3 jellyfish && cd jellyfish && ./configure && make && make install 13 | 14 | #WORKDIR /opt/software 15 | ADD https://github.com/forrestzhang/primer3-py/archive/unicode.zip /opt/software/ 16 | RUN unzip unicode.zip && cd primer3-py-unicode && python3 setup.py install 17 | 18 | #WORKDIR /opt/software 19 | RUN git clone https://github.com/lh3/bwa.git && cd bwa && make 20 | 21 | RUN pip3 install numpy pyfasta 22 | 23 | #RUN mkdir Chorus 24 | # RUN mkdir -p Chorus/Choruslib 25 | # ADD Chorus.py Chorus/ 26 | # ADD Choruslib/* Chorus/Choruslib/ 27 | WORKDIR /opt/software 28 | RUN git clone https://github.com/zhangtaolab/Chorus2.git 29 | 30 | 31 | ENV PATH /opt/software/bwa:/opt/software/jellyfish/bin:$PATH 32 | 33 | ENV CHORUS_USER=chorus \ 34 | CHORUS_UID=1555 \ 35 | CHORUS_GID=1555 \ 36 | CHORUS_HOME=/home/chorus 37 | 38 | RUN groupadd -r $CHORUS_USER -g $CHORUS_GID 39 | RUN useradd -u $CHORUS_UID -r -g $CHORUS_GID -d $CHORUS_HOME -c "Chorus user" $CHORUS_USER 40 | 41 | ADD ./script/Chorus.sh /usr/bin/Chorus 42 | RUN chmod +x /usr/bin/Chorus 43 | 44 | WORKDIR $CHORUS_HOME 45 | 46 | ENTRYPOINT ["/usr/bin/Chorus"] 47 | -------------------------------------------------------------------------------- /ChorusGUI/mplOVwidget.py: -------------------------------------------------------------------------------- 1 | import matplotlib 2 | matplotlib.use("Qt5Agg") 3 | from PyQt5 import QtWidgets 4 | from matplotlib.figure import Figure 5 | from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas 6 | from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolbar 7 | 8 | class MplOVCanvas(FigureCanvas ): 9 | 10 | def __init__(self, subplotnum = 1): 11 | # self.x = x 12 | self.fig = Figure() 13 | 14 | # rownumber = int(subplotnum+1/2) 15 | 16 | 17 | self.ax = self.fig.add_subplot(111) 18 | 19 | 20 | FigureCanvas.__init__(self, self.fig) 21 | 22 | FigureCanvas.setSizePolicy(self, 23 | QtWidgets.QSizePolicy.Expanding, 24 | QtWidgets.QSizePolicy.Expanding) 25 | 26 | FigureCanvas.updateGeometry(self) 27 | 28 | 29 | class MplOVWidget(QtWidgets.QWidget): 30 | 31 | def __init__(self, parent=None): 32 | 33 | QtWidgets.QWidget.__init__(self, parent) 34 | 35 | # self.main_widget = QtWidgets.QWidget(self) 36 | self.main_fram = QtWidgets.QWidget() 37 | 38 | # self.canvas = MplOVCanvas() 39 | self.canvas = MplOVCanvas() 40 | 41 | self.canvas.setParent(self.main_fram) 42 | 43 | self.ntb = NavigationToolbar(self.canvas, self.main_fram) 44 | 45 | self.vbl = QtWidgets.QVBoxLayout() 46 | 47 | self.vbl.addWidget(self.ntb) 48 | 49 | self.vbl.addWidget(self.canvas) 50 | 51 | self.setLayout(self.vbl) -------------------------------------------------------------------------------- /docs/videos.rst: -------------------------------------------------------------------------------- 1 | Video tutorials 2 | ================= 3 | 4 | YouTube 5 | ----------------- 6 | 7 | **Playlist**: https://www.youtube.com/playlist?list=PLo8q8tqFX5J27OsuKYFpd-gOtl8Qgf70X 8 | 9 | **Linux**: 10 | 11 | Install Chorus2 via conda in Linux: https://youtu.be/MzzWtO6CJPs 12 | 13 | Probes design with Chorus2 in Linux: https://youtu.be/kxsNjfJJLI4 14 | 15 | Find conserved oligos in close related species with ChorusHomo: https://youtu.be/F1rqsRI3R98 16 | 17 | **Windows**: 18 | 19 | Install WSL in Windows: https://youtu.be/rDfq54XFJEQ 20 | 21 | Install Anaconda in Windows: https://youtu.be/qp0jvztfLFQ 22 | 23 | Install Chorus2 via conda in Windows: https://youtu.be/VfkRyKoI828 24 | 25 | Run ChorusGUI in Windows: https://youtu.be/bSHyQovPAsc 26 | 27 | Run ChorusPBGUI in Windows: https://youtu.be/mxTlqmoy2Z0 28 | 29 | Filter repetitive sequences with NGS data: https://youtu.be/vHTKAUK9oQI 30 | 31 | 32 | bilibili 33 | ----------------- 34 | 35 | **视频列表**: https://www.bilibili.com/video/BV1W54y1S7qS/ 36 | 37 | **Linux**: 38 | 39 | 使用bioconda在linux中安装Chorus2软件:https://www.bilibili.com/video/BV1W54y1S7qS?p=1 40 | 41 | 使用Chorus2设计Oligo-FISH探针:https://www.bilibili.com/video/BV1W54y1S7qS?p=2 42 | 43 | 使用ChorusHomo设计近源物种可用探针:https://www.bilibili.com/video/BV1W54y1S7qS?p=3 44 | 45 | **Windows**: 46 | 47 | 安装Windows子系统:https://www.bilibili.com/video/BV1W54y1S7qS?p=4 48 | 49 | 安装Anaconda:https://www.bilibili.com/video/BV1W54y1S7qS?p=5 50 | 51 | 使用bioconda安装Chorus2软件:https://www.bilibili.com/video/BV1W54y1S7qS?p=6 52 | 53 | 使用图形界面运行Chorus2:https://www.bilibili.com/video/BV1W54y1S7qS?p=7 54 | 55 | 使用图形界面筛选已设计的探针:https://www.bilibili.com/video/BV1W54y1S7qS?p=8 56 | 57 | 利用二代基因组测序数据过滤潜在重复序列:https://www.bilibili.com/video/BV1W54y1S7qS?p=9 58 | 59 | -------------------------------------------------------------------------------- /docs/_build/locale/tutorial.pot: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2016, Tao Zhang 3 | # This file is distributed under the same license as the Chorus package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: Chorus 1.0\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2016-08-25 11:27-0500\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | 19 | #: ../../tutorial.rst:2 20 | msgid "Tutorial" 21 | msgstr "" 22 | 23 | #: ../../tutorial.rst:4 24 | msgid "In this tutorial, we will build oligo porbe set for Arabidopsis genome." 25 | msgstr "" 26 | 27 | #: ../../tutorial.rst:7 28 | msgid "Using Docker Terminal Version" 29 | msgstr "" 30 | 31 | #: ../../tutorial.rst:10 32 | msgid "Install" 33 | msgstr "" 34 | 35 | #: ../../tutorial.rst:12 36 | msgid "Install Docker_" 37 | msgstr "" 38 | 39 | #: ../../tutorial.rst:16 40 | msgid "Download Chorus:" 41 | msgstr "" 42 | 43 | #: ../../tutorial.rst:22 44 | msgid "Parameter of Chorus:" 45 | msgstr "" 46 | 47 | #: ../../tutorial.rst:41 48 | msgid "Download Reference Genome file:" 49 | msgstr "" 50 | 51 | #: ../../tutorial.rst:50 52 | msgid "Please wait unit all precess done. There are some logs:" 53 | msgstr "" 54 | 55 | #: ../../tutorial.rst:83 56 | msgid "When process done:" 57 | msgstr "" 58 | 59 | #: ../../tutorial.rst:101 60 | msgid "*TAIR10_chr_all.fas.bed* is the probe file." 61 | msgstr "" 62 | 63 | #: ../../tutorial.rst:113 64 | msgid "There are four columns in a row, first column is chromosome name, second is oligo start site, third is oligo end site, last one is oligo probe sequence. You can use excel or text editor to open this file." 65 | msgstr "" 66 | 67 | -------------------------------------------------------------------------------- /docs/locale/zh_CN/LC_MESSAGES/tutorial.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2016, Tao Zhang 3 | # This file is distributed under the same license as the Chorus package. 4 | # FIRST AUTHOR , 2016. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: Chorus 1.0\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2016-08-25 11:27-0500\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=utf-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Generated-By: Babel 1.3\n" 19 | 20 | #: ../../tutorial.rst:2 21 | msgid "Tutorial" 22 | msgstr "" 23 | 24 | #: ../../tutorial.rst:4 25 | msgid "In this tutorial, we will build oligo porbe set for Arabidopsis genome." 26 | msgstr "" 27 | 28 | #: ../../tutorial.rst:7 29 | msgid "Using Docker Terminal Version" 30 | msgstr "" 31 | 32 | #: ../../tutorial.rst:10 33 | msgid "Install" 34 | msgstr "" 35 | 36 | #: ../../tutorial.rst:12 37 | msgid "Install Docker_" 38 | msgstr "" 39 | 40 | #: ../../tutorial.rst:16 41 | msgid "Download Chorus:" 42 | msgstr "" 43 | 44 | #: ../../tutorial.rst:22 45 | msgid "Parameter of Chorus:" 46 | msgstr "" 47 | 48 | #: ../../tutorial.rst:41 49 | msgid "Download Reference Genome file:" 50 | msgstr "" 51 | 52 | #: ../../tutorial.rst:50 53 | msgid "Please wait unit all precess done. There are some logs:" 54 | msgstr "" 55 | 56 | #: ../../tutorial.rst:83 57 | msgid "When process done:" 58 | msgstr "" 59 | 60 | #: ../../tutorial.rst:101 61 | msgid "*TAIR10_chr_all.fas.bed* is the probe file." 62 | msgstr "" 63 | 64 | #: ../../tutorial.rst:113 65 | msgid "" 66 | "There are four columns in a row, first column is chromosome name, second " 67 | "is oligo start site, third is oligo end site, last one is oligo probe " 68 | "sequence. You can use excel or text editor to open this file." 69 | msgstr "" 70 | 71 | -------------------------------------------------------------------------------- /Choruslib/probecompare.py: -------------------------------------------------------------------------------- 1 | import operator 2 | 3 | def compareseq(seq1, seq2): 4 | len1 = len(seq1) 5 | len2 = len(seq2) 6 | dif = '-1' 7 | same = 0 8 | if len1 == len2: 9 | 10 | for i in range(len1): 11 | 12 | if seq1[i] == seq2[i]: 13 | same += 1 14 | 15 | dif = len1 - same 16 | 17 | else: 18 | dif = '-1' 19 | 20 | return dif 21 | 22 | 23 | def getconsensusprobe(probelist): 24 | probelen0 = len(probelist[0]) 25 | 26 | consensusprobe = '' 27 | 28 | for probenow in probelist: 29 | 30 | if probelen0 != len(probenow): 31 | consensusprobe = -1 32 | consensusscore = -1 33 | break 34 | 35 | if not consensusprobe == -1: 36 | 37 | consensuslist = list() 38 | consensuscount = list() 39 | for i in range(len(probelist[0])): 40 | 41 | nowdict = dict() 42 | 43 | for j in range(len(probelist)): 44 | # print(i,j) 45 | if probelist[j][i] in nowdict: 46 | 47 | nowdict[probelist[j][i]] += 1 48 | 49 | else: 50 | 51 | nowdict[probelist[j][i]] = 1 52 | 53 | consensuslist.append(max(nowdict.items(), key=operator.itemgetter(1))[0]) 54 | 55 | consensuscount.append((max(nowdict.items(), key=operator.itemgetter(1))[1])) 56 | 57 | # consensusprobe = ''.join(consensuslist) 58 | # consensusscore = ''.join(consensuscount) 59 | res = dict() 60 | 61 | res['consensusprobe'] = ''.join(consensuslist) 62 | 63 | res['consensusscore'] = sum(consensuscount) / (probelen0 * len(probelist)) 64 | # print("indef", consensusprobe) 65 | 66 | res['consensussite'] = 0 67 | 68 | res['consensusdiff'] = (probelen0 * len(probelist)) - sum(consensuscount) 69 | 70 | for nowbp in consensuscount: 71 | 72 | if nowbp == len(probelist): 73 | res['consensussite'] += 1 74 | 75 | return res 76 | -------------------------------------------------------------------------------- /Docker/gui/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM dorowu/ubuntu-desktop-lxde-vnc 2 | 3 | 4 | MAINTAINER Tao Zhang "forrestzhang1982@gmail.com" 5 | 6 | RUN apt-get update && apt-get install -y wget bzip2 7 | 8 | RUN mkdir /opt/download 9 | 10 | ADD https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh /opt/download 11 | 12 | WORKDIR /opt/download 13 | 14 | RUN bash /opt/download/Miniconda3-latest-Linux-x86_64.sh -b -p /opt/conda && \ 15 | rm /opt/download/Miniconda3-latest-Linux-x86_64.sh 16 | 17 | RUN mkdir -p /home/ubuntu/Desktop 18 | 19 | RUN ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \ 20 | echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \ 21 | echo "conda activate base" >> ~/.bashrc && \ 22 | echo ". /opt/conda/etc/profile.d/conda.sh" >> /root/.bashrc && \ 23 | echo "conda activate base" >> /root/.bashrc &&\ 24 | /opt/conda/bin/conda config --add channels defaults && \ 25 | /opt/conda/bin/conda config --add channels conda-forge && \ 26 | /opt/conda/bin/conda config --add channels bioconda && \ 27 | /opt/conda/bin/conda update -y -n base conda && \ 28 | /opt/conda/bin/conda install -y matplotlib pyfasta pysam pyqt jellyfish bwa pandas pip primer3-py git 29 | 30 | # RUN apt-get install -y build-essential git 31 | 32 | # RUN /opt/conda/bin/pip install primer3-py 33 | 34 | ENV PATH $PATH:/opt/conda/bin 35 | RUN mkdir /opt/software 36 | WORKDIR /opt/software 37 | RUN git clone https://github.com/zhangtaolab/Chorus2.git 38 | 39 | RUN echo "/opt/conda/bin/python /opt/software/Chorus2/ChorusGUI.py" > /home/ubuntu/Desktop/ChorusGUI.sh 40 | RUN echo "/opt/conda/bin/python /opt/software/Chorus2/ChorusPBselect.py" > /home/ubuntu/Desktop/ChorusPBselect.sh 41 | RUN chmod +x /home/ubuntu/Desktop/ChorusGUI.sh /home/ubuntu/Desktop/ChorusPBselect.sh 42 | 43 | RUN mkdir /root/Desktop 44 | RUN echo "/opt/conda/bin/python /opt/software/Chorus2/ChorusGUI.py" > /root/Desktop/ChorusGUI.sh 45 | RUN echo "/opt/conda/bin/python /opt/software/Chorus2/ChorusPBselect.py" > /root/Desktop/ChorusPBselect.sh 46 | RUN chmod +x /root/Desktop/ChorusGUI.sh /root/Desktop/ChorusPBselect.sh 47 | 48 | 49 | VOLUME /root/Desktop/Data 50 | ENTRYPOINT ["/startup.sh"] 51 | -------------------------------------------------------------------------------- /docs/_build/locale/install.pot: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2016, Tao Zhang 3 | # This file is distributed under the same license as the Chorus package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: Chorus 1.0\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2016-08-25 11:27-0500\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | 19 | #: ../../install.rst:2 20 | msgid "Install" 21 | msgstr "" 22 | 23 | #: ../../install.rst:5 24 | msgid "Docker" 25 | msgstr "" 26 | 27 | #: ../../install.rst:7 28 | msgid "Install Docker_" 29 | msgstr "" 30 | 31 | #: ../../install.rst:12 32 | msgid "Terminal version" 33 | msgstr "" 34 | 35 | #: ../../install.rst:14 36 | #: ../../install.rst:53 37 | msgid "Download Chorus:" 38 | msgstr "" 39 | 40 | #: ../../install.rst:51 41 | msgid "GUI (Test Version)" 42 | msgstr "" 43 | 44 | #: ../../install.rst:61 45 | msgid "Open your web browse, enter http://localhost:6080" 46 | msgstr "" 47 | 48 | #: ../../install.rst:63 49 | msgid "In your web browse, open a LXTerminal" 50 | msgstr "" 51 | 52 | #: ../../install.rst:72 53 | msgid "Manually Install" 54 | msgstr "" 55 | 56 | #: ../../install.rst:75 57 | msgid "Ubuntu 14.04 (terminal)" 58 | msgstr "" 59 | 60 | #: ../../install.rst:77 61 | #: ../../install.rst:193 62 | msgid "Install dependent package" 63 | msgstr "" 64 | 65 | #: ../../install.rst:101 66 | #: ../../install.rst:221 67 | msgid "Install jellyfish" 68 | msgstr "" 69 | 70 | #: ../../install.rst:120 71 | #: ../../install.rst:240 72 | msgid "Install bwa" 73 | msgstr "" 74 | 75 | #: ../../install.rst:133 76 | #: ../../install.rst:253 77 | msgid "Install primer3-py" 78 | msgstr "" 79 | 80 | #: ../../install.rst:147 81 | msgid "Download Chorus" 82 | msgstr "" 83 | 84 | #: ../../install.rst:191 85 | msgid "Ubuntu 14.04 (GUI) Test Version" 86 | msgstr "" 87 | 88 | #: ../../install.rst:268 89 | msgid "Install Python dependent package" 90 | msgstr "" 91 | 92 | #: ../../install.rst:276 93 | msgid "Download and run Chorus" 94 | msgstr "" 95 | 96 | -------------------------------------------------------------------------------- /docs/locale/zh_CN/LC_MESSAGES/install.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2016, Tao Zhang 3 | # This file is distributed under the same license as the Chorus package. 4 | # FIRST AUTHOR , 2016. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: Chorus 1.0\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2016-08-25 11:27-0500\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=utf-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Generated-By: Babel 1.3\n" 19 | 20 | #: ../../install.rst:2 21 | msgid "Install" 22 | msgstr "安装说明" 23 | 24 | #: ../../install.rst:5 25 | msgid "Docker" 26 | msgstr "" 27 | 28 | #: ../../install.rst:7 29 | msgid "Install Docker_" 30 | msgstr "" 31 | 32 | #: ../../install.rst:12 33 | msgid "Terminal version" 34 | msgstr "" 35 | 36 | #: ../../install.rst:14 ../../install.rst:53 37 | msgid "Download Chorus:" 38 | msgstr "" 39 | 40 | #: ../../install.rst:51 41 | msgid "GUI (Test Version)" 42 | msgstr "" 43 | 44 | #: ../../install.rst:61 45 | msgid "Open your web browse, enter http://localhost:6080" 46 | msgstr "" 47 | 48 | #: ../../install.rst:63 49 | msgid "In your web browse, open a LXTerminal" 50 | msgstr "" 51 | 52 | #: ../../install.rst:72 53 | msgid "Manually Install" 54 | msgstr "" 55 | 56 | #: ../../install.rst:75 57 | msgid "Ubuntu 14.04 (terminal)" 58 | msgstr "" 59 | 60 | #: ../../install.rst:77 ../../install.rst:193 61 | msgid "Install dependent package" 62 | msgstr "" 63 | 64 | #: ../../install.rst:101 ../../install.rst:221 65 | msgid "Install jellyfish" 66 | msgstr "" 67 | 68 | #: ../../install.rst:120 ../../install.rst:240 69 | msgid "Install bwa" 70 | msgstr "" 71 | 72 | #: ../../install.rst:133 ../../install.rst:253 73 | msgid "Install primer3-py" 74 | msgstr "" 75 | 76 | #: ../../install.rst:147 77 | msgid "Download Chorus" 78 | msgstr "" 79 | 80 | #: ../../install.rst:191 81 | msgid "Ubuntu 14.04 (GUI) Test Version" 82 | msgstr "" 83 | 84 | #: ../../install.rst:268 85 | msgid "Install Python dependent package" 86 | msgstr "" 87 | 88 | #: ../../install.rst:276 89 | msgid "Download and run Chorus" 90 | msgstr "" 91 | 92 | -------------------------------------------------------------------------------- /ChorusDraftPrebuild.py: -------------------------------------------------------------------------------- 1 | from pyfasta import Fasta 2 | import sys 3 | import argparse 4 | import os 5 | 6 | 7 | def check_options(parser): 8 | 9 | args = parser.parse_args() 10 | 11 | if args.input: 12 | 13 | if not os.path.exists(args.input): 14 | 15 | print("Can not locate input file, please input input file.\n") 16 | 17 | parser.print_help() 18 | 19 | sys.exit(1) 20 | 21 | return args 22 | 23 | 24 | def get_options(): 25 | 26 | parser = argparse.ArgumentParser(description="Combine short sequence to speed up oligo search", prog="ChorusDraftPrebuild") 27 | 28 | parser.add_argument('--version', action='version', version='%(prog)s 1.0') 29 | 30 | parser.add_argument('-i', '--input', dest='input', help='Fasta format input file contains short sequences', 31 | required=True, type=str) 32 | 33 | parser.add_argument('-o', '--output', dest='output', help='Fasta format output file with combined long sequences for speeding up oligo search. (default: output.fa)', 34 | default='output.fa', type=str) 35 | 36 | return parser 37 | 38 | 39 | def main(): 40 | 41 | args = check_options(get_options()) 42 | 43 | fain = Fasta(args.input) 44 | 45 | faout = open(args.output, 'w') 46 | 47 | minlen = int(1e6) 48 | 49 | print(minlen) 50 | 51 | shortseq = 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN' 52 | 53 | breacker = 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN' 54 | 55 | shortlist = list() 56 | 57 | for chrome in fain.keys(): 58 | 59 | if len(fain[chrome]) < minlen: 60 | # print(chrome, len(fain[chrome])) 61 | # shortseq = shortseq + str(fain[chrome]) + breacker 62 | shortlist.append(chrome) 63 | 64 | else: 65 | print(chrome, len(fain[chrome])) 66 | print('>%s' % chrome, file=faout) 67 | print(fain[chrome], file=faout) 68 | 69 | print('>shortsequences', file=faout) 70 | 71 | for chrome in shortlist: 72 | 73 | print(str(fain[chrome]),shortseq,sep='',end='', file=faout) 74 | 75 | # print(shortseq, file=faout) 76 | 77 | 78 | faout.close() 79 | 80 | 81 | if __name__ == "__main__": 82 | 83 | try: 84 | 85 | main() 86 | 87 | except KeyboardInterrupt: 88 | 89 | sys.stderr.write("User interrupt\n") 90 | 91 | sys.exit(0) 92 | -------------------------------------------------------------------------------- /Choruslib/primer3_filter.py: -------------------------------------------------------------------------------- 1 | import primer3 2 | 3 | 4 | # def primer3_filter(sequence, mintm=0, maxhtm=0, dtm=10): 5 | # 6 | # primer3ft = True 7 | # 8 | # tm = primer3.calcTm(sequence) 9 | # 10 | # htm = primer3.calcHairpinTm(sequence) 11 | # 12 | # if mintm*maxhtm == 0: 13 | # 14 | # if (tm - htm) > dtm: 15 | # 16 | # primer3ft = False 17 | # 18 | # else: 19 | # 20 | # pass 21 | # 22 | # return primer3ft 23 | 24 | def revcom(sequence): 25 | 26 | complement = {'A': 'T', 'C': 'G', 'G': 'C', 'T': 'A'} 27 | 28 | reverse_complement = "".join(complement.get(base, base) for base in reversed(sequence)) 29 | 30 | return reverse_complement 31 | 32 | 33 | def primer3_filter(sequence, mintm=37, maxhtm=35, dtm=10): 34 | 35 | primer3ft = False 36 | 37 | tm = primer3.calcTm(sequence) 38 | 39 | htm = primer3.calcHairpinTm(sequence) 40 | 41 | if tm < mintm: 42 | 43 | primer3ft = True 44 | 45 | if htm > maxhtm: 46 | 47 | primer3ft = True 48 | 49 | if (tm-htm) < dtm: 50 | 51 | primer3ft = True 52 | 53 | # print(sequence, tm, htm, dtm) 54 | 55 | return primer3ft 56 | 57 | 58 | def primer3_filter_withRprimer(sequence, rprimer, mintm=37, maxhtm=35, dtm=10): 59 | 60 | primer3ft = False 61 | 62 | tm = primer3.calcTm(sequence) 63 | 64 | fseq = rprimer + sequence 65 | 66 | htmF = primer3.calcHairpinTm(fseq) 67 | 68 | rseq = rprimer + revcom(sequence) 69 | 70 | htmR = primer3.calcHairpinTm(rseq) 71 | 72 | if tm < mintm: 73 | 74 | primer3ft = True 75 | 76 | if htmF > maxhtm: 77 | 78 | primer3ft = True 79 | 80 | if (tm-htmF) < dtm: 81 | 82 | primer3ft = True 83 | 84 | if htmR > maxhtm: 85 | 86 | primer3ft = True 87 | 88 | if (tm-htmR) < dtm: 89 | 90 | primer3ft = True 91 | # print(sequence, tm, htm, dtm) 92 | 93 | return primer3ft 94 | 95 | 96 | def primer3_cal(sequence, mintm=37, maxhtm=37, dtm=10): 97 | 98 | primer3ft = True 99 | 100 | tm = primer3.calcTm(sequence) 101 | 102 | htm = primer3.calcHairpinTm(sequence) 103 | 104 | if tm < mintm: 105 | 106 | primer3ft = False 107 | 108 | if htm > maxhtm: 109 | 110 | primer3ft = False 111 | 112 | if (tm-htm) > dtm: 113 | 114 | primer3ft = False 115 | 116 | return (sequence, primer3ft) 117 | -------------------------------------------------------------------------------- /ChorusGUI/welcomeGUI.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Dialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 559 10 | 386 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | New Project 29 | 30 | 31 | 32 | 33 | 34 | 35 | Probe Select from Project 36 | 37 | 38 | 39 | 40 | 41 | 42 | Probe Review from Project 43 | 44 | 45 | 46 | 47 | radioButton_review 48 | radioButton_new 49 | verticalSpacer_2 50 | radioButton_select 51 | verticalSpacer 52 | radioButton_new 53 | radioButton_select 54 | radioButton_review 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | Qt::Horizontal 65 | 66 | 67 | 68 | 40 69 | 20 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | OK 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /ChorusGUI/ChorusGUI: -------------------------------------------------------------------------------- 1 | 2 | 3 | Dialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 379 10 | 177 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | New Project 23 | 24 | 25 | 26 | 27 | 28 | 29 | Qt::Vertical 30 | 31 | 32 | 33 | 20 34 | 40 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | Probe Select from Project 43 | 44 | 45 | 46 | 47 | 48 | 49 | Qt::Vertical 50 | 51 | 52 | 53 | 20 54 | 40 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | Probe Review from Project 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | Qt::Horizontal 74 | 75 | 76 | 77 | 40 78 | 20 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | OK 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /ChorusGUI/welcomeGUI.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'welcomeGUI.ui' 4 | # 5 | # Created: Wed Feb 4 09:52:19 2015 6 | # by: PyQt5 UI code generator 5.4 7 | # 8 | # WARNING! All changes made in this file will be lost! 9 | 10 | from PyQt5 import QtCore, QtGui, QtWidgets 11 | 12 | class Ui_Dialog(object): 13 | def setupUi(self, Dialog): 14 | Dialog.setObjectName("Dialog") 15 | Dialog.resize(559, 386) 16 | self.verticalLayout_2 = QtWidgets.QVBoxLayout(Dialog) 17 | self.verticalLayout_2.setObjectName("verticalLayout_2") 18 | self.verticalLayout = QtWidgets.QVBoxLayout() 19 | self.verticalLayout.setObjectName("verticalLayout") 20 | self.groupBox = QtWidgets.QGroupBox(Dialog) 21 | self.groupBox.setTitle("") 22 | self.groupBox.setObjectName("groupBox") 23 | self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.groupBox) 24 | self.verticalLayout_3.setObjectName("verticalLayout_3") 25 | self.radioButton_new = QtWidgets.QRadioButton(self.groupBox) 26 | self.radioButton_new.setObjectName("radioButton_new") 27 | self.verticalLayout_3.addWidget(self.radioButton_new) 28 | self.radioButton_select = QtWidgets.QRadioButton(self.groupBox) 29 | self.radioButton_select.setObjectName("radioButton_select") 30 | self.verticalLayout_3.addWidget(self.radioButton_select) 31 | self.radioButton_review = QtWidgets.QRadioButton(self.groupBox) 32 | self.radioButton_review.setObjectName("radioButton_review") 33 | self.verticalLayout_3.addWidget(self.radioButton_review) 34 | self.verticalLayout.addWidget(self.groupBox) 35 | self.verticalLayout_2.addLayout(self.verticalLayout) 36 | self.horizontalLayout = QtWidgets.QHBoxLayout() 37 | self.horizontalLayout.setObjectName("horizontalLayout") 38 | spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) 39 | self.horizontalLayout.addItem(spacerItem) 40 | self.pushButton_OK = QtWidgets.QPushButton(Dialog) 41 | self.pushButton_OK.setObjectName("pushButton_OK") 42 | self.horizontalLayout.addWidget(self.pushButton_OK) 43 | self.verticalLayout_2.addLayout(self.horizontalLayout) 44 | 45 | self.retranslateUi(Dialog) 46 | QtCore.QMetaObject.connectSlotsByName(Dialog) 47 | 48 | def retranslateUi(self, Dialog): 49 | _translate = QtCore.QCoreApplication.translate 50 | Dialog.setWindowTitle(_translate("Dialog", "Dialog")) 51 | self.radioButton_new.setText(_translate("Dialog", "New Project")) 52 | self.radioButton_select.setText(_translate("Dialog", "Probe Select from Project")) 53 | self.radioButton_review.setText(_translate("Dialog", "Probe Review from Project")) 54 | self.pushButton_OK.setText(_translate("Dialog", "OK")) 55 | 56 | 57 | if __name__ == "__main__": 58 | import sys 59 | app = QtWidgets.QApplication(sys.argv) 60 | Dialog = QtWidgets.QDialog() 61 | ui = Ui_Dialog() 62 | ui.setupUi(Dialog) 63 | Dialog.show() 64 | sys.exit(app.exec_()) 65 | 66 | -------------------------------------------------------------------------------- /docs/_build/html/genindex.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Index — Chorus2 2.0 documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 |
30 | 31 | 32 |
33 | 34 | 35 |

Index

36 | 37 |
38 | 39 |
40 | 41 | 42 |
43 | 44 |
45 |
46 | 92 |
93 |
94 | 102 | 103 | 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /Choruslib/bamdepth.py: -------------------------------------------------------------------------------- 1 | from Choruslib import Baminfo 2 | from Choruslib import subprocesspath 3 | import pysam 4 | 5 | 6 | def continueregion(points, minlength=2): 7 | 8 | try: 9 | 10 | points.sort() 11 | 12 | start_index = 0 13 | 14 | end_index = 0 15 | 16 | continue_region = list() 17 | 18 | for index_now in range(1, len(points)): 19 | 20 | pre_index = index_now - 1 21 | 22 | if points[pre_index] + 1 == points[index_now]: 23 | 24 | if index_now == len(points) - 1: 25 | 26 | if points[index_now] - points[start_index] + 1 >= minlength: 27 | # print (points[start_index], points[index_now]) 28 | region_now = dict() 29 | region_now['start_site'] = points[start_index] 30 | region_now['end_site'] = points[index_now] 31 | continue_region.append(region_now) 32 | 33 | else: 34 | 35 | end_index = index_now 36 | 37 | else: 38 | 39 | if points[end_index] - points[start_index] + 1 >= minlength: 40 | # print (points[start_index], points[end_index]) 41 | region_now = dict() 42 | region_now['start_site'] = points[start_index] 43 | region_now['end_site'] = points[end_index] 44 | continue_region.append(region_now) 45 | 46 | start_index = index_now 47 | 48 | end_index = index_now 49 | 50 | return continue_region 51 | 52 | except Exception as e: 53 | 54 | print(('got exception in Jazzlib.region.continueregion: %r, terminating the pool' % (e,))) 55 | 56 | 57 | 58 | 59 | def bamdepthtobed(bamfile, outbed='mindepth.bed', mindepth=1, minlength=1): 60 | 61 | baminfor = Baminfo.Baminfo(bamfile) 62 | 63 | outio = open(outbed,'w') 64 | 65 | for chrom in baminfor.getchrlen(): 66 | 67 | print(chrom) 68 | 69 | depthstr = pysam.depth('-r', chrom, bamfile) 70 | 71 | depthchr = depthstr.split('\n') 72 | 73 | del depthstr 74 | 75 | points = list() 76 | 77 | for reg in depthchr: 78 | try: 79 | (chrom, site, depthnow) = reg.split('\t') 80 | site = int(site) 81 | depthnow = int(depthnow) 82 | 83 | if depthnow >= mindepth: 84 | points.append(site) 85 | # print(chrom, site, depthnow) 86 | except Exception as e: 87 | print("warnning:", reg) 88 | 89 | 90 | 91 | continue_region = continueregion(points, minlength) 92 | 93 | for nowregion in continue_region: 94 | print(chrom, nowregion['start_site'],nowregion['end_site'], sep='\t', file=outio) 95 | 96 | outio.close() 97 | 98 | # if __name__ == '__main__': 99 | # 100 | # bamdepthtobed(bamfile='/mnt/e/Data/Solanum/Solanum_etuberosum/Solanum_etuberosum_map_to_DM.bam', 101 | # outbed='/mnt/e/Data/Solanum/Solanum_etuberosum/Solanum_etuberosum_map_to_DM_min_depth.bed', 102 | # mindepth=3, 103 | # minlength=150) -------------------------------------------------------------------------------- /docs/_build/html/search.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Search — Chorus2 2.0 documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
33 |
34 |
35 | 36 | 37 |
38 | 39 |

Search

40 |
41 | 42 |

43 | Please activate JavaScript to enable the search 44 | functionality. 45 |

46 |
47 |

48 | Searching for multiple words only shows matches that contain 49 | all words. 50 |

51 |
52 | 53 | 54 | 55 |
56 | 57 |
58 | 59 |
60 | 61 |
62 | 63 |
64 |
65 | 101 |
102 |
103 | 111 | 112 | 113 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /Choruslib/bcftools.py: -------------------------------------------------------------------------------- 1 | from subprocess import Popen, PIPE 2 | from Choruslib import subprocesspath 3 | from Choruslib import revcom 4 | import re 5 | 6 | 7 | class BcfConsensusRuner(): 8 | 9 | def __init__(self, probestr, bcftoolspath, bcffile, sample): 10 | 11 | self.probestr = probestr 12 | 13 | self.bcftoolspath = bcftoolspath 14 | 15 | self.bcffile = bcffile 16 | 17 | self.sample = sample 18 | 19 | def bamtobcf(bcfbin, reffile, bamfile, outbcf): 20 | bcfbin = subprocesspath.subprocesspath(bcfbin) 21 | 22 | reffile = subprocesspath.subprocesspath(reffile) 23 | 24 | bamfile = subprocesspath.subprocesspath(bamfile) 25 | 26 | outbcf = subprocesspath.subprocesspath(outbcf) 27 | 28 | bcfcmd = ' '.join( 29 | [bcfbin,' mpileup -E -d 500 -L 500 -Ou -f', reffile, bamfile, '| ', bcfbin,' call -cv -Ob -o', outbcf]) 30 | 31 | print(bcfcmd) 32 | 33 | bcfrun = Popen(bcfcmd, shell=True) 34 | 35 | bcfrun.communicate() 36 | 37 | bcfidxcmd = ' '.join([bcfbin, ' index', outbcf]) 38 | 39 | print(bcfidxcmd) 40 | 41 | bcfidxrun = Popen(bcfidxcmd, shell=True) 42 | 43 | bcfidxrun.communicate() 44 | 45 | return True 46 | 47 | def probestrtoconsensus(bcfconsensusruner): 48 | 49 | (chrom, start, end, seq, score, strand) = str(bcfconsensusruner.probestr).rstrip().split("\t") 50 | 51 | if strand == '-': 52 | seq = revcom.revcom(seq) 53 | 54 | strand = '+' 55 | 56 | consensusprobe = getconsensus(bcftoolspath=bcfconsensusruner.bcftoolspath, 57 | bcffile=bcfconsensusruner.bcffile, 58 | chrom=chrom, 59 | start=start, 60 | end=end, 61 | seq=seq, 62 | sample=bcfconsensusruner.sample 63 | ) 64 | res = dict() 65 | 66 | res['probestr'] = bcfconsensusruner.probestr 67 | 68 | res['consensusprobe'] = consensusprobe 69 | 70 | return res 71 | 72 | def getconsensus(bcftoolspath, bcffile, chrom, start, end, seq, sample, strand='+'): 73 | """ 74 | get consensus by using bcftools 75 | """ 76 | bcftoolspath = subprocesspath.subprocesspath(bcftoolspath) 77 | bcffile = subprocesspath.subprocesspath(bcffile) 78 | mathlen = len(seq)-10 79 | if mathlen < 10: 80 | mathlen = len(seq) 81 | seqlen = str(mathlen) 82 | pat = re.compile('[ATCG]{' + seqlen + ',}') 83 | if strand == '-': 84 | seq = revcom.revcom(seq) 85 | fastring = '\'>' + chrom + ':' + start + '-' + end + '\\n' + seq + '\'' 86 | bcfcon_command = ' '.join(['echo', fastring, '|' + bcftoolspath + ' consensus -s', sample, bcffile]) 87 | 88 | consensus = 'N'*len(seq) 89 | 90 | try: 91 | p = Popen(bcfcon_command, shell=True, stdin=PIPE, stdout=PIPE) 92 | 93 | for i in p.stdout: 94 | i = i.decode('utf-8').rstrip('\n') 95 | # print(i) 96 | if pat.search(i): 97 | consensus = pat.search(i)[0] 98 | except: 99 | print("warnning: ", bcfcon_command, " ##") 100 | # print('c:',consensus) 101 | return str(consensus) 102 | 103 | 104 | def bcftoolsversion(bcftoolsbin): 105 | """ 106 | 107 | :param bcftoolsbin: bwa bin path 108 | :return: string, version of bcftools 109 | """ 110 | 111 | bcftoolscmd = [bcftoolsbin] 112 | 113 | bcftoolsrun = Popen(bcftoolscmd, stdout=PIPE, stderr=PIPE) 114 | 115 | pat = re.compile('Version') 116 | 117 | version = 'None' 118 | 119 | for i in bcftoolsrun.stderr.readlines(): 120 | 121 | i = i.decode('utf-8').rstrip('\n') 122 | 123 | if re.search(pat, i): 124 | 125 | version = i 126 | 127 | bcftoolsrun.communicate() 128 | 129 | return version -------------------------------------------------------------------------------- /ChorusGUI/run_Chorus.py: -------------------------------------------------------------------------------- 1 | from ChorusGUI.Chorus_setup import Ui_Form 2 | import sys 3 | from PyQt5 import QtWidgets, QtGui, QtCore 4 | import os 5 | import time 6 | 7 | 8 | class ChorusSetup(QtWidgets.QDialog, Ui_Form): 9 | 10 | def __init__(self, parent=None): 11 | 12 | super(ChorusSetup, self).__init__(parent) 13 | 14 | self.setupUi(self) 15 | 16 | # self.progressBar.setVisible(False) 17 | # self.groupBox_pb.setVisible(False) 18 | # self.groupBox_bt.setVisible(False) 19 | self.genomefile = '' 20 | 21 | self.inputfile = '' 22 | 23 | self.pjdir = '' 24 | 25 | self.pushButton_setprojectdir.clicked.connect(self.setProject) 26 | 27 | self.pushButton_setgenomefile.clicked.connect(self.setGenomefile) 28 | 29 | self.pushButton_setinputfile.clicked.connect(self.setInputfile) 30 | 31 | self.pushButton_setgfclient.clicked.connect(self.setgfclient) 32 | 33 | self.pushButton_setgfserver.clicked.connect(self.setgfserver) 34 | 35 | n=100 36 | 37 | self.progressBar.setRange(0, n) 38 | 39 | self.myChorus = StartRun(n=n) 40 | 41 | self.myChorus.notifyProgress.connect(self.onProgress) 42 | 43 | self.pushButton_runchorus.clicked.connect(self.getstart) 44 | 45 | 46 | def getstart(self): 47 | 48 | if self.genomefile and self.inputfile and self.pjdir: 49 | 50 | reply = QtWidgets.QMessageBox.question(self, "Message", 'Are you sure to run Chorus?', QtWidgets.QMessageBox.Yes, QtWidgets.QMessageBox.No) 51 | 52 | if reply == QtWidgets.QMessageBox.Yes: 53 | 54 | self.myChorus.start() 55 | 56 | self.textEdit.clear() 57 | 58 | self.progressBar.setVisible(True) 59 | else: 60 | 61 | QtWidgets.QMessageBox.warning(self, 'Warning', 'Please check your project file(s)', QtWidgets.QMessageBox.Ok) 62 | 63 | def onProgress(self, text, i): 64 | 65 | self.textEdit.insertPlainText(text) 66 | 67 | self.progressBar.setValue(i) 68 | 69 | def setProject(self): 70 | 71 | pjdir = QtWidgets.QFileDialog.getExistingDirectory(self, "Choose Project Directory") 72 | 73 | if pjdir: 74 | 75 | self.pjdir = pjdir 76 | 77 | self.lineEdit_projectdir.setText(self.pjdir) 78 | 79 | def setGenomefile(self): 80 | 81 | genomefile, _ = QtWidgets.QFileDialog.getOpenFileName(self, "Select genome file") 82 | 83 | if genomefile: 84 | 85 | self.genomefile = genomefile 86 | 87 | self.lineEdit_genomefile.setText(self.genomefile) 88 | 89 | def setInputfile(self): 90 | 91 | inputfile, _ = QtWidgets.QFileDialog.getOpenFileName(self, "Select input file") 92 | 93 | if inputfile: 94 | 95 | self.inputfile = inputfile 96 | 97 | self.lineEdit_inputfile.setText(self.inputfile) 98 | 99 | def setgfserver(self): 100 | 101 | gfserverpath, _ = QtWidgets.QFileDialog.getOpenFileName(self, "set blat gfserver") 102 | 103 | if gfserverpath: 104 | 105 | self.gfserverpath = gfserverpath 106 | 107 | self.lineEdit_gfserver.setText(gfserverpath) 108 | 109 | def setgfclient(self): 110 | 111 | gfclientpath, _ = QtWidgets.QFileDialog.getOpenFileName(self, "set blat gfclient") 112 | 113 | if gfclientpath: 114 | 115 | self.gfclientpath = gfclientpath 116 | 117 | self.lineEdit_gfclient.setText(gfclientpath) 118 | 119 | 120 | class StartRun(QtCore.QThread): 121 | 122 | notifyProgress = QtCore.pyqtSignal(str, int) 123 | 124 | def __init__(self, n): 125 | 126 | super(StartRun, self).__init__() 127 | 128 | self.n = n + 1 129 | 130 | print(self.n) 131 | 132 | def run(self): 133 | 134 | for i in range(self.n): 135 | 136 | sometxt = str(i) + "line\n" 137 | 138 | self.notifyProgress.emit(sometxt, i) 139 | 140 | time.sleep(0.1) 141 | 142 | 143 | if __name__ == "__main__": 144 | 145 | app = QtWidgets.QApplication(sys.argv) 146 | 147 | chsetup = ChorusSetup() 148 | 149 | chsetup.show() 150 | 151 | sys.exit(app.exec_()) 152 | -------------------------------------------------------------------------------- /Choruslib/exonerate.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | import sys 3 | import subprocess 4 | import signal 5 | import time 6 | import os 7 | import random 8 | import re 9 | import shlex 10 | 11 | 12 | 13 | def start_exonerate_server(espath, esifile, threadnum=24, exonerateport=10005): 14 | #espath, path of exonerate-server 15 | esifilepath = os.path.dirname(esifile) 16 | os.chdir(esifilepath) 17 | escmd = espath + ' --input ' + esifile + ' --port ' + str(exonerateport) + ' --maxconnections ' + str(threadnum) 18 | 19 | print(escmd) 20 | 21 | p = subprocess.Popen(escmd, shell=True, stderr=subprocess.PIPE) 22 | 23 | return p 24 | 25 | 26 | def stop_exonerate_server(p=None): 27 | 28 | if p is not None: 29 | 30 | os.kill(p.pid, signal.SIGTERM) 31 | 32 | time.sleep(5) 33 | 34 | else: 35 | 36 | pids = [] 37 | 38 | p = subprocess.Popen('ps -A', shell=True, stdout=subprocess.PIPE) 39 | 40 | lines = p.stdout.readlines() 41 | 42 | for line in lines: 43 | 44 | if b'exonerate-server' in line: 45 | 46 | pids.append(int(line.split()[0])) 47 | 48 | for pid in pids: 49 | 50 | os.kill(pid,signal.SIGTERM) 51 | 52 | time.sleep(10) 53 | 54 | 55 | def check_exonerate_server(): 56 | 57 | p = subprocess.Popen('ps -A', shell=True, stdout=subprocess.PIPE) 58 | 59 | lines = p.stdout.readlines() 60 | 61 | for line in lines: 62 | 63 | if 'exonerate-server' in line: 64 | 65 | return True 66 | 67 | return False 68 | 69 | 70 | def exonerate_search_sequence(ep, sequence, exonerateport=10005, minIdentity=75): 71 | #ep, exonerate path 72 | tmpseqfile = str(sequence) + str(random.randint(1, 10000)) + '.fa' 73 | 74 | # tmpseqfiledir = os.path.dirname(tmpseqfile) 75 | 76 | tmpseqfiletr = os.path.join(os.getcwd(), tmpseqfile) 77 | 78 | # print("file:",tmpseqfiletr) 79 | 80 | tmpio = open(tmpseqfiletr, 'w') 81 | 82 | print('>',sequence, sep='', file=tmpio) 83 | 84 | print(sequence, file=tmpio) 85 | 86 | tmpio.close() 87 | 88 | # epcmd = 'exonerate --refine region --model affine:local -s 100 ' + tmpseqfile + ' localhost:'+str(exonerateport) + ' --showalignment no --showcigar no --showvulgar no --ryo \'mapping\\t%ql\\t%tal\\t%pi\\t%ps\\t%s\\n\'' 89 | #https://www.ebi.ac.uk/~guy/exonerate/exonerate.man.html 90 | epcmd = ep+' --refine region --model affine:local -s 100 ' + tmpseqfiletr + ' localhost:'+str(exonerateport) + ' --showalignment no --showcigar no --showvulgar no --ryo \'mapping\\t%ql\t%ei\\n\'' 91 | 92 | num = 0 93 | 94 | p = subprocess.Popen(epcmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) 95 | 96 | # p.wait(timeout=15) 97 | 98 | time.sleep(1) 99 | 100 | for line in p.stdout: 101 | 102 | if b'mapping\t' in line: 103 | 104 | #print(line) 105 | line = line.decode('utf-8') 106 | 107 | line = line.rstrip('\n') 108 | 109 | (mp, qlen, ei) = line.split('\t') 110 | 111 | idt = float(ei)/float(qlen)*100 112 | 113 | # print(idt, minIdentity) 114 | 115 | if idt > minIdentity: 116 | 117 | num +=1 118 | 119 | os.remove(tmpseqfiletr) 120 | 121 | return num 122 | 123 | 124 | def exonerate_search_sequence2(ep, sequencefile, exonerateport=10005, minIdentity=75): 125 | 126 | epcmd = ep+' --refine region --model affine:local -s 100 ' + sequencefile + ' localhost:'+str(exonerateport) + ' --showalignment no --showcigar no --showvulgar no --ryo \'mapping\\t%qi\\t%ql\t%ei\n\'' 127 | 128 | print(epcmd) 129 | 130 | num = 0 131 | 132 | p = subprocess.Popen(epcmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) 133 | 134 | # p.wait(timeout=15) 135 | 136 | time.sleep(1) 137 | 138 | for line in p.stdout: 139 | 140 | if b'mapping\t' in line: 141 | 142 | #print(line) 143 | line = line.decode('utf-8') 144 | 145 | line = line.rstrip('\n') 146 | 147 | (mp, seqname, qlen, ei) = line.split('\t') 148 | 149 | idt = float(ei)/float(qlen)*100 150 | 151 | print(line, idt, minIdentity) 152 | 153 | if idt > minIdentity: 154 | 155 | num +=1 156 | return num 157 | 158 | -------------------------------------------------------------------------------- /docs/_build/html/_static/translations.js: -------------------------------------------------------------------------------- 1 | Documentation.addTranslations({"locale": "zh_Hans_CN", "messages": {"%(filename)s — %(docstitle)s": "%(filename)s — %(docstitle)s", "© Copyright %(copyright)s.": "© \u7248\u6743\u6240\u6709 %(copyright)s.", "© Copyright %(copyright)s.": "© \u7248\u6743\u6240\u6709 %(copyright)s.", ", in ": "\uff0c\u5728", "About these documents": "\u5173\u4e8e\u8fd9\u4e9b\u6587\u6863", "Automatically generated list of changes in version %(version)s": "\u81ea\u52a8\u751f\u6210\u7684 %(version)s \u7248\u672c\u4e2d\u7684\u66f4\u6539\u5217\u8868", "C API changes": "C API \u66f4\u6539", "Changes in Version %(version)s — %(docstitle)s": "\u66f4\u6539\u53d1\u751f\u5728\u7248\u672c %(version)s — %(docstitle)s", "Collapse sidebar": "\u6298\u53e0\u8fb9\u680f", "Complete Table of Contents": "\u5b8c\u6574\u7684\u5185\u5bb9\u8868", "Contents": "\u76ee\u5f55", "Copyright": "\u7248\u6743\u6240\u6709", "Created using Sphinx %(sphinx_version)s.": "\u7531 Sphinx %(sphinx_version)s \u521b\u5efa\u3002", "Expand sidebar": "\u5c55\u5f00\u8fb9\u680f", "From here you can search these documents. Enter your search\n words into the box below and click \"search\". Note that the search\n function will automatically search for all of the words. Pages\n containing fewer words won't appear in the result list.": "\u5728\u8fd9\u513f\uff0c\u4f60\u53ef\u4ee5\u5bf9\u8fd9\u4e9b\u6587\u6863\u8fdb\u884c\u641c\u7d22\u3002\u5411\u641c\u7d22\u6846\u4e2d\u8f93\u5165\u4f60\u6240\u8981\u641c\u7d22\u7684\u5173\u952e\u5b57\u5e76\u70b9\u51fb\u201c\u641c\u7d22\u201d\u3002\u6ce8\u610f\uff1a\u641c\u7d22\u5f15\u64ce\u4f1a\u81ea\u52a8\u641c\u7d22\u6240\u6709\u7684\u5173\u952e\u5b57\u3002\u5c06\u4e0d\u4f1a\u641c\u7d22\u5230\u90e8\u5206\u5173\u952e\u5b57\u7684\u9875\u9762.", "Full index on one page": "\u4e00\u9875\u7684\u5168\u90e8\u7d22\u5f15", "General Index": "\u603b\u76ee\u5f55", "Global Module Index": "\u5168\u5c40\u6a21\u5757\u7d22\u5f15", "Go": "\u8f6c\u5411", "Hide Search Matches": "\u9690\u85cf\u641c\u7d22\u7ed3\u679c", "Index": "\u7d22\u5f15", "Index – %(key)s": "\u7d22\u5f15 – %(key)s", "Index pages by letter": "\u6309\u7167\u5b57\u6bcd\u7684\u7d22\u5f15\u9875", "Indices and tables:": "\u7d22\u5f15\u548c\u8868\u683c\uff1a", "Last updated on %(last_updated)s.": "\u6700\u540e\u66f4\u65b0\u4e8e %(last_updated)s.", "Library changes": "\u5e93\u66f4\u6539", "Navigation": "\u5bfc\u822a", "Next topic": "\u4e0b\u4e00\u4e2a\u4e3b\u9898", "Other changes": "\u5176\u4ed6\u66f4\u6539", "Overview": "\u6982\u8ff0", "Permalink to this definition": "\u6c38\u4e45\u94fe\u63a5\u81f3\u76ee\u6807", "Permalink to this headline": "\u6c38\u4e45\u94fe\u63a5\u81f3\u6807\u9898", "Please activate JavaScript to enable the search\n functionality.": "\u8bf7\u6fc0\u6d3b JavaScript \u4ee5\u5f00\u542f\u641c\u7d22\u529f\u80fd", "Preparing search...": "\u51c6\u5907\u641c\u7d22\u2026\u2026", "Previous topic": "\u4e0a\u4e00\u4e2a\u4e3b\u9898", "Quick search": "\u5feb\u901f\u641c\u7d22", "Search": "\u641c\u7d22", "Search Page": "\u641c\u7d22\u9875\u9762", "Search Results": "\u641c\u7d22\u7ed3\u679c", "Search finished, found %s page(s) matching the search query.": "\u641c\u7d22\u5b8c\u6210\uff0c\u6709 %s \u4e2a\u9875\u9762\u5339\u914d\u3002", "Search within %(docstitle)s": "\u5728 %(docstitle)s \u4e2d\u641c\u7d22", "Searching": "\u641c\u7d22\u4e2d", "Show Source": "\u663e\u793a\u6e90\u4ee3\u7801", "Table Of Contents": "\u5167\u5bb9\u76ee\u5f55", "This Page": "\u672c\u9875", "Welcome! This is": "\u6b22\u8fce\uff01\u8fd9\u662f", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "\u6ca1\u6709\u4efb\u4f55\u6587\u6863\u5339\u914d\u60a8\u7684\u641c\u7d22\u3002\u8bf7\u786e\u4fdd\u4f60\u8f93\u5165\u7684\u8bcd\u62fc\u5199\u6b63\u786e\u5e76\u9009\u62e9\u4e86\u5408\u9002\u7684\u5206\u7c7b\u3002", "all functions, classes, terms": "\u6240\u7684\u51fd\u6570\uff0c\u7c7b\uff0c\u672f\u8bed", "can be huge": "\u53ef\u80fd\u4f1a\u5f88\u591a", "last updated": "\u6700\u540e\u66f4\u65b0\u4e8e", "lists all sections and subsections": "\u5217\u51fa\u6240\u6709\u7684\u7ae0\u8282\u548c\u90e8\u5206", "next chapter": "\u4e0b\u4e00\u7ae0", "previous chapter": "\u4e0a\u4e00\u7ae0", "quick access to all modules": "\u5feb\u901f\u67e5\u770b\u6240\u6709\u7684\u6a21\u5757", "search": "\u641c\u7d22", "search this documentation": "\u641c\u7d22\u6587\u6863", "the documentation for": "\u8fd9\u4efd\u6587\u6863\u662f"}, "plural_expr": "0"}); -------------------------------------------------------------------------------- /docs/_build/html/_static/pygments.css: -------------------------------------------------------------------------------- 1 | .highlight .hll { background-color: #ffffcc } 2 | .highlight { background: #eeffcc; } 3 | .highlight .c { color: #408090; font-style: italic } /* Comment */ 4 | .highlight .err { border: 1px solid #FF0000 } /* Error */ 5 | .highlight .k { color: #007020; font-weight: bold } /* Keyword */ 6 | .highlight .o { color: #666666 } /* Operator */ 7 | .highlight .ch { color: #408090; font-style: italic } /* Comment.Hashbang */ 8 | .highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ 9 | .highlight .cp { color: #007020 } /* Comment.Preproc */ 10 | .highlight .cpf { color: #408090; font-style: italic } /* Comment.PreprocFile */ 11 | .highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ 12 | .highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ 13 | .highlight .gd { color: #A00000 } /* Generic.Deleted */ 14 | .highlight .ge { font-style: italic } /* Generic.Emph */ 15 | .highlight .gr { color: #FF0000 } /* Generic.Error */ 16 | .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ 17 | .highlight .gi { color: #00A000 } /* Generic.Inserted */ 18 | .highlight .go { color: #333333 } /* Generic.Output */ 19 | .highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ 20 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 21 | .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ 22 | .highlight .gt { color: #0044DD } /* Generic.Traceback */ 23 | .highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ 24 | .highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ 25 | .highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ 26 | .highlight .kp { color: #007020 } /* Keyword.Pseudo */ 27 | .highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ 28 | .highlight .kt { color: #902000 } /* Keyword.Type */ 29 | .highlight .m { color: #208050 } /* Literal.Number */ 30 | .highlight .s { color: #4070a0 } /* Literal.String */ 31 | .highlight .na { color: #4070a0 } /* Name.Attribute */ 32 | .highlight .nb { color: #007020 } /* Name.Builtin */ 33 | .highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ 34 | .highlight .no { color: #60add5 } /* Name.Constant */ 35 | .highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ 36 | .highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ 37 | .highlight .ne { color: #007020 } /* Name.Exception */ 38 | .highlight .nf { color: #06287e } /* Name.Function */ 39 | .highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ 40 | .highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ 41 | .highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ 42 | .highlight .nv { color: #bb60d5 } /* Name.Variable */ 43 | .highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ 44 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */ 45 | .highlight .mb { color: #208050 } /* Literal.Number.Bin */ 46 | .highlight .mf { color: #208050 } /* Literal.Number.Float */ 47 | .highlight .mh { color: #208050 } /* Literal.Number.Hex */ 48 | .highlight .mi { color: #208050 } /* Literal.Number.Integer */ 49 | .highlight .mo { color: #208050 } /* Literal.Number.Oct */ 50 | .highlight .sa { color: #4070a0 } /* Literal.String.Affix */ 51 | .highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ 52 | .highlight .sc { color: #4070a0 } /* Literal.String.Char */ 53 | .highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */ 54 | .highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ 55 | .highlight .s2 { color: #4070a0 } /* Literal.String.Double */ 56 | .highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ 57 | .highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ 58 | .highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ 59 | .highlight .sx { color: #c65d09 } /* Literal.String.Other */ 60 | .highlight .sr { color: #235388 } /* Literal.String.Regex */ 61 | .highlight .s1 { color: #4070a0 } /* Literal.String.Single */ 62 | .highlight .ss { color: #517918 } /* Literal.String.Symbol */ 63 | .highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ 64 | .highlight .fm { color: #06287e } /* Name.Function.Magic */ 65 | .highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ 66 | .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ 67 | .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ 68 | .highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */ 69 | .highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /Choruslib/blat.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | import sys 3 | import subprocess 4 | import signal 5 | import time 6 | import os 7 | import shlex 8 | from Choruslib.Blatres import Blatres 9 | 10 | 11 | def start_gfServer(file2bit, gfspath, stepsize=7, blatport=10010): 12 | 13 | ''' 14 | :param file2bit: 15 | :param gfspath: 16 | :param stepsize: 17 | :param blatport: 18 | :return: blat gfserver pid 19 | ''' 20 | 21 | gfserverpath = '"' + os.path.realpath(gfspath) + '"' 22 | 23 | genomefile = os.path.realpath(file2bit) 24 | 25 | genomefilename = os.path.basename(genomefile) 26 | 27 | genomefilepath = os.path.dirname(genomefile) 28 | 29 | blatcmd = gfserverpath + " start 127.0.0.1 "\ 30 | +str(blatport) + " -maxDnaHits=20 -stepSize=" \ 31 | + str(stepsize) + ' ' + genomefilename 32 | blatcmd = shlex.split(blatcmd) 33 | print("start gfServer: ", blatcmd) 34 | 35 | p = subprocess.Popen(blatcmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, 36 | cwd=genomefilepath) 37 | 38 | print(p.pid) 39 | 40 | return p.pid 41 | 42 | 43 | def check_gfServer_running(): 44 | 45 | p = subprocess.Popen('ps -A', shell=True, stdout=subprocess.PIPE) 46 | 47 | lines = p.stdout.readlines() 48 | 49 | for line in lines: 50 | 51 | if 'gfServer' in line: 52 | 53 | return True 54 | 55 | return False 56 | 57 | 58 | def stop_gfServer(p=None): 59 | 60 | if p is not None: 61 | 62 | os.kill(p.pid, signal.SIGTERM) 63 | 64 | time.sleep(5) 65 | 66 | else: 67 | 68 | pids = [] 69 | p = subprocess.Popen('ps -A', shell=True, stdout=subprocess.PIPE) 70 | 71 | lines = p.stdout.readlines() 72 | 73 | for line in lines: 74 | 75 | if b'gfServer' in line: 76 | 77 | pids.append(int(line.split()[0])) 78 | 79 | for pid in pids: 80 | 81 | os.kill(pid,signal.SIGTERM) 82 | 83 | time.sleep(10) 84 | 85 | 86 | def blat_search_sequence(gfcpath, sequence, blatport=10010, minIdentity=75, file2bit='/'): 87 | 88 | gfclientpath = '"'+os.path.realpath(gfcpath)+'"' 89 | 90 | genomepath = os.path.dirname(file2bit) 91 | 92 | # searchcmd = gfclientpath + " -minIdentity="+str(75)+" -nohead 127.0.0.1 "+str(10010)+" " + "." + " /dev/stdin /dev/stdout" 93 | 94 | queryseq = ">%s\n%s" % (sequence, sequence) 95 | 96 | searchcmd = gfclientpath + " -minIdentity="+str(minIdentity)+" -nohead 127.0.0.1 "+str(blatport)+" " + "." + " /dev/stdin /dev/stdout" 97 | 98 | num = 0 99 | 100 | searchcmd = shlex.split(searchcmd) 101 | 102 | # print(searchcmd) 103 | 104 | p = subprocess.Popen(searchcmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, cwd=genomepath) 105 | 106 | p.stdin.write(queryseq.encode('ascii')) 107 | 108 | p.stdin.close() 109 | 110 | for line in p.stdout: 111 | 112 | if line == b"Output is in /dev/stdout\n": 113 | 114 | continue 115 | 116 | num += 1 117 | 118 | return num 119 | 120 | 121 | 122 | 123 | def blat_search(blatpath, sequence, minIdentity, samplename, file2bit='/'): 124 | 125 | pslfile = samplename+'.psl' 126 | 127 | blatcmd = blatpath + ' ' +file2bit + ' ' + sequence + ' ' + " -minIdentity="+str(minIdentity) + ' ' + pslfile 128 | 129 | print("blat", blatcmd) 130 | 131 | p = subprocess.call(blatcmd, shell=True) 132 | 133 | return p 134 | 135 | 136 | def blat_searchpb(gfcpath, sequence, blatport=10010, minIdentity=75, file2bit='/'): 137 | 138 | ''' 139 | :param gfcpath: gfclient path 140 | :param sequence: seqeunce or probe 141 | :param blatport: blat port 142 | :param minIdentity: 143 | :param file2bit: genome 2bit file for blat 144 | :return: blatres class 145 | ''' 146 | 147 | gfclientpath = '"'+os.path.realpath(gfcpath)+'"' 148 | 149 | genomepath = os.path.dirname(file2bit) 150 | 151 | queryseq = ">%s\n%s" % (sequence, sequence) 152 | 153 | searchcmd = gfclientpath + " -minIdentity="+str(minIdentity)+" -nohead 127.0.0.1 "+str(blatport)+" " + "." + " /dev/stdin /dev/stdout" 154 | 155 | num = 0 156 | 157 | searchcmd = shlex.split(searchcmd) 158 | 159 | p = subprocess.Popen(searchcmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, cwd=genomepath) 160 | 161 | p.stdin.write(queryseq.encode('ascii')) 162 | 163 | p.stdin.close() 164 | 165 | blatlines = list() 166 | 167 | for line in p.stdout: 168 | 169 | if line == b"Output is in /dev/stdout\n": 170 | 171 | continue 172 | 173 | else: 174 | 175 | blatlines.append(line.decode("utf-8")) 176 | 177 | blatres = Blatres(seq=sequence, blatlines=blatlines) 178 | 179 | return blatres 180 | 181 | 182 | def build2bit(fato2bitpath, genomefile): 183 | pass -------------------------------------------------------------------------------- /ChorusGUI/newProject.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | NewProject 4 | 5 | 6 | 7 | 0 8 | 0 9 | 449 10 | 368 11 | 12 | 13 | 14 | NewProject 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | BLAT path 23 | 24 | 25 | 26 | 27 | 28 | 29 | Probe length 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | dtm 40 | 41 | 42 | 43 | 44 | 45 | 46 | 30 47 | 48 | 49 | 300 50 | 51 | 52 | 45 53 | 54 | 55 | 56 | 57 | 58 | 59 | 1 60 | 61 | 62 | 128 63 | 64 | 65 | 2 66 | 67 | 68 | 69 | 70 | 71 | 72 | Output dir 73 | 74 | 75 | 76 | 77 | 78 | 79 | Threads/CPU 80 | 81 | 82 | 83 | 84 | 85 | 86 | Probeset 87 | 88 | 89 | 90 | 91 | 92 | 93 | Identity 94 | 95 | 96 | 97 | 98 | 99 | 100 | 1.000000000000000 101 | 102 | 103 | 0.050000000000000 104 | 105 | 106 | 0.750000000000000 107 | 108 | 109 | 110 | 111 | 112 | 113 | Genome file 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | Input file 127 | 128 | 129 | 130 | 131 | 132 | 133 | 1 134 | 135 | 136 | 10 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | Qt::Horizontal 146 | 147 | 148 | 149 | 40 150 | 20 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | Next 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | Project Name 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | -------------------------------------------------------------------------------- /ChorusNGSselect.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import argparse 3 | import os 4 | import pandas as pd 5 | from Choruslib.revcom import revcom 6 | 7 | def main(): 8 | 9 | args = check_options(get_options()) 10 | 11 | 12 | try: 13 | 14 | probe = pd.read_table(args.input,names=("chrom","start","end","sequence","score","strand"), 15 | dtype={"chrom":str,"start":int,"end":int,"sequence":str,"score":int,"strand":str}) 16 | 17 | ftprobe = probe[((probe.score > args.mink) & (probe.score < args.maxk) & ( 18 | probe.score > probe.score.quantile(args.minquantile)) & ( 19 | probe.score < probe.score.quantile(args.maxquantile)))] 20 | 21 | probe = '' 22 | 23 | chromnames = ftprobe.chrom.unique() 24 | 25 | outio = open(args.output, 'w') 26 | 27 | for chrom in chromnames: 28 | 29 | prestart = 0 30 | 31 | strandfr = 1 32 | 33 | for index, row in ftprobe[ftprobe.chrom == chrom].sort_values(by='start').iterrows(): 34 | 35 | nowpbstart = row.start 36 | 37 | if nowpbstart > prestart + args.dis: 38 | 39 | if args.strand == True: 40 | 41 | if strandfr % 2 == 0: 42 | row[5] = '-' 43 | row[3] = revcom(row[3]) 44 | 45 | strandfr += 1 46 | 47 | prestart = nowpbstart 48 | 49 | print(row.chrom, row.start, row.end, row.sequence, row.score, row.strand, sep='\t', file=outio) 50 | 51 | outio.close() 52 | 53 | print("Filtered finished!") 54 | 55 | except: 56 | 57 | print("Probe file format error. Please check your probe file!") 58 | 59 | sys.exit(1) 60 | 61 | 62 | 63 | 64 | 65 | 66 | def check_options(parser): 67 | 68 | args = parser.parse_args() 69 | 70 | if args.input: 71 | 72 | if not os.path.exists(args.input): 73 | 74 | print("Can not locate input file, please input input file.\n") 75 | 76 | parser.print_help() 77 | 78 | sys.exit(1) 79 | 80 | if args.mink > args.maxk: 81 | 82 | print("min k-mer (%s) score greater than max k-mer (%s) score" % (args.mink , args.maxk)) 83 | 84 | parser.print_help() 85 | 86 | sys.exit(1) 87 | 88 | 89 | if args.minquantile > args.maxquantile: 90 | 91 | print("min quantile (%s) greater than max quantile (%s)" % (args.minquantile , args.maxquantile)) 92 | 93 | parser.print_help() 94 | 95 | sys.exit(1) 96 | 97 | if args.minquantile > 1 or args.minquantile < 0: 98 | 99 | print("min quantile error, please check!") 100 | 101 | parser.print_help() 102 | 103 | sys.exit(1) 104 | 105 | if args.maxquantile > 1 or args.maxquantile < 0: 106 | 107 | print("max quantile error, please check!") 108 | 109 | parser.print_help() 110 | 111 | sys.exit(1) 112 | 113 | return args 114 | 115 | 116 | def get_options(): 117 | 118 | parser = argparse.ArgumentParser(description="ChorusNGSselect for Oligo FISH probe selection by NGS k-mer score", prog='ChorusNGSselect', 119 | formatter_class=argparse.RawDescriptionHelpFormatter, 120 | epilog="Example:\n" 121 | " ChorusNGSselect -i ChorusNGSfilter_output.bed -q 0.1 -p 0.9 -d 25 \\ \n" 122 | " -o filtered_output.bed" 123 | ) 124 | 125 | parser.add_argument('--version', action='version', version='%(prog)s 1.0') 126 | 127 | parser.add_argument('-i', '--input', dest='input', help='Input bed format probe file generated by ChorusNGSfilter', 128 | required=True, type=str) 129 | 130 | parser.add_argument('-o', '--output', dest='output', help='Output bed format probe file after k-mer score filter. (Default: filtered_output.bed)', 131 | default='filtered_output.bed', type=str) 132 | 133 | parser.add_argument('-m', '--min', dest='mink', help='Minimum k-mer score, score < min value will be dropped. For example: 900. ' 134 | 'Incompatible with parameter \'-q/-p\' (Default: 0)', default=0, type=int) 135 | 136 | parser.add_argument('-l', '--max', dest='maxk', help='Maximum k-mer score, score > max value will be dropped. For example: 2000. ' 137 | 'Incompatible with parameter \'-q/-p\' (Default: 10000000)', default=10000000, type=int) 138 | 139 | parser.add_argument('-q', '--minquantile', dest='minquantile', type=float, 140 | help='Filter < min%% quantile k-mer score, range from 0 to 1. For example: 0.25 means 25%% quantile. ' 141 | 'Incompatible with parameter \'-m/-l\'. (Default: 0.1)', default=0.1) 142 | 143 | parser.add_argument('-p', '--maxquantile', dest='maxquantile', type=float, 144 | help='Filter > max%% quantile k-mer score, range from 0 to 1. For example: 0.75 means 75%% quantile. ' 145 | 'Incompatible with parameter \'-m/-l\'. (Default: 0.9)', default=0.9) 146 | 147 | parser.add_argument('-bs', '--bothstrand', dest='strand', help='Keep both + and - strand probes. (Default is True)', 148 | action='store_true') 149 | 150 | parser.add_argument('-ss', '--singlestrand', dest='strand', help='Keep only + strand probes. Incompatible with parameter \'-bs/--bothstrand\'', 151 | action='store_false') 152 | 153 | parser.set_defaults(strand=True) 154 | 155 | parser.add_argument('-d', '--distance', dest='dis', help='Minimum distance between two adjacent probes. (Default: 25)', 156 | default=25, type=int) 157 | 158 | return parser 159 | 160 | 161 | if __name__ == "__main__": 162 | 163 | try: 164 | 165 | main() 166 | 167 | except KeyboardInterrupt: 168 | 169 | sys.stderr.write("User interrupt\n") 170 | 171 | sys.exit(0) -------------------------------------------------------------------------------- /ChorusGUI/newProject.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'newProject.ui' 4 | # 5 | # Created: Wed Feb 4 10:37:17 2015 6 | # by: PyQt5 UI code generator 5.4 7 | # 8 | # WARNING! All changes made in this file will be lost! 9 | 10 | from PyQt5 import QtCore, QtGui, QtWidgets 11 | 12 | class Ui_NewProject(object): 13 | def setupUi(self, NewProject): 14 | NewProject.setObjectName("NewProject") 15 | NewProject.resize(449, 368) 16 | self.verticalLayout_2 = QtWidgets.QVBoxLayout(NewProject) 17 | self.verticalLayout_2.setObjectName("verticalLayout_2") 18 | self.gridLayout = QtWidgets.QGridLayout() 19 | self.gridLayout.setObjectName("gridLayout") 20 | self.label_3 = QtWidgets.QLabel(NewProject) 21 | self.label_3.setObjectName("label_3") 22 | self.gridLayout.addWidget(self.label_3, 4, 0, 1, 1) 23 | self.label_4 = QtWidgets.QLabel(NewProject) 24 | self.label_4.setObjectName("label_4") 25 | self.gridLayout.addWidget(self.label_4, 5, 0, 1, 1) 26 | self.lineEdit_blat = QtWidgets.QLineEdit(NewProject) 27 | self.lineEdit_blat.setObjectName("lineEdit_blat") 28 | self.gridLayout.addWidget(self.lineEdit_blat, 4, 1, 1, 1) 29 | self.label_5 = QtWidgets.QLabel(NewProject) 30 | self.label_5.setObjectName("label_5") 31 | self.gridLayout.addWidget(self.label_5, 6, 0, 1, 1) 32 | self.spinBox_pblength = QtWidgets.QSpinBox(NewProject) 33 | self.spinBox_pblength.setMinimum(30) 34 | self.spinBox_pblength.setMaximum(300) 35 | self.spinBox_pblength.setProperty("value", 45) 36 | self.spinBox_pblength.setObjectName("spinBox_pblength") 37 | self.gridLayout.addWidget(self.spinBox_pblength, 5, 1, 1, 1) 38 | self.spinBox_threads = QtWidgets.QSpinBox(NewProject) 39 | self.spinBox_threads.setMinimum(1) 40 | self.spinBox_threads.setMaximum(128) 41 | self.spinBox_threads.setProperty("value", 2) 42 | self.spinBox_threads.setObjectName("spinBox_threads") 43 | self.gridLayout.addWidget(self.spinBox_threads, 8, 1, 1, 1) 44 | self.label_9 = QtWidgets.QLabel(NewProject) 45 | self.label_9.setObjectName("label_9") 46 | self.gridLayout.addWidget(self.label_9, 2, 0, 1, 1) 47 | self.label_7 = QtWidgets.QLabel(NewProject) 48 | self.label_7.setObjectName("label_7") 49 | self.gridLayout.addWidget(self.label_7, 8, 0, 1, 1) 50 | self.lineEdit_prjname = QtWidgets.QLineEdit(NewProject) 51 | self.lineEdit_prjname.setObjectName("lineEdit_prjname") 52 | self.gridLayout.addWidget(self.lineEdit_prjname, 0, 1, 1, 1) 53 | self.label_6 = QtWidgets.QLabel(NewProject) 54 | self.label_6.setObjectName("label_6") 55 | self.gridLayout.addWidget(self.label_6, 7, 0, 1, 1) 56 | self.doubleSpinBox = QtWidgets.QDoubleSpinBox(NewProject) 57 | self.doubleSpinBox.setMaximum(1.0) 58 | self.doubleSpinBox.setSingleStep(0.05) 59 | self.doubleSpinBox.setProperty("value", 0.75) 60 | self.doubleSpinBox.setObjectName("doubleSpinBox") 61 | self.gridLayout.addWidget(self.doubleSpinBox, 7, 1, 1, 1) 62 | self.label_2 = QtWidgets.QLabel(NewProject) 63 | self.label_2.setObjectName("label_2") 64 | self.gridLayout.addWidget(self.label_2, 3, 0, 1, 1) 65 | self.lineEdit_inputfile = QtWidgets.QLineEdit(NewProject) 66 | self.lineEdit_inputfile.setObjectName("lineEdit_inputfile") 67 | self.gridLayout.addWidget(self.lineEdit_inputfile, 1, 1, 1, 1) 68 | self.lineEdit_genome = QtWidgets.QLineEdit(NewProject) 69 | self.lineEdit_genome.setObjectName("lineEdit_genome") 70 | self.gridLayout.addWidget(self.lineEdit_genome, 3, 1, 1, 1) 71 | self.label = QtWidgets.QLabel(NewProject) 72 | self.label.setObjectName("label") 73 | self.gridLayout.addWidget(self.label, 1, 0, 1, 1) 74 | self.spinBox_dtm = QtWidgets.QSpinBox(NewProject) 75 | self.spinBox_dtm.setMinimum(1) 76 | self.spinBox_dtm.setProperty("value", 10) 77 | self.spinBox_dtm.setObjectName("spinBox_dtm") 78 | self.gridLayout.addWidget(self.spinBox_dtm, 6, 1, 1, 1) 79 | self.horizontalLayout = QtWidgets.QHBoxLayout() 80 | self.horizontalLayout.setObjectName("horizontalLayout") 81 | spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) 82 | self.horizontalLayout.addItem(spacerItem) 83 | self.pushButton_close = QtWidgets.QPushButton(NewProject) 84 | self.pushButton_close.setObjectName("pushButton_close") 85 | self.horizontalLayout.addWidget(self.pushButton_close) 86 | self.pushButton_next = QtWidgets.QPushButton(NewProject) 87 | self.pushButton_next.setObjectName("pushButton_next") 88 | self.horizontalLayout.addWidget(self.pushButton_next) 89 | self.gridLayout.addLayout(self.horizontalLayout, 9, 1, 1, 1) 90 | self.label_8 = QtWidgets.QLabel(NewProject) 91 | self.label_8.setObjectName("label_8") 92 | self.gridLayout.addWidget(self.label_8, 0, 0, 1, 1) 93 | self.lineEdit_output = QtWidgets.QLineEdit(NewProject) 94 | self.lineEdit_output.setObjectName("lineEdit_output") 95 | self.gridLayout.addWidget(self.lineEdit_output, 2, 1, 1, 1) 96 | self.verticalLayout_2.addLayout(self.gridLayout) 97 | 98 | self.retranslateUi(NewProject) 99 | QtCore.QMetaObject.connectSlotsByName(NewProject) 100 | 101 | def retranslateUi(self, NewProject): 102 | _translate = QtCore.QCoreApplication.translate 103 | NewProject.setWindowTitle(_translate("NewProject", "NewProject")) 104 | self.label_3.setText(_translate("NewProject", "BLAT path")) 105 | self.label_4.setText(_translate("NewProject", "Probe length")) 106 | self.label_5.setText(_translate("NewProject", "dtm")) 107 | self.label_9.setText(_translate("NewProject", "Output dir")) 108 | self.label_7.setText(_translate("NewProject", "Threads/CPU")) 109 | self.lineEdit_prjname.setText(_translate("NewProject", "Probeset")) 110 | self.label_6.setText(_translate("NewProject", "Identity")) 111 | self.label_2.setText(_translate("NewProject", "Genome file")) 112 | self.label.setText(_translate("NewProject", "Input file")) 113 | self.pushButton_close.setText(_translate("NewProject", "Close")) 114 | self.pushButton_next.setText(_translate("NewProject", "Next")) 115 | self.label_8.setText(_translate("NewProject", "Project Name")) 116 | 117 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Chorus2 2 | Design of genome-scale oligonucleotide-based probes for fluorescence _in situ_ hybridization (FISH) 3 | 4 | [Documentation](https://chorus2.readthedocs.io/en/latest/) 5 | 6 | [![Documentation Status](https://readthedocs.org/projects/chorus2/badge/?version=latest)](http://chorus2.readthedocs.io/en/latest/?badge=latest) 7 | 8 | **Citation** 9 | 10 | Zhang T†*, Liu GQ†, Zhao HN, Braz G.T, Jiang JM\*. [Chorus2: design of genome-scale oligonucleotide-based probes for fluorescence *in situ* hybridization.](https://onlinelibrary.wiley.com/doi/full/10.1111/pbi.13610) ***Plant Biotechnology Journal*** 2021, 19(10):1967-1978 11 | 12 | **Video tutorials** 13 | 14 | [YouTube (EN)](https://www.youtube.com/playlist?list=PLo8q8tqFX5J27OsuKYFpd-gOtl8Qgf70X) 15 | 16 | [bilibili (中文)](https://www.bilibili.com/video/BV1W54y1S7qS/) 17 | 18 | 19 | **Oligo design with Chorus/Chorus2** 20 | - **Wheat**: 21 | - Li GR†, Zhang T†, Yu ZH, Wang HJ, Yang EN, Yang ZJ\*. [An efficient Oligo‐FISH painting system for revealing chromosome rearrangements and polyploidization in Triticeae.](https://onlinelibrary.wiley.com/doi/10.1111/tpj.15081) _**The Plant Journal**_ 2021, 105(4):978-993 22 | - Shi PY, Sun HJ, Liu GQ, Zhang X, Zhou JW, Song RR, Xiao J, Yuan CX, Sun L, Wang ZK, Lou QF, Jiang JM, Wang XE*, Wang HY*. [Chromosome painting reveals inter-chromosomal rearrangements and evolution of subgenome D of wheat](https://onlinelibrary.wiley.com/doi/10.1111/tpj.15926?msockid=0c907a945e1f642f12266c8f5f796508). _**The Plant Journal**_ 2022, 112(1):55-67 23 | - **Rice**: 24 | - Liu XY†, Sun S†, Wu Y, Zhou Y, Gu S.W, Yu H.X, Yi CD, Gu MH, Jiang JM, Liu B, Zhang T\*, Gong ZY\*. [Dual‐color oligo‐FISH can reveal chromosomal variations and evolution in Oryza species.](https://onlinelibrary.wiley.com/doi/abs/10.1111/tpj.14522) _**The Plant Journal**_ 2020, 101:112-121 25 | - Xue C†, Liu GQ†, Sun S, Liu XY, Guo R, Cheng ZK, Yu HX, Gu MH, Liu K, Zhou Y*, Zhang T*, Gong ZY*. [De Novo Centromere Formation in Pericentromeric Region of Rice Chromosome 8.](https://onlinelibrary.wiley.com/doi/epdf/10.1111/tpj.15862) _**The Plant Journal**_ 2022, 111(3):859-871 26 | - You HL, Tang D, Liu HX, Zhou Y, Li YF, Shen Y, Gong ZY, Yu HX, Gu MH, Jinag JM, Zhang T*, Cheng ZK*. [Chromosome ends initiate homologous chromosome pairing during rice meiosis.](https://academic.oup.com/plphys/article-abstract/195/4/2617/7628145) _**Plant Physiology**_ 2024, 195(4):2617–2634 27 | - **Maize**: 28 | - Albert P.S†, Zhang T†, Semrau K, Rouillard JM, Kao YH, Wang CJ, Danilova T.V, Jiang JM, and Birchler J\*. [Whole-chromosome paints in maize reveal rearrangements, nuclear domains, and chromosomal relationships](https://www.pnas.org/content/116/5/1679) _**Proceedings of the National Academy of Sciences of the United States of America**_ 2019, 16(5):1679-1685 29 | - Martins LV†, Yu F†, Zhao HN†, Dennison T, Lauter N, Wang HY, Deng ZH, Thompson A, Semrau K, Rouilard JM, Bichler J, Jiang JM\*. [Meiotic crossovers characterized by haplotype-specific chromosome painting in maize.](https://www.nature.com/articles/s41467-019-12646-z) _**Nature Communications**_ 2019, 10:4604 30 | - **Populus**: 31 | - Xin HY†, Zhang T†, Wu YF, Zhang WL, Zhang PD, Xi ML\*, Jiang JM. [An extraordinarily stable karyotype of the woody Populus species revealed by chromosome painting.](https://onlinelibrary.wiley.com/doi/epdf/10.1111/tpj.14536) _**The Plant Journal**_ 2020, 101:253-264 32 | - Wang ZY, Lei YJ, Liu GQ, Ning Y, Ning YR, Zhang T*, Xi M*. [Male-Specific Sequence in Populus simonii Provides Insights into Gender Determination of Poplar.](https://doi.org/10.3390/f14122385) _**Forests**_ 2023, 14:2385 33 | - Xin H†, Zhang T†, Han Y, Wu YF, Shi JS, Xi ML\*, and Jiang JM. [Chromosome painting and comparative physical mapping of the sex chromosomes in Populus tomentosa and Populus deltoides.](https://link.springer.com/article/10.1007/s00412-018-0664-y) _**Chromosoma**_ 2018, 127(3):313-321 34 | - **Cotton**: 35 | - Yan H, Han JL, Jin SK, Han ZG, Si ZF, Yan SY, Xuan LS, Yu GR, Guan XY, Fang L*, Wang K*, Zhang TZ.* [Post-polyploidization centromere evolution in cotton.](https://doi.org/10.1038/s41588-025-02115-3) _**Nature Genetics**_ 2025, DOI:https://doi.org/10.1038/s41588-025-02115-3 36 | - Liu YL, Wang XY, Wei YY, Liu Z, Lu QW, Liu F, Zhang T\*, Peng RH\*. [Chromosome Painting Based on Bulked Oligonucleotides in Cotton](https://www.frontiersin.org/articles/10.3389/fpls.2020.00802/full) _**Frontier in Plant Science**_ 2020, 11:802 37 | - **Sugarcane**: 38 | - Zhang Q†, Qi YY†, Pan HR†, Tang HB, Wang G, Hua XT, Wang YJ, Lin LY, Li Z, Li YH, Yu F, Yu ZH, Huang YJ, Wang TY, Ma PP, Dou MJ, Sun ZY, Wang YB, Wang HB, Zhang XT, Yao W, Wang YT, Liu XL, Wang MJ, Wang JP, Deng ZH, Xu JS, Yang QH, Liu ZJ, Chen BS, Zhang MQ, Ming R, Zhang JS\*. [Genomic insights into the recent chromosome reduction of autopolyploid sugarcane Saccharum spontaneum](https://www.nature.com/articles/s41588-022-01084-1) _**Nature Genetics**_ 2022, 54:885-896 39 | - Yu ZH, Huang YJ, Yu XK, Deng ZH, Chai J, Liu JR, Gong ZY, Yao W, Zhang JS, Zhang MQ, Yu F* and Jiang JM. (Formation and centromere inactivation of fusion chromosomes in two allotetraploid species from the _Saccharum_ complex)[https://nph.onlinelibrary.wiley.com/doi/10.1111/nph.70369]. _**New Phytologist**_ 2025. https://doi.org/10.1111/nph.70369 40 | - **Potato**, **Tomato**, **Eggplant**, **Tzimbalo** and **Pepper**: 41 | - Braz GT†, He L†, Zhao HN†, Zhang T†, Semrau K, Rouillard JM, Torres GA, Jiang JM\*. [Comparative oligo-FISH mapping: an efficient and powerful methodology to reveal karyotypic and chromosomal evolution.](http://www.genetics.org/content/208/2/513.full.pdf) _**Genetics**_ 2018, 208(2):513-523 42 | - **Cucumber**, **Muskmelon** and other **Cucumis**: 43 | - Han YH†, Zhang T†, Thammapichai P, Weng YQ, and Jiang JM*. [Chromosome-specific painting in Cucumis species using bulked oligonucleotides.](/pdf/2015/Genetics_2015.pdf) _**Genetics**_ 2015, 200(3):771-779 44 | - Zhao QZ, Bai YL, Cheng CY, Yu XQ, Lou QF* and Chen JF*. [Chromosome-specific oligo-painting provides insights into the cytogenetic basis of karyotypic stasis in paleo-allotetraploid _Cucurbita_](https://academic.oup.com/hr/advance-article/doi/10.1093/hr/uhaf179/8193405). _**Horticulture Research**_ 2025. https://doi.org/10.1093/hr/uhaf179 45 | - **Chicken**: 46 | - Huang Z†, Xu ZX†, Bai H†, Huang YJ, Kang N, Ding XT, Liu J, Luo HR, Yang CT, Chen WJ, Guo QX, XUE LZ, ZhangXP, Xu L, Chen ML, Fu HG, Chen YL, Yue ZC, Fukagawa T, Liu SL, Chang GB\*, Xu LH\*. [Evolutionary analysis of a complete chicken genome](https://www.pnas.org/doi/10.1073/pnas.2216641120) _**Proceedings of the National Academy of Sciences of the United States of America**_ 2023, 120(8)e2216641120 47 | 48 | - Switchgrass, Banana and etc ... 49 | 50 | [https://github.com/zhangtaolab/Chorus2](https://github.com/zhangtaolab/Chorus2) 51 | 52 | ![img](/docs/_static/F2.jpg) 53 | ![img](/docs/_static/F1.jpg) 54 | ![img](/docs/_static/F3.jpg) 55 | ![img](/docs/_static/F4.jpg) 56 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/install.txt: -------------------------------------------------------------------------------- 1 | Install 2 | ======= 3 | 4 | Docker 5 | ------ 6 | 7 | Install Docker_ 8 | 9 | .. _Docker: https://docs.docker.com/engine/installation/ 10 | 11 | Terminal version 12 | ***************** 13 | 14 | Download Chorus: 15 | 16 | .. code-block:: bash 17 | 18 | $ docker pull forrestzhang/docker-chorus 19 | 20 | $ docker run -v $PWD:/home/chorus -e CHORUS_USER=$USER -e CHORUS_UID=$UID forrestzhang/docker-chorus -h 21 | 22 | usage: Chorus [-h] [--version] [-j JELLYFISH] [-b BWA] -g GENOME -i INPUT 23 | [-s SAVED] [-p PRIMER] [-t THREADS] [-l LENGTH] 24 | [--homology HOMOLOGY] [-d DTM] [--docker DOCKER] 25 | 26 | Chorus Software for Oligo FISH probe design 27 | 28 | optional arguments: 29 | -h, --help show this help message and exit 30 | --version show program's version number and exit 31 | -j JELLYFISH, --jellyfish JELLYFISH 32 | jellyfish path 33 | -b BWA, --bwa BWA bwa path 34 | -g GENOME, --genome GENOME 35 | fasta format genome file 36 | -i INPUT, --input INPUT 37 | fasta format input file 38 | -s SAVED, --save SAVED 39 | result saved folder 40 | -p PRIMER, --primer PRIMER 41 | 5' labeled R primer 42 | -t THREADS, --threads THREADS 43 | threads number or how may cpu you wanna use 44 | -l LENGTH, --length LENGTH 45 | probe length 46 | --homology HOMOLOGY homology, from 50 to 100 47 | -d DTM, --dtm DTM dTm, from 0 to 37 48 | --docker DOCKER 49 | 50 | GUI (Test Version) 51 | ******************* 52 | 53 | Download Chorus: 54 | 55 | .. code-block:: bash 56 | 57 | $ docker pull forrestzhang/chorus-gui 58 | 59 | $ docker run -i -t -p 6080:6080 -v $PWD:/home/ubuntu/Data forrestzhang/chorus-gui 60 | 61 | Open your web browse, enter http://localhost:6080 62 | 63 | In your web browse, open a LXTerminal 64 | 65 | .. code-block:: bash 66 | 67 | $ python3 /opt/software/Chorus/ChorusGUI.py 68 | 69 | .. image:: _static/docker_GUI.jpg 70 | 71 | Manually Install 72 | ---------------- 73 | 74 | Ubuntu 14.04 (terminal) 75 | *********************** 76 | 77 | Install dependent package 78 | 79 | .. code-block:: bash 80 | 81 | $ apt-get update && apt-get install -y build-essential \ 82 | cython3 \ 83 | zlib1g-dev \ 84 | zlibc \ 85 | openjdk-7-jre \ 86 | git \ 87 | libboost-dev \ 88 | autoconf \ 89 | libncursesw5-dev \ 90 | libncurses5 \ 91 | ncurses-dev \ 92 | libboost-thread-dev \ 93 | python3-pip \ 94 | samtools \ 95 | unzip \ 96 | python \ 97 | curl \ 98 | wget 99 | 100 | 101 | Install jellyfish 102 | 103 | .. code-block:: bash 104 | 105 | $ mkdir /opt/software 106 | 107 | $ cd /opt/software 108 | 109 | $ wget https://github.com/gmarcais/Jellyfish/releases/download/v2.2.3/jellyfish-2.2.3.tar.gz 110 | 111 | $ tar zxvf jellyfish-2.2.3.tar.gz 112 | 113 | $ mv jellyfish-2.2.3 jellyfish 114 | 115 | $ cd jellyfish 116 | 117 | $ ./configure && make && make install 118 | 119 | 120 | Install bwa 121 | 122 | .. code-block:: bash 123 | 124 | $ cd /opt/software 125 | 126 | $ git clone https://github.com/lh3/bwa.git 127 | 128 | $ cd bwa 129 | 130 | $ make 131 | 132 | 133 | Install primer3-py 134 | 135 | .. code-block:: bash 136 | 137 | $ cd /opt/software 138 | 139 | $ wget https://github.com/forrestzhang/primer3-py/archive/unicode.zip 140 | 141 | $ unzip unicode.zip 142 | 143 | $ cd primer3-py-unicode 144 | 145 | $ python3 setup.py install 146 | 147 | Download Chorus 148 | 149 | .. code-block:: bash 150 | 151 | $ cd /opt/software 152 | 153 | $ git clone https://github.com/forrestzhang/Chorus.git 154 | 155 | $ python3 python3 /opt/software/Chorus/Chorus.py -h 156 | 157 | 158 | 159 | usage: Chorus [-h] [--version] [-j JELLYFISH] [-b BWA] -g GENOME -i INPUT 160 | [-s SAVED] [-p PRIMER] [-t THREADS] [-l LENGTH] 161 | [--homology HOMOLOGY] [-d DTM] [--step STEP] [--docker DOCKER] 162 | 163 | Chorus Software for Oligo FISH probe design 164 | 165 | optional arguments: 166 | -h, --help show this help message and exit 167 | --version show program's version number and exit 168 | -j JELLYFISH, --jellyfish JELLYFISH 169 | jellyfish path 170 | -b BWA, --bwa BWA bwa path 171 | -g GENOME, --genome GENOME 172 | fasta format genome file 173 | -i INPUT, --input INPUT 174 | fasta format input file 175 | -s SAVED, --save SAVED 176 | result saved folder 177 | -p PRIMER, --primer PRIMER 178 | 5' labeled R primer 179 | -t THREADS, --threads THREADS 180 | threads number or how may cpu you wanna use 181 | -l LENGTH, --length LENGTH 182 | probe length 183 | --homology HOMOLOGY homology, from 50 to 100 184 | -d DTM, --dtm DTM dTm, from 0 to 37 185 | --step STEP step length, min=1 186 | --docker DOCKER 187 | 188 | 189 | 190 | Ubuntu 14.04 (GUI) Test Version 191 | ******************************** 192 | 193 | Install dependent package 194 | 195 | .. code-block:: bash 196 | 197 | $ apt-get update && apt-get install -y cython3 build-essential \ 198 | zlib1g-dev \ 199 | zlibc \ 200 | git \ 201 | libboost-dev \ 202 | autoconf \ 203 | libncursesw5-dev \ 204 | libncurses5 \ 205 | ncurses-dev \ 206 | libboost-thread-dev \ 207 | python3-pip \ 208 | samtools \ 209 | unzip \ 210 | python \ 211 | curl \ 212 | wget \ 213 | python3-pyqt5 \ 214 | libfreetype6-dev \ 215 | libxft-dev \ 216 | python3-matplotlib 217 | 218 | $ apt-get remove -y python3-matplotlib 219 | 220 | 221 | Install jellyfish 222 | 223 | .. code-block:: bash 224 | 225 | $ mkdir /opt/software 226 | 227 | $ cd /opt/software 228 | 229 | $ wget https://github.com/gmarcais/Jellyfish/releases/download/v2.2.3/jellyfish-2.2.3.tar.gz 230 | 231 | $ tar zxvf jellyfish-2.2.3.tar.gz 232 | 233 | $ mv jellyfish-2.2.3 jellyfish 234 | 235 | $ cd jellyfish 236 | 237 | $ ./configure && make && make install 238 | 239 | 240 | Install bwa 241 | 242 | .. code-block:: bash 243 | 244 | $ cd /opt/software 245 | 246 | $ git clone https://github.com/lh3/bwa.git 247 | 248 | $ cd bwa 249 | 250 | $ make 251 | 252 | 253 | Install primer3-py 254 | 255 | .. code-block:: bash 256 | 257 | $ cd /opt/software 258 | 259 | $ wget https://github.com/forrestzhang/primer3-py/archive/unicode.zip 260 | 261 | $ unzip unicode.zip 262 | 263 | $ cd primer3-py-unicode 264 | 265 | $ python3 setup.py install 266 | 267 | 268 | Install Python dependent package 269 | 270 | .. code-block:: bash 271 | 272 | $ pip3 install numpy pyfasta matplotlib 273 | 274 | $ pip3 install pandas==0.16.2 275 | 276 | Download and run Chorus 277 | 278 | .. code-block:: bash 279 | 280 | $ cd /opt/software 281 | 282 | $ git clone https://github.com/forrestzhang/Chorus.git 283 | 284 | $ python3 /opt/software/Chorus/ChorusGUI.py -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | BUILDDIR = _build 9 | 10 | # Internal variables. 11 | PAPEROPT_a4 = -D latex_paper_size=a4 12 | PAPEROPT_letter = -D latex_paper_size=letter 13 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 14 | # the i18n builder cannot share the environment and doctrees with the others 15 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 16 | 17 | .PHONY: help 18 | help: 19 | @echo "Please use \`make ' where is one of" 20 | @echo " html to make standalone HTML files" 21 | @echo " dirhtml to make HTML files named index.html in directories" 22 | @echo " singlehtml to make a single large HTML file" 23 | @echo " pickle to make pickle files" 24 | @echo " json to make JSON files" 25 | @echo " htmlhelp to make HTML files and a HTML help project" 26 | @echo " qthelp to make HTML files and a qthelp project" 27 | @echo " applehelp to make an Apple Help Book" 28 | @echo " devhelp to make HTML files and a Devhelp project" 29 | @echo " epub to make an epub" 30 | @echo " epub3 to make an epub3" 31 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 32 | @echo " latexpdf to make LaTeX files and run them through pdflatex" 33 | @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" 34 | @echo " text to make text files" 35 | @echo " man to make manual pages" 36 | @echo " texinfo to make Texinfo files" 37 | @echo " info to make Texinfo files and run them through makeinfo" 38 | @echo " gettext to make PO message catalogs" 39 | @echo " changes to make an overview of all changed/added/deprecated items" 40 | @echo " xml to make Docutils-native XML files" 41 | @echo " pseudoxml to make pseudoxml-XML files for display purposes" 42 | @echo " linkcheck to check all external links for integrity" 43 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 44 | @echo " coverage to run coverage check of the documentation (if enabled)" 45 | @echo " dummy to check syntax errors of document sources" 46 | 47 | .PHONY: clean 48 | clean: 49 | rm -rf $(BUILDDIR)/* 50 | 51 | .PHONY: html 52 | html: 53 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 54 | @echo 55 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 56 | 57 | .PHONY: dirhtml 58 | dirhtml: 59 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 60 | @echo 61 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 62 | 63 | .PHONY: singlehtml 64 | singlehtml: 65 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 66 | @echo 67 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 68 | 69 | .PHONY: pickle 70 | pickle: 71 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 72 | @echo 73 | @echo "Build finished; now you can process the pickle files." 74 | 75 | .PHONY: json 76 | json: 77 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 78 | @echo 79 | @echo "Build finished; now you can process the JSON files." 80 | 81 | .PHONY: htmlhelp 82 | htmlhelp: 83 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 84 | @echo 85 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 86 | ".hhp project file in $(BUILDDIR)/htmlhelp." 87 | 88 | .PHONY: qthelp 89 | qthelp: 90 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 91 | @echo 92 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 93 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 94 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Chorus.qhcp" 95 | @echo "To view the help file:" 96 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Chorus.qhc" 97 | 98 | .PHONY: applehelp 99 | applehelp: 100 | $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp 101 | @echo 102 | @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." 103 | @echo "N.B. You won't be able to view it unless you put it in" \ 104 | "~/Library/Documentation/Help or install it in your application" \ 105 | "bundle." 106 | 107 | .PHONY: devhelp 108 | devhelp: 109 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 110 | @echo 111 | @echo "Build finished." 112 | @echo "To view the help file:" 113 | @echo "# mkdir -p $$HOME/.local/share/devhelp/Chorus" 114 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Chorus" 115 | @echo "# devhelp" 116 | 117 | .PHONY: epub 118 | epub: 119 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 120 | @echo 121 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 122 | 123 | .PHONY: epub3 124 | epub3: 125 | $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3 126 | @echo 127 | @echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3." 128 | 129 | .PHONY: latex 130 | latex: 131 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 132 | @echo 133 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 134 | @echo "Run \`make' in that directory to run these through (pdf)latex" \ 135 | "(use \`make latexpdf' here to do that automatically)." 136 | 137 | .PHONY: latexpdf 138 | latexpdf: 139 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 140 | @echo "Running LaTeX files through pdflatex..." 141 | $(MAKE) -C $(BUILDDIR)/latex all-pdf 142 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 143 | 144 | .PHONY: latexpdfja 145 | latexpdfja: 146 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 147 | @echo "Running LaTeX files through platex and dvipdfmx..." 148 | $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja 149 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 150 | 151 | .PHONY: text 152 | text: 153 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 154 | @echo 155 | @echo "Build finished. The text files are in $(BUILDDIR)/text." 156 | 157 | .PHONY: man 158 | man: 159 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 160 | @echo 161 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 162 | 163 | .PHONY: texinfo 164 | texinfo: 165 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 166 | @echo 167 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 168 | @echo "Run \`make' in that directory to run these through makeinfo" \ 169 | "(use \`make info' here to do that automatically)." 170 | 171 | .PHONY: info 172 | info: 173 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 174 | @echo "Running Texinfo files through makeinfo..." 175 | make -C $(BUILDDIR)/texinfo info 176 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." 177 | 178 | .PHONY: gettext 179 | gettext: 180 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale 181 | @echo 182 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." 183 | 184 | .PHONY: changes 185 | changes: 186 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 187 | @echo 188 | @echo "The overview file is in $(BUILDDIR)/changes." 189 | 190 | .PHONY: linkcheck 191 | linkcheck: 192 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 193 | @echo 194 | @echo "Link check complete; look for any errors in the above output " \ 195 | "or in $(BUILDDIR)/linkcheck/output.txt." 196 | 197 | .PHONY: doctest 198 | doctest: 199 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 200 | @echo "Testing of doctests in the sources finished, look at the " \ 201 | "results in $(BUILDDIR)/doctest/output.txt." 202 | 203 | .PHONY: coverage 204 | coverage: 205 | $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage 206 | @echo "Testing of coverage in the sources finished, look at the " \ 207 | "results in $(BUILDDIR)/coverage/python.txt." 208 | 209 | .PHONY: xml 210 | xml: 211 | $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml 212 | @echo 213 | @echo "Build finished. The XML files are in $(BUILDDIR)/xml." 214 | 215 | .PHONY: pseudoxml 216 | pseudoxml: 217 | $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml 218 | @echo 219 | @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." 220 | 221 | .PHONY: dummy 222 | dummy: 223 | $(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy 224 | @echo 225 | @echo "Build finished. Dummy builder generates no files." 226 | -------------------------------------------------------------------------------- /Choruslib/pbsearch.py: -------------------------------------------------------------------------------- 1 | from multiprocessing import Pool 2 | import threading 3 | import sys 4 | import time 5 | import os 6 | import Choruslib.prefilter as prefilter 7 | import Choruslib.primer3_filter as primer3_filter 8 | import Choruslib.loadfa as loadfa 9 | import Choruslib.blat as blat 10 | import random 11 | import Choruslib.exonerate as exonerate 12 | 13 | 14 | def blat_getseqlen(par): 15 | 16 | sequence = par['sequence'] 17 | 18 | blatport = par['blatport'] 19 | 20 | gfcpath = par['gfcpath'] 21 | 22 | pblength = par['pblength'] 23 | 24 | file2bit = par['file2bit'] 25 | 26 | dtm = par['dtm'] 27 | 28 | minIdentity = par['minIdentity'] 29 | 30 | st = 0 31 | 32 | # pblength = 48 33 | 34 | seqlen = len(sequence) - pblength 35 | 36 | print(seqlen, blatport, gfcpath, sequence[0:10]) 37 | 38 | probelist = list() 39 | 40 | while st < seqlen: 41 | 42 | sp = st+pblength 43 | 44 | nowseq = sequence[st:sp] 45 | 46 | st += 5 47 | 48 | if not nowseq: 49 | 50 | continue 51 | 52 | if not prefilter.atcg_filter(nowseq, 7): 53 | 54 | if 0 < blat.blat_search_sequence(gfcpath, sequence=nowseq, blatport=blatport, minIdentity=minIdentity, file2bit=file2bit) < 2: 55 | 56 | if not primer3_filter.primer3_filter(sequence=nowseq, dtm=dtm): 57 | 58 | probelist.append(nowseq) 59 | 60 | st += pblength 61 | 62 | return probelist 63 | 64 | 65 | def blat_pbsearch(fafile, file2bit, gfspath, gfcpath, threadnum, pblength, setpsize, dtm=10, minIdentity=75): 66 | 67 | fa = loadfa.loadfa(fafile) 68 | 69 | fa = fa.replace('n', '') 70 | 71 | fa = fa.replace('N', '') 72 | 73 | windlen = 1000000 # for real 74 | # windlen = 10000 #for test 75 | seqlen = len(fa) 76 | 77 | sptime = int(seqlen/windlen) 78 | 79 | pars = list() 80 | 81 | pt = 0 82 | 83 | chp = int(threadnum/6 - 1/6) + 1 84 | 85 | for por in range(chp): 86 | 87 | blatport = por+10010 88 | 89 | t = threading.Thread(target=blat.start_gfServer, kwargs={'file2bit':file2bit, 'gfspath':gfspath, 'stepsize':setpsize, 'blatport':blatport}) 90 | 91 | t.daemon = True 92 | 93 | t.start() 94 | 95 | print("starting gfServer ... ") 96 | 97 | time.sleep(100) 98 | 99 | for sc in range(sptime+1): 100 | 101 | nowstart = sc * windlen 102 | 103 | nowend = nowstart + windlen + 50 104 | 105 | if nowend > seqlen: 106 | 107 | nowend = seqlen-1 108 | 109 | nowseq = fa[nowstart:nowend] 110 | 111 | 112 | 113 | blatport = 10010 + random.randint(0, chp-1) 114 | 115 | pt = 1 + pt 116 | 117 | par = dict() 118 | 119 | print (nowstart,nowend,blatport) 120 | 121 | par['sequence'] = nowseq 122 | 123 | par['blatport'] = blatport 124 | 125 | par['gfcpath'] = gfcpath 126 | 127 | par['pblength'] = pblength 128 | 129 | par['file2bit'] = file2bit 130 | 131 | par['dtm'] = dtm 132 | 133 | par['minIdentity'] = minIdentity 134 | 135 | pars.append(par) 136 | 137 | par2 = dict() 138 | 139 | blatport = 10010 140 | 141 | nowstart = windlen * sptime 142 | 143 | nowend = seqlen-1 144 | 145 | nowseq = fa[nowstart:nowend] 146 | 147 | par2['sequence'] = nowseq 148 | 149 | par2['blatport'] = blatport 150 | 151 | par2['gfcpath'] = gfcpath 152 | 153 | par2['pblength'] = pblength 154 | 155 | par2['file2bit'] = file2bit 156 | 157 | par2['dtm'] = dtm 158 | 159 | par2['minIdentity'] = minIdentity 160 | 161 | pars.append(par2) 162 | 163 | pool = Pool(threadnum) 164 | 165 | res = pool.map(blat_getseqlen, pars) 166 | 167 | probe = dict() 168 | 169 | for i in res: 170 | 171 | for j in i: 172 | 173 | if j in probe: 174 | 175 | probe[j] = +1 176 | else: 177 | probe[j] = 1 178 | 179 | 180 | blat.stop_gfServer() 181 | 182 | # probecount = Counter 183 | # 184 | # for probeseq in probe: 185 | # 186 | # probecount[probeseq] += 1 187 | 188 | probelist = list() 189 | 190 | for probeseq in probe: 191 | 192 | if probe[probeseq] == 1: 193 | 194 | probelist.append(probeseq) 195 | 196 | return probelist 197 | 198 | 199 | def exonerate_pbsearch(fafile, esifile, espath, ep, threadnum, pblength, setpsize, dtm=10, minIdentity=75, 200 | exonerateport=10005): 201 | 202 | fa = loadfa.loadfa(fafile) 203 | 204 | fa = fa.replace('n', '') 205 | 206 | fa = fa.replace('N', '') 207 | 208 | seqlen = len(fa) 209 | 210 | windlen = 10000 211 | 212 | sptime = int(seqlen/windlen)+1 213 | 214 | pars = list() 215 | 216 | #start exonerate server 217 | 218 | # exonerate.start_exonerate_server(espath=espath, esifile=esifile, threadnum=24, exonerateport=exonerateport) 219 | 220 | time.sleep(10) 221 | 222 | for sc in range(sptime): 223 | 224 | nowstart = sc * windlen 225 | 226 | nowend = nowstart + windlen + 50 227 | 228 | if nowend > seqlen: 229 | 230 | nowend = seqlen-1 231 | 232 | nowseq = fa[nowstart:nowend] 233 | 234 | # print(nowseq) 235 | 236 | par = dict() 237 | 238 | par['sequence'] = nowseq 239 | 240 | par['exonerateport'] = exonerateport 241 | 242 | par['ep'] = ep 243 | 244 | par['minIdentity'] = minIdentity 245 | 246 | par['pblength'] = pblength 247 | 248 | pars.append(par) 249 | 250 | pool = Pool(threadnum) 251 | 252 | res = pool.map(exonerate_getseqlen, pars) 253 | 254 | probe = dict() 255 | 256 | for i in res: 257 | 258 | for j in i: 259 | 260 | if j in probe: 261 | 262 | probe[j] = +1 263 | else: 264 | probe[j] = 1 265 | 266 | 267 | exonerate.stop_exonerate_server() 268 | 269 | 270 | probelist = list() 271 | 272 | print(probe) 273 | 274 | for probeseq in probe: 275 | 276 | if probe[probeseq] == 1: 277 | 278 | probelist.append(probeseq) 279 | 280 | return probelist 281 | 282 | 283 | def exonerate_getseqlen(par): 284 | 285 | sequence = par['sequence'] 286 | 287 | exonerateport = par['exonerateport'] 288 | 289 | ep = par['ep'] 290 | 291 | minIdentity = par['minIdentity'] 292 | 293 | pblength = par['pblength'] 294 | 295 | print(sequence[1:10], exonerateport, ep, minIdentity, pblength) 296 | 297 | st = 0 298 | 299 | # pblength = 48 300 | 301 | seqlen = len(sequence) - pblength 302 | 303 | probelist = list() 304 | 305 | tmpfa = sequence[1:10] + str(random.randint(1, 100)) + str(int(time.time())) + '.fa' 306 | 307 | tmpfaio = open(tmpfa,'w') 308 | 309 | tmpseq = dict() 310 | 311 | while st < seqlen: 312 | 313 | sp = st+pblength 314 | 315 | nowseq = sequence[st:sp] 316 | 317 | st += 5 318 | 319 | # print(nowseq) 320 | 321 | if not nowseq: 322 | 323 | continue 324 | 325 | if not prefilter.atcg_filter(nowseq, 7): 326 | 327 | if nowseq in tmpseq: 328 | 329 | tmpseq[nowseq] += 1 330 | 331 | else: 332 | 333 | tmpseq[nowseq] = 1 334 | 335 | for nowseq in tmpseq: 336 | 337 | if tmpseq[nowseq] == 1: 338 | 339 | print('>',nowseq, sep='', file=tmpfaio) 340 | 341 | print(nowseq, file=tmpfaio) 342 | 343 | tmpfaio.close() 344 | 345 | exonerate.exonerate_search_sequence2(ep=ep, sequencefile=tmpfa, exonerateport=exonerateport, 346 | minIdentity=minIdentity) 347 | return probelist 348 | 349 | if __name__ == "__main__": 350 | 351 | try: 352 | prb = exonerate_pbsearch(fafile='/Users/Forrest/Documents/Project/Chorus/Test/PGSC_DM_v4.03_pseudomolecules_genes_exon_test.fa', 353 | esifile='/Users/Forrest/Documents/Project/Chorus/Test/Gy14.sei', 354 | espath='/opt/local/bin/exonerate-server', ep='/opt/local/bin/exonerate', 355 | setpsize=5, 356 | exonerateport=10005, 357 | threadnum=2, 358 | pblength = 45, dtm=10, minIdentity=75) 359 | 360 | print(prb) 361 | except KeyboardInterrupt: 362 | exonerate.stop_exonerate_server() 363 | sys.stderr.write("User interrupt\n") 364 | 365 | sys.exit(0) -------------------------------------------------------------------------------- /docs/_build/html/_sources/Tutorial.txt: -------------------------------------------------------------------------------- 1 | Tutorial 2 | ======== 3 | 4 | In this tutorial, we will build oligo porbe set for Arabidopsis genome. 5 | 6 | Using Docker Terminal Version 7 | ----------------------------- 8 | 9 | Install 10 | ******* 11 | 12 | Install Docker_ 13 | 14 | .. _Docker: https://docs.docker.com/engine/installation/ 15 | 16 | Download Chorus: 17 | 18 | .. code-block:: bash 19 | 20 | $ docker pull forrestzhang/docker-chorus 21 | 22 | Parameter of Chorus: 23 | 24 | .. code-block:: bash 25 | 26 | -g GENOME, --genome GENOME 27 | fasta format genome file 28 | -i INPUT, --input INPUT 29 | fasta format input file 30 | -s SAVED, --save SAVED 31 | result saved folder 32 | -p PRIMER, --primer PRIMER 33 | 5' labeled R primer 34 | -t THREADS, --threads THREADS 35 | threads number or how may cpu you wanna use 36 | -l LENGTH, --length LENGTH 37 | probe length 38 | --homology HOMOLOGY homology, from 50 to 100 39 | -d DTM, --dtm DTM dTm, from 0 to 37 40 | 41 | Download Reference Genome file: 42 | 43 | .. code-block:: bash 44 | 45 | $ wget https://www.arabidopsis.org/download_files/Genes/TAIR10_genome_release/TAIR10_chromosome_files/TAIR10_chr_all.fas 46 | 47 | $ docker run -v $PWD:/home/chorus -e CHORUS_USER=$USER -e CHORUS_UID=$UID \ 48 | forrestzhang/docker-chorus -i TAIR10_chr_all.fas -g TAIR10_chr_all.fas -t 12 49 | 50 | Please wait unit all precess done. There are some logs: 51 | 52 | .. code-block:: log 53 | 54 | forrest /home/chorus 55 | use local user: forrest 56 | Adding group 'forrest' (GID 1000) ... 57 | Done. 58 | Adding user 'forrest' ... 59 | Adding new user 'forrest' (1000) with group 'forrest' ... 60 | Creating home directory '/home/forrest' ... 61 | Copying files from '/etc/skel' ... 62 | /home/chorus exists 63 | 2.2.3 64 | ######################################## 65 | bwa version: /opt/software/bwa/bwa 0.7.12-r1044 66 | jellyfish version: /opt/software/jellyfish/bin/jellyfish 2.2.3 67 | genome file: TAIR10_chr_all.fas 68 | input file: TAIR10_chr_all.fas 69 | 5' labeled R primer: 70 | result output folder: /home/chorus/probes 71 | threads number: 12 72 | homology: 75 73 | dtm: 10 74 | ######################################## 75 | ... 76 | ... 77 | 14300000 / 14326857 78 | 14310000 / 14326857 79 | 14320000 / 14326857 80 | Job finshed!! 81 | 82 | 83 | When process done: 84 | 85 | .. code-block:: bash 86 | 87 | $ ls -lt probes/ 88 | total 1741428 89 | -rw-r--r-- 1 root root 280927981 Aug 24 17:44 TAIR10_chr_all.fas_all.bed 90 | -rw-r--r-- 1 root root 62050561 Aug 24 17:44 TAIR10_chr_all.fas.bed 91 | -rw-r--r-- 1 root root 94 Aug 24 17:30 TAIR10_chr_all.fas.len 92 | -rw-r--r-- 1 root root 1031512169 Aug 24 17:22 TAIR10_chr_all.fas_tmp_probe.fa 93 | -rw-r--r-- 1 root root 59833928 Aug 24 17:19 TAIR10_chr_all.fas.sa 94 | -rw-r--r-- 1 root root 7535 Aug 24 17:18 TAIR10_chr_all.fas.amb 95 | -rw-r--r-- 1 root root 682 Aug 24 17:18 TAIR10_chr_all.fas.ann 96 | -rw-r--r-- 1 root root 29916939 Aug 24 17:18 TAIR10_chr_all.fas.pac 97 | -rw-r--r-- 1 root root 119667836 Aug 24 17:18 TAIR10_chr_all.fas.bwt 98 | -rw-r--r-- 1 root root 121183059 Aug 24 17:17 TAIR10_chr_all.fas 99 | -rw-r--r-- 1 root root 78102510 Aug 24 17:17 TAIR10_chr_all.fas_17mer.jf 100 | 101 | *TAIR10_chr_all.fas.bed* is the probe file. 102 | 103 | .. code-block:: log 104 | 105 | $ more probes/TAIR10_chr_all.fas.bed 106 | 1 52 96 TCCCTAAATCTTTAAATCCTACATCCATGAATCCCTAAATACCTA 107 | 1 211 255 TTTGAGGTCAATACAAATCCTATTTCTTGTGGTTTTCTTTCCTTC 108 | 1 346 390 CCTTAGGGTTGGTTTATCTCAAGAATCTTATTAATTGTTTGGACT 109 | 1 426 470 TTTGTGGAAATGTTTGTTCTATCAATTTATCTTTTGTGGGAAAAT 110 | 1 496 540 TCTTCGTTGTTGTTACGCTTGTCATCTCATCTCTCAATGATATGG 111 | 1 551 595 TAGCATTTATTCTGAAGTTCTTCTGCTTGATGATTTTATCCTTAG 112 | 113 | There are four columns in a row, first column is chromosome name, second is oligo start site, third is oligo end site, last one is oligo probe sequence. You can use excel or text editor to open this file. 114 | 115 | 116 | Using Manually Install Version 117 | ------------------------------ 118 | 119 | Install 120 | ******* 121 | 122 | * `Manually Install`_ 123 | .. _`Manually Install`: \install.html#ubuntu-14-04-terminal 124 | 125 | Run In Terminal 126 | *************** 127 | 128 | Make a project folder 129 | 130 | .. code-block:: bash 131 | 132 | $ cd ~ 133 | $ mkdir sampleproject 134 | $ cd sampleproject 135 | 136 | Download reference genome 137 | 138 | .. code-block:: bash 139 | 140 | $ wget https://www.arabidopsis.org/download_files/Genes/TAIR10_genome_release/TAIR10_chromosome_files/TAIR10_chr_all.fas 141 | 142 | 143 | Test chorus software 144 | 145 | .. code-block:: bassh 146 | 147 | $ python3 /opt/software/Chorus/Chorus.py -h 148 | 149 | usage: Chorus [-h] [--version] [-j JELLYFISH] [-b BWA] -g GENOME -i INPUT 150 | [-s SAVED] [-p PRIMER] [-t THREADS] [-l LENGTH] 151 | [--homology HOMOLOGY] [-d DTM] [--step STEP] [--docker DOCKER] 152 | 153 | Chorus Software for Oligo FISH probe design 154 | 155 | optional arguments: 156 | -h, --help show this help message and exit 157 | --version show program's version number and exit 158 | -j JELLYFISH, --jellyfish JELLYFISH 159 | jellyfish path 160 | -b BWA, --bwa BWA bwa path 161 | -g GENOME, --genome GENOME 162 | fasta format genome file 163 | -i INPUT, --input INPUT 164 | fasta format input file 165 | -s SAVED, --save SAVED 166 | result saved folder 167 | -p PRIMER, --primer PRIMER 168 | 5' labeled R primer 169 | -t THREADS, --threads THREADS 170 | threads number or how may cpu you wanna use 171 | -l LENGTH, --length LENGTH 172 | probe length 173 | --homology HOMOLOGY homology, from 50 to 100 174 | -d DTM, --dtm DTM dTm, from 0 to 37 175 | --step STEP step length, min=1 176 | --docker DOCKER 177 | 178 | Run chorus software 179 | 180 | .. code-block:: bash 181 | 182 | $ python3 /opt/software/Chorus/Chorus.py -i TAIR10_chr_all.fas -g TAIR10_chr_all.fas -t 12 \ 183 | -j /opt/software/jellyfish/bin/jellyfish -b /opt/software/bwa/bwa -s sample 184 | 185 | When job finish, the oligo probes will output to 'sample' folder 186 | 187 | .. code-block:: bash 188 | 189 | $ cd sample 190 | $ ls -lt * 191 | 192 | total 1741428 193 | -rw-r--r-- 1 root root 280927981 Aug 24 17:44 TAIR10_chr_all.fas_all.bed 194 | -rw-r--r-- 1 root root 62050561 Aug 24 17:44 TAIR10_chr_all.fas.bed 195 | -rw-r--r-- 1 root root 94 Aug 24 17:30 TAIR10_chr_all.fas.len 196 | -rw-r--r-- 1 root root 1031512169 Aug 24 17:22 TAIR10_chr_all.fas_tmp_probe.fa 197 | -rw-r--r-- 1 root root 59833928 Aug 24 17:19 TAIR10_chr_all.fas.sa 198 | -rw-r--r-- 1 root root 7535 Aug 24 17:18 TAIR10_chr_all.fas.amb 199 | -rw-r--r-- 1 root root 682 Aug 24 17:18 TAIR10_chr_all.fas.ann 200 | -rw-r--r-- 1 root root 29916939 Aug 24 17:18 TAIR10_chr_all.fas.pac 201 | -rw-r--r-- 1 root root 119667836 Aug 24 17:18 TAIR10_chr_all.fas.bwt 202 | -rw-r--r-- 1 root root 121183059 Aug 24 17:17 TAIR10_chr_all.fas 203 | -rw-r--r-- 1 root root 78102510 Aug 24 17:17 TAIR10_chr_all.fas_17mer.jf 204 | 205 | *TAIR10_chr_all.fas.bed* is the probe file. 206 | 207 | .. code-block:: log 208 | 209 | $ more probes/TAIR10_chr_all.fas.bed 210 | 1 52 96 TCCCTAAATCTTTAAATCCTACATCCATGAATCCCTAAATACCTA 211 | 1 211 255 TTTGAGGTCAATACAAATCCTATTTCTTGTGGTTTTCTTTCCTTC 212 | 1 346 390 CCTTAGGGTTGGTTTATCTCAAGAATCTTATTAATTGTTTGGACT 213 | 1 426 470 TTTGTGGAAATGTTTGTTCTATCAATTTATCTTTTGTGGGAAAAT 214 | 1 496 540 TCTTCGTTGTTGTTACGCTTGTCATCTCATCTCTCAATGATATGG 215 | 1 551 595 TAGCATTTATTCTGAAGTTCTTCTGCTTGATGATTTTATCCTTAG 216 | 217 | There are four columns in a row, first column is chromosome name, second is oligo start site, third is oligo end site, last one is oligo probe sequence. You can use excel or text editor to open this file. 218 | -------------------------------------------------------------------------------- /docs/_build/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Welcome to Chorus’s documentation! — Chorus2 2.0 documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 |
30 |
31 | 32 | 33 |
34 | 35 | 100 |
101 |

Indices and tables

102 | 110 |
111 | 112 | 113 |
114 | 115 |
116 |
117 | 164 |
165 |
166 | 177 | 178 | 179 | 180 | 181 | 182 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | REM Command file for Sphinx documentation 4 | 5 | if "%SPHINXBUILD%" == "" ( 6 | set SPHINXBUILD=sphinx-build 7 | ) 8 | set BUILDDIR=_build 9 | set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . 10 | set I18NSPHINXOPTS=%SPHINXOPTS% . 11 | if NOT "%PAPER%" == "" ( 12 | set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% 13 | set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% 14 | ) 15 | 16 | if "%1" == "" goto help 17 | 18 | if "%1" == "help" ( 19 | :help 20 | echo.Please use `make ^` where ^ is one of 21 | echo. html to make standalone HTML files 22 | echo. dirhtml to make HTML files named index.html in directories 23 | echo. singlehtml to make a single large HTML file 24 | echo. pickle to make pickle files 25 | echo. json to make JSON files 26 | echo. htmlhelp to make HTML files and a HTML help project 27 | echo. qthelp to make HTML files and a qthelp project 28 | echo. devhelp to make HTML files and a Devhelp project 29 | echo. epub to make an epub 30 | echo. epub3 to make an epub3 31 | echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter 32 | echo. text to make text files 33 | echo. man to make manual pages 34 | echo. texinfo to make Texinfo files 35 | echo. gettext to make PO message catalogs 36 | echo. changes to make an overview over all changed/added/deprecated items 37 | echo. xml to make Docutils-native XML files 38 | echo. pseudoxml to make pseudoxml-XML files for display purposes 39 | echo. linkcheck to check all external links for integrity 40 | echo. doctest to run all doctests embedded in the documentation if enabled 41 | echo. coverage to run coverage check of the documentation if enabled 42 | echo. dummy to check syntax errors of document sources 43 | goto end 44 | ) 45 | 46 | if "%1" == "clean" ( 47 | for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i 48 | del /q /s %BUILDDIR%\* 49 | goto end 50 | ) 51 | 52 | 53 | REM Check if sphinx-build is available and fallback to Python version if any 54 | %SPHINXBUILD% 1>NUL 2>NUL 55 | if errorlevel 9009 goto sphinx_python 56 | goto sphinx_ok 57 | 58 | :sphinx_python 59 | 60 | set SPHINXBUILD=python -m sphinx.__init__ 61 | %SPHINXBUILD% 2> nul 62 | if errorlevel 9009 ( 63 | echo. 64 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 65 | echo.installed, then set the SPHINXBUILD environment variable to point 66 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 67 | echo.may add the Sphinx directory to PATH. 68 | echo. 69 | echo.If you don't have Sphinx installed, grab it from 70 | echo.http://sphinx-doc.org/ 71 | exit /b 1 72 | ) 73 | 74 | :sphinx_ok 75 | 76 | 77 | if "%1" == "html" ( 78 | %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html 79 | if errorlevel 1 exit /b 1 80 | echo. 81 | echo.Build finished. The HTML pages are in %BUILDDIR%/html. 82 | goto end 83 | ) 84 | 85 | if "%1" == "dirhtml" ( 86 | %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml 87 | if errorlevel 1 exit /b 1 88 | echo. 89 | echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. 90 | goto end 91 | ) 92 | 93 | if "%1" == "singlehtml" ( 94 | %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml 95 | if errorlevel 1 exit /b 1 96 | echo. 97 | echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. 98 | goto end 99 | ) 100 | 101 | if "%1" == "pickle" ( 102 | %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle 103 | if errorlevel 1 exit /b 1 104 | echo. 105 | echo.Build finished; now you can process the pickle files. 106 | goto end 107 | ) 108 | 109 | if "%1" == "json" ( 110 | %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json 111 | if errorlevel 1 exit /b 1 112 | echo. 113 | echo.Build finished; now you can process the JSON files. 114 | goto end 115 | ) 116 | 117 | if "%1" == "htmlhelp" ( 118 | %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp 119 | if errorlevel 1 exit /b 1 120 | echo. 121 | echo.Build finished; now you can run HTML Help Workshop with the ^ 122 | .hhp project file in %BUILDDIR%/htmlhelp. 123 | goto end 124 | ) 125 | 126 | if "%1" == "qthelp" ( 127 | %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp 128 | if errorlevel 1 exit /b 1 129 | echo. 130 | echo.Build finished; now you can run "qcollectiongenerator" with the ^ 131 | .qhcp project file in %BUILDDIR%/qthelp, like this: 132 | echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Chorus.qhcp 133 | echo.To view the help file: 134 | echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Chorus.ghc 135 | goto end 136 | ) 137 | 138 | if "%1" == "devhelp" ( 139 | %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp 140 | if errorlevel 1 exit /b 1 141 | echo. 142 | echo.Build finished. 143 | goto end 144 | ) 145 | 146 | if "%1" == "epub" ( 147 | %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub 148 | if errorlevel 1 exit /b 1 149 | echo. 150 | echo.Build finished. The epub file is in %BUILDDIR%/epub. 151 | goto end 152 | ) 153 | 154 | if "%1" == "epub3" ( 155 | %SPHINXBUILD% -b epub3 %ALLSPHINXOPTS% %BUILDDIR%/epub3 156 | if errorlevel 1 exit /b 1 157 | echo. 158 | echo.Build finished. The epub3 file is in %BUILDDIR%/epub3. 159 | goto end 160 | ) 161 | 162 | if "%1" == "latex" ( 163 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 164 | if errorlevel 1 exit /b 1 165 | echo. 166 | echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. 167 | goto end 168 | ) 169 | 170 | if "%1" == "latexpdf" ( 171 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 172 | cd %BUILDDIR%/latex 173 | make all-pdf 174 | cd %~dp0 175 | echo. 176 | echo.Build finished; the PDF files are in %BUILDDIR%/latex. 177 | goto end 178 | ) 179 | 180 | if "%1" == "latexpdfja" ( 181 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 182 | cd %BUILDDIR%/latex 183 | make all-pdf-ja 184 | cd %~dp0 185 | echo. 186 | echo.Build finished; the PDF files are in %BUILDDIR%/latex. 187 | goto end 188 | ) 189 | 190 | if "%1" == "text" ( 191 | %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text 192 | if errorlevel 1 exit /b 1 193 | echo. 194 | echo.Build finished. The text files are in %BUILDDIR%/text. 195 | goto end 196 | ) 197 | 198 | if "%1" == "man" ( 199 | %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man 200 | if errorlevel 1 exit /b 1 201 | echo. 202 | echo.Build finished. The manual pages are in %BUILDDIR%/man. 203 | goto end 204 | ) 205 | 206 | if "%1" == "texinfo" ( 207 | %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo 208 | if errorlevel 1 exit /b 1 209 | echo. 210 | echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. 211 | goto end 212 | ) 213 | 214 | if "%1" == "gettext" ( 215 | %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale 216 | if errorlevel 1 exit /b 1 217 | echo. 218 | echo.Build finished. The message catalogs are in %BUILDDIR%/locale. 219 | goto end 220 | ) 221 | 222 | if "%1" == "changes" ( 223 | %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes 224 | if errorlevel 1 exit /b 1 225 | echo. 226 | echo.The overview file is in %BUILDDIR%/changes. 227 | goto end 228 | ) 229 | 230 | if "%1" == "linkcheck" ( 231 | %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck 232 | if errorlevel 1 exit /b 1 233 | echo. 234 | echo.Link check complete; look for any errors in the above output ^ 235 | or in %BUILDDIR%/linkcheck/output.txt. 236 | goto end 237 | ) 238 | 239 | if "%1" == "doctest" ( 240 | %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest 241 | if errorlevel 1 exit /b 1 242 | echo. 243 | echo.Testing of doctests in the sources finished, look at the ^ 244 | results in %BUILDDIR%/doctest/output.txt. 245 | goto end 246 | ) 247 | 248 | if "%1" == "coverage" ( 249 | %SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage 250 | if errorlevel 1 exit /b 1 251 | echo. 252 | echo.Testing of coverage in the sources finished, look at the ^ 253 | results in %BUILDDIR%/coverage/python.txt. 254 | goto end 255 | ) 256 | 257 | if "%1" == "xml" ( 258 | %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml 259 | if errorlevel 1 exit /b 1 260 | echo. 261 | echo.Build finished. The XML files are in %BUILDDIR%/xml. 262 | goto end 263 | ) 264 | 265 | if "%1" == "pseudoxml" ( 266 | %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml 267 | if errorlevel 1 exit /b 1 268 | echo. 269 | echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. 270 | goto end 271 | ) 272 | 273 | if "%1" == "dummy" ( 274 | %SPHINXBUILD% -b dummy %ALLSPHINXOPTS% %BUILDDIR%/dummy 275 | if errorlevel 1 exit /b 1 276 | echo. 277 | echo.Build finished. Dummy builder generates no files. 278 | goto end 279 | ) 280 | 281 | :end 282 | -------------------------------------------------------------------------------- /docs/_build/html/searchindex.js: -------------------------------------------------------------------------------- 1 | Search.setIndex({docnames:["functions","index","install","tutorial","videos"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,sphinx:56},filenames:["functions.rst","index.rst","install.rst","tutorial.rst","videos.rst"],objects:{},objnames:{},objtypes:{},terms:{"0ch00":3,"0ch01":3,"0ch06":3,"0ch07":3,"0ch10":3,"104m":3,"62m":3,"\u4f7f\u7528\u56fe\u5f62\u754c\u9762\u7b5b\u9009\u5df2\u8bbe\u8ba1\u7684\u63a2\u9488":4,"\u4f7f\u7528\u56fe\u5f62\u754c\u9762\u8fd0\u884cchorus2":4,"\u4f7f\u7528bioconda\u5728linux\u4e2d\u5b89\u88c5chorus2\u8f6f\u4ef6":4,"\u4f7f\u7528bioconda\u5b89\u88c5chorus2\u8f6f\u4ef6":4,"\u4f7f\u7528chorus2\u8bbe\u8ba1oligo":4,"\u4f7f\u7528chorushomo\u8bbe\u8ba1\u8fd1\u6e90\u7269\u79cd\u53ef\u7528\u63a2\u9488":4,"\u5229\u7528\u4e8c\u4ee3\u57fa\u56e0\u7ec4\u6d4b\u5e8f\u6570\u636e\u8fc7\u6ee4\u6f5c\u5728\u91cd\u590d\u5e8f\u5217":4,"\u5b89\u88c5anaconda":4,"\u5b89\u88c5windows\u5b50\u7cfb\u7edf":4,"\u89c6\u9891\u5217\u8868":4,"default":[0,2,3],"final":3,"fish\u63a2\u9488":4,"function":1,"import":3,"long":0,"new":3,"short":0,"true":0,Adding:3,DIS:0,For:[0,1,3],LTS:2,NGS:[0,3,4],The:[0,2,3],There:3,Use:1,aaaccctaaaccctaaacctctgaatccttaatccctaaatccct:3,aaatgatttgctcttgactgtacgtatgcctgccgtcttcgttga:3,aagcagatatatcgttcatcatactttatttacatggggaaacaa:3,aatactattagatgatgactaagagtaatgctagtgtatataaat:3,aatccctaaatccctaaatctttaaatcctacatccatgaatccc:3,acagccaaatcgtcccatattcaaggataaacgacccacgaatca:3,access:3,actggaagtaatattttgtcacaggaataattcggtaaatctgag:3,activ:2,add:2,adjac:0,after:[0,2,3],agatttaacccattttcatggcgcttttgtaatttcaagactttg:3,agatttagcccattttcatggcgcttttgtgatttcaagactttg:3,agatttagctcattttcatggcgattttgtgatttcaagactttg:3,agattttgcccattctcatgacgcttttgtgatttcaaaactttg:3,aggatgaaaccgtattccaaccttgcttttcctttattgattaat:3,aggtcaatacaaatcctatttcttgtggttttctttccttcactt:3,agttgtttggattttgtgaagagagcagtaaactttatggtgtaaataaaaga:3,align:0,all:[0,3],amb:3,among:3,anaconda3:2,anaconda:4,ann:3,app:2,apt:2,arabidopsi:3,archiv:2,argument:[0,2,3],assembl:3,ataacaaatgaagataaaccatccatagctaagtgaaggaaagaa:3,atccttaatccctaaatccctaaatctttaaatcctacatccatg:3,atctatatctactacaccagaatattcatacacaaataaattact:3,attttccatggacctcattaagattagctattgaaccagttaccc:3,aug:3,autoconf:2,automat:3,base:3,bcftool:[0,2],bed:[0,3],befor:3,between:[0,2,3],bigwig:3,bilibili:1,bin:[0,2,3],binari:3,bioconda:2,both:0,bothstrand:0,brows:2,bshyqovpasc:4,build:[2,3],build_3:3,bv1w54y1s7q:[3,4],bwa:[0,2,3],bwt:3,calcul:[0,2,3],can:[0,2,3],candid:3,cctcaagcttacctacaattagcataggcagagttacaagtggaa:3,ccttagggttggtttatctcaagaatcttattaattgtttggact:3,cgggtttagggaattaggtatttagggattcatggatgtaggatt:3,cgtggtcgcgtctca:[0,2,3],chang:3,channel:2,check:3,choru:[0,2,3],chorus2:[1,4],chorus_uid:[2,3],chorus_us:[2,3],chorusdraftprebuild:1,chorusgui:[1,2,3,4],chorushomo:[1,4],chorusngsfilt:[1,3],chorusngsfilter_output:0,chorusngsselect:[1,3],chorusnoref:1,choruspbgui:[1,3,4],chr00:3,chr01:3,chrom:3,chromosom:[0,2,3],click:3,clone:2,close:[0,1,4],cns:3,column:3,com:[2,3,4],combin:0,command:2,compar:3,comput:2,conda:[2,4],config:2,configur:2,conflict:0,consensu:3,consensusdiff:3,consensusprob:3,consensusscor:3,consensussit:3,conserv:[3,4],contain:[0,3],content:1,control:2,conveni:0,copi:3,count:[0,3],cover:0,cpu:[0,2,3],creat:[2,3],csv:3,ctaaacctctgaatccttaatccctaaatccctaaatctttaaat:3,cttagggttggtttatctcaagaatcttattaattgtttggactg:3,ctttatatacactagcattactcttagtcatcatctaatattaat:3,ctttatatacactagcattactcttagtcatcatctaatattatt:3,ctttatatacactagcattactcttagtcatcatctaatattgct:3,curl:2,cython3:2,data:[0,2,3,4],depth:0,descript:1,design:[0,1,2,4],desktop:2,detect:3,dev:2,differ:3,directli:3,directori:3,distanc:0,dm404:3,docker:[0,1],done:3,download:[2,3],download_fil:3,drop:0,drwxrwxr:3,dtm:[0,2,3],each:3,easili:3,ebi:3,editor:3,edu:3,end:3,enter:2,essenti:2,etc:3,etuberosum:3,etuberosum_indel_prob:3,etuberosum_jamesii_cns_prob:3,etuberosum_prob:3,exampl:[0,2,3],excel:3,exist:3,exit:[2,3],experi:3,f1rqsri3r98:4,fas:[0,2,3],fas_17mer:3,fas_al:3,fas_tmp_prob:3,fasta:[0,2,3],fasta_al:3,fasta_km:3,fasta_kmerfilt:3,fastq:[0,3],featur:2,fifth:3,file:[0,2,3],filter:[0,3,4],filtered_output:0,find:[0,4],finish:3,finsh:3,first:3,fish:[0,2,3],fold:0,folder:[0,2,3],fomula:3,forg:2,format:[0,2,3],forrest:3,forrestzhang:[2,3],found:3,four:3,friendli:0,from:[0,2,3],ftp:3,further:3,gaatgatgagtcaatctgataattcatagaatcaaatttgtatga:3,gagtgatgagtcaatccataaaggcacctgataattcatagaatcaaatttgtatta:3,gene:3,gener:[0,3],genom:[0,1,2],genomea:[0,3],genomea_chr:3,genomea_end:3,genomea_ident:3,genomea_start:3,genomeb:[0,3],genomeb_chr:3,genomeb_end:3,genomeb_ident:3,genomeb_start:3,get:2,gid:3,git:2,github:2,given:[0,2,3],gmarcai:2,gotl8qgf70x:[3,4],group:3,gui:[0,1],gzip:0,hairpin:[0,2,3],have:3,head:3,help:[2,3],here:3,high:3,home:[2,3],homo:3,homolog:[0,2,3],how:[2,3],http:[2,3,4],hybrid:[0,2,3],ident:3,illumina:[0,3],includ:[0,2,3],incompat:0,indel:3,index:[0,1,3],info:3,infom:3,initi:2,input:[0,2,3],instal:[0,1,4],its:3,jamesii:3,jamesii_indel_prob:3,jamesii_prob:3,jellyfish:[0,2,3],jellyfishfil:0,jfile:0,jiang:1,jime:1,job:3,jre:2,keep:0,kmer:[0,3],kxsnjfjjli4:4,lab:1,label:[0,2,3],last:3,launch:2,least:3,len:3,length:[0,2,3],lh3:2,libboost:2,libncurses5:2,libncursesw5:2,librari:3,line:[2,3],linux:[1,4],list:[3,4],liu:3,local:3,localhost:2,locat:3,log:3,long_sequ:0,longer:[0,2,3],look:3,lxtermin:2,maco:1,macosx:2,mai:2,major:1,make:[2,3],mani:3,manual:1,max:0,maximum:[0,2,3],maxk:0,maxquantil:0,mean:[0,3],memori:3,mer:[0,2,3],messag:[2,3],method:3,microsoft:2,min:0,mindepth:0,minimum:[0,2,3],mink:0,minkmer:0,minquantil:0,miscellan:1,mkdir:[2,3],modul:1,more:[0,3],msu:3,multipl:0,must:0,mxtlqmoy2z0:4,mzzwto6cjp:4,name:[0,3],ncurs:2,net:3,non:3,none:[0,2,3],norefprob:3,number:[0,2,3],off:2,oligo:[0,1,2,4],one:[0,2,3],onli:[0,2,3],open:[2,3],openjdk:2,opt:[0,2,3],option:[2,3],order:0,org:[1,3],origin:0,output:[0,2,3],overlap:3,own:3,pac:3,page:1,panel:2,paramet:3,path:[0,2,3],pcr:[0,2,3],per:3,perform:3,pip:2,plant:1,plantbiolog:3,playlist:[1,4],pleas:3,plo8q8tqfx5j27osukyfpd:[3,4],ploidi:[0,2,3],potato:3,potato_dm_v404_all_pm_un:3,prebuild:0,precess:3,primer3:2,primer:[0,2,3],probe:[0,1,2,4],probe_seq:3,process:[0,3],program:[2,3],project:3,pull:2,put:3,pwd:[2,3],python3:2,python:2,qp0jvztflfq:4,qualiti:3,quantil:0,r1044:3,rang:[0,2,3],rdfq54xfjeq:4,reaction:[0,2,3],read1:0,read:[0,3],reads1:0,reads2:0,reboot:2,refer:[0,1],refseq:3,region:[0,2,3],relat:[0,1,4],related_genom:0,releas:2,repeat:3,repetit:[3,4],repo:2,requir:[2,3],requirements_gui:2,respect:3,result:[0,2,3],root:[2,3],row:3,run:[1,2,4],s_lycopersicum_chromosom:3,safer:3,same:[0,3],sampl:[0,2,3],sampleproject:3,samtool:[0,2],save:[0,2,3],score:[0,3],search:[0,1,2,3],second:3,see:3,select:[0,3],selet:0,separ:0,sequenc:[0,2,3,4],set:3,setup:2,short_sequ:0,shotgun:[0,3],should:[0,2,3],show:[2,3],singlestrand:0,site:3,six:3,skel:3,skip:[0,2,3],skipdtm:[0,2,3],sl3:3,slide:[0,2,3],smaller:3,snp:3,softwar:[0,3],solanacea:3,solgenom:3,some:3,sourc:[0,3],source_genom:0,speci:[0,1,4],species1:0,species1_r1:0,species1_r2:0,species2:0,species2_r1:0,species2_r2:0,species_r1:0,species_r2:0,specif:[0,2,3],speed:0,sra:3,srr5349573:3,srr5349573_1:3,srr5349573_2:3,srr5349574:3,srr5349574_1:3,srr5349574_2:3,srr5349606:3,srr5349606_1:3,srr5349606_2:3,srr534:3,srr5658649:3,srr5658649_1:3,srr5658649_2:3,srr565:3,start:3,step:[0,2,3],store:2,strand:[0,3],sudo:2,suitabl:3,synthes:3,taaaccctaaacctctgaatccttaatccctaaatccctaaatct:3,taaatccctaaatctttaaatcctacatccatgaatccctaaata:3,tagcatttattctgaagttcttctgcttgatgattttatccttag:3,tair10_chr_al:[0,2,3],tair10_chr_all_srr5658649:3,tair10_chr_all_srr5658649_filt:3,tair10_chromosome_fil:3,tair10_genome_releas:3,taozhang:1,tar:2,target:[0,2,3],target_genom:0,tcaacactagcgaatcaagaacccttccatcctagacaactataa:3,tccctaaatctttaaatcctacatccatgaatccctaaataccta:3,tcttcgttgttgttacgcttgtcatctcatctctcaatgatatgg:3,tctttaatttacaccataaagtttactcacaaaatccaaacaact:3,temporari:0,termin:1,test:[0,3],text:[0,3],tgatgaaggtgaaagtagcatagatcatggggagttgtttggatt:3,tgatgaaggtgaaagtagcatagtgcatagatcatggggagttgtttggatt:3,than:[0,2,3],thi:[2,3],third:3,thread:[0,2,3],three:3,thu:3,tmp:[0,3],tomato:3,tomato_genom:3,total:3,ttatagttgtctaggatggaagggttcttgattcactggtgttga:3,tttcttgtgcatatttctaaattgtactgtgcaaaacttttccct:3,tttgaggtcaatacaaatcctatttcttgtggttttctttccttc:3,tttgtggaaatgtttgttctatcaatttatcttttgtgggaaaat:3,ttttcccacaaaagataaattgatagaacaaacatttccacaaag:3,tuberosum:3,turn:2,tutori:1,two:[0,3],txt:[2,3],ubuntu:1,uid:[2,3],uncompress:0,unicod:2,unit:3,unix:1,unzip:[2,3],updat:2,upgrag:2,usag:[2,3],use:[0,2,3],used:[0,2,3],user:[0,2,3],using:[0,3],valu:[0,2,3],verison:2,version:[0,1,3],vfkrykoi828:4,vhtkauk9oqi:4,via:4,video:1,vol1:3,wait:3,wanna:2,web:2,well:3,were:0,wget:[2,3],when:3,where:[0,2,3],which:0,whole:[0,2,3],wild:3,window:[0,1,3,4],without:1,work:3,wsl:[1,4],www:[3,4],x86_64:2,xming:2,xxxx:2,you:[2,3],your:[2,3],youtu:4,youtub:1,zhangtaolab:[1,2],zip:[2,3],zlib1g:2,zlibc:2,zxvf:2},titles:["Description of functions in Chorus2","Welcome to Chorus\u2019s documentation!","Install","Tutorial","Video tutorials"],titleterms:{"function":0,For:2,Use:3,all:2,anaconda:2,bilibili:[3,4],choru:1,chorus2:[0,2,3],chorusdraftprebuild:0,chorusgui:0,chorushomo:[0,3],chorusngsfilt:0,chorusngsselect:0,chorusnoref:[0,3],choruspbgui:0,close:3,depend:2,descript:0,design:3,directli:2,docker:[2,3],document:1,genom:3,gui:[2,3],indic:1,instal:[2,3],linux:2,maco:2,major:0,manual:2,miscellan:0,oligo:3,packag:2,paramet:0,plant:3,playlist:3,probe:3,recommend:2,refer:3,relat:3,run:3,snapshot:0,softwar:2,speci:3,subsystem:2,tabl:1,termin:[2,3],test:2,tutori:[3,4],ubuntu:2,unix:2,usag:0,version:2,video:[3,4],welcom:1,window:2,without:3,wsl:2,youtub:[3,4]}}) -------------------------------------------------------------------------------- /docs/best practices.rst: -------------------------------------------------------------------------------- 1 | Chorus2 best practices 2 | ==================================== 3 | 4 | A guide pipeline for designing probes for Oligo-FISH in potato (*Solanum tuberosum*). 5 | ############################################################################################# 6 | 7 | I. Requirements & Dependencies 8 | ------------------------------------------------ 9 | 10 | 1. Chorus2 software can be run on both Unix (MacOS/Linux) and Windows (via WSL) platform, here we recommend users to operate on Linux. Our best practices are also performed on an Ubuntu 18.04 system with 8 cores and 64 GB RAM. 11 | 2. Chorus2 is written by python3, several packages are required: **Cython, numpy, pyfasta, primer3-py, pandas and pybigwig**. The GUI version of Chorus2 requires additional packages **matplotlib** and **PyQt5**. 12 | 3. Besides, several bioinformatic tools are needed in Chorus2 pipeline. **BWA** is for genome-wide alignment. **Jellyfish** is for k-mer count. 13 | 4. Genome assembly and whole genome sequencing (WGS) data are required for finding out oligos and filtering out repetitive sequences. WGS data with >5x depth are recommended for NGS filter process. 14 | 5. Finally, we have already built a recipe on bioconda, thus Chorus2 can be installed easily via conda. 15 | 16 | 17 | II. Preparation for Chorus2 pipeline 18 | ------------------------------------------------ 19 | 20 | 1. Download Anaconda distribution 21 | ******************************************* 22 | Anaconda is an open-source distribution that is the easiest way to perform Python/R data science and machine learning on Linux. We use Anaconda3 to install Chorus2 directly. 23 | Download the latest 64-bit Linux version of Anaconda3 distribution from the Anaconda website: https://www.anaconda.com/products/individual. 24 | 25 | .. code-block:: bash 26 | 27 | $ cd /home/zhangtaolab/Software 28 | $ wget https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh 29 | $ sh Anaconda3-2019.10-Linux-x86_64.sh 30 | $ export PATH=$HOME/anaconda3/bin:$PATH 31 | $ conda activate 32 | 33 | After this process, software can be installed easily via conda command. 34 | 35 | **Note**: The latest version of Anaconda3 was 2019.10 when we performed the best practices. If users want to use another version of Anaconda, please take a look from the official website. 36 | 37 | 38 | 2. Install Chorus2 software 39 | ******************************************* 40 | To install bioinformatic tools via conda, bioconda channels should be added. 41 | 42 | .. code-block:: bash 43 | 44 | $ conda config --add channels defaults 45 | $ conda config --add channels bioconda 46 | 47 | Then Chorus2 can be installed with conda command easily. We used conda to create an independent environment for Chorus2. 48 | 49 | .. code-block:: bash 50 | 51 | $ conda create -n chorus Chorus2 52 | 53 | After installing completed, check if Chorus2 runs well. 54 | 55 | .. code-block:: bash 56 | 57 | $ conda activate chorus 58 | $ Chorus2 -h 59 | 60 | This step will show the usage of Chorus2. 61 | 62 | 63 | 3. Download reference genome file and whole genome sequencing files 64 | ************************************************************************ 65 | In this best practice, we designed oligos for potato genome. We used *Solanum tuberosum* species genome as input, which was sequenced by Potato Genome Sequence Consortium (PGSC). The reference genome file can be retrieved from the website: https://solgenomics.net/organism/Solanum_tuberosum/genome. 66 | 67 | .. code-block:: bash 68 | 69 | $ cd /home/zhangtaolab/data/chorus2_project 70 | $ mkdir reference 71 | $ cd reference 72 | $ wget http://solanaceae.plantbiology.msu.edu/data/potato_dm_v404_all_pm_un.fasta.zip 73 | $ unzip potato_dm_v404_all_pm_un.fasta.zip 74 | 75 | Whole genome sequencing data are used for repetitive sequences filtering after Chorus2 find out all available oligos. Here we used SRR5349606 data from NCBI Sequence Read Archive (SRA) database, which contains approximate 4x potato genome sequences. 76 | 77 | .. code-block:: bash 78 | 79 | $ cd .. 80 | $ mkdir NGS 81 | $ cd NGS 82 | $ wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR534/006/SRR5349606/SRR5349606_1.fastq.gz 83 | $ wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR534/006/SRR5349606/SRR5349606_2.fastq.gz 84 | 85 | Here we used *wget* command to download SRR5349606 data, the links are copied from EBI database. Users can also use other tools to download WGS data, such as SRA Tookit and Aspera connect. 86 | 87 | 88 | III. Perform Chorus2 pipeline for Oligo-FISH probes design 89 | -------------------------------------------------------------------------------- 90 | 91 | 1. Using Chorus2 to design Oligo-FISH probes 92 | ****************************************************** 93 | Next, we can use Chorus2 software to design Oligo-FISH probes for potato. 94 | 95 | .. code-block:: bash 96 | 97 | $ cd /home/zhangtaolab/data/chorus2_project 98 | $ mkdir analysis 99 | $ cd analysis 100 | $ Chorus2 -g /home/zhangtaolab/data/chorus2_project/reference/ potato_dm_v404_all_pm_un.fasta -i /home/zhangtaolab/data/chorus2_project/reference/ potato_dm_v404_all_pm_un.fasta -s potato -t 16 101 | 102 | Chorus2 program contains several parameters. '*-g*' requires a genome assembly file and '*-i*' requires an input file where oligos are designed. Both two are mandatory parameters. 103 | Other parameters are optional. '*-s*' requires a path where analysis results are saved. 104 | '*-p*' provides an examination of given 5' labeled R primer, which is used for PCR reaction. 105 | '*-t*' is used for speeding up analysis by add more threads. '*-l*' defines the fixed probe length. 106 | '*--homology*' defines the minimum homology between probe and target sequences. 107 | '*-d*' is for dTm check (hybrid *Tm* - hairpin *Tm*) to avoid duplex formation. 108 | '*--step'* defines the stride of k-mer searching in a sliding window. 109 | Here our analysis results are stored in potato directory. File descriptions are as follow: 110 | 111 | *potato_dm_v404_all_pm_un.fasta.bed* is the probe file contained non-overlapped probes. 112 | 113 | *potato_dm_v404_all_pm_un.fasta_all.bed* is the probe file contained all probes. This file will be used for ChorusNGSfilter. 114 | 115 | *potato_dm_v404_all_pm_un.fasta.len* is the length info of the given genome chromosomes. This file can be imported into ChorusPBGUI for probe selection. 116 | 117 | *potato_dm_v404_all_pm_un.fasta_17mer.jf* is the binary file created by jellyfish count using 17-mer. 118 | 119 | *potato_dm_v404_all_pm_un.fasta_tmp_probe.fa* contains all candidate probe sequences filtered by jellyfish. 120 | *.bwt, .pac, .ann, .amb, .sa* files are bwa index files. 121 | 122 | .. code-block:: bash 123 | 124 | $ cd /home/zhangtaolab/data/chorus2_project/analysis/potato 125 | $ head -5 potato_dm_v404_all_pm_un.fasta_all.bed 126 | chr01 97858 97902 ATTTTCCATGGACCTCATTAAGATTAGCTATTGAACCAGTTACCC 127 | chr01 103008 103052 ACAGCCAAATCGTCCCATATTCAAGGATAAACGACCCACGAATCA 128 | chr01 127095 127139 ATCTATATCTACTACACCAGAATATTCATACACAAATAAATTACT 129 | chr01 127101 127145 ATCTACTACACCAGAATATTCATACACAAATAAATTACTACTATT 130 | chr01 127815 127859 CTCAGATTTACCGAATTATTCCTGTGACAAAATATTACTTCCAGT 131 | 132 | There are four columns in each row, first column is chromosome name, second is oligo start site, third is oligo end site, the last one is oligo probe sequence. Users can use excel or text editor to open this file. 133 | 134 | 135 | 2. Use ChorusNGSfilter to filter repetitive sequences in oligos set 136 | ****************************************************************************** 137 | To further filter putative repetitive sequences, a kmer-based method can be performed to detect repeats by running ChorusNGSfilter. Here we used SRR5349606 data to facilitate filter process. 138 | 139 | .. code-block:: bash 140 | 141 | $ ChorusNGSfilter -i /home/zhangtaolab/data/chorus2_project/NGS/SRR5349606_1.fastq.gz,/home/zhangtaolab/data/chorus2_project/NGS/SRR5349606_2.fastq.gz -z gz -g home/zhangtaolab/data/chorus2_project/reference/ potato_dm_v404_all_pm_un.fasta -t 16 -p potato_dm_v404_all_pm_un.fasta_all.bed -o potato_DM_v404_filtered.bed 142 | 143 | ChorusNGSfilter requires WGS data as input (*-i*), genome file and designed probes file are also required(*-g* and *-p*). 144 | Length of k-mer used for counting k-mers can be adjusted by parameter '*-k*'. 145 | 146 | After running NGS filtering, three files (*\*.jf, \*.bw, \*.bed*) will output to working directory: 147 | 148 | *potato_DM_v404_filtered.bed.jf* is the binary file created by jellyfish count using given k-mer (Default is 17). 149 | 150 | *potato_DM_v404_filtered.bed.bw* is a bigwig file contained all score information generated from NGS library. 151 | 152 | *potato_DM_v404_filtered.bed* is the probe file contained all probes as well as k-mer score and strand. This file should be further selected by ChorusNGSselect. 153 | 154 | .. code-block:: bash 155 | 156 | $ head -5 potato_dm_v404_all_pm_un.fasta_kmer.bed 157 | chr01 97858 97902 ATTTTCCATGGACCTCATTAAGATTAGCTATTGAACCAGTTACCC 324 + 158 | chr01 103008 103052 ACAGCCAAATCGTCCCATATTCAAGGATAAACGACCCACGAATCA 146 + 159 | chr01 127095 127139 ATCTATATCTACTACACCAGAATATTCATACACAAATAAATTACT 318 + 160 | chr01 127101 127145 ATCTACTACACCAGAATATTCATACACAAATAAATTACTACTATT 373 + 161 | chr01 127815 127859 CTCAGATTTACCGAATTATTCCTGTGACAAAATATTACTTCCAGT 281 + 162 | 163 | There are six columns in each row, first four columns are the same as *potato_dm_v404_all_pm_un.fasta_all.bed*. 164 | The fifth column is the k-mer score, last column is target strand of probes. 165 | 166 | 167 | 3. Use ChorusNGSselect to select confident oligo probes 168 | ************************************************************************ 169 | Confident probes need to be further selected based on the k-mer of each oligo. ChorusNGSselect program is used for probes selection. 170 | 171 | .. code-block:: bash 172 | 173 | $ ChorusNGSselect -i potato_DM_v404_filtered.bed -o potato_DM_v404_selected.bed 174 | $ head -5 potato_DM_v404_selected.bed 175 | chr01 97858 97902 ATTTTCCATGGACCTCATTAAGATTAGCTATTGAACCAGTTACCC 324 + 176 | chr01 103008 103052 TGATTCGTGGGTCGTTTATCCTTGAATATGGGACGATTTGGCTGT 146 - 177 | chr01 127095 127139 ATCTATATCTACTACACCAGAATATTCATACACAAATAAATTACT 318 + 178 | chr01 127815 127859 ACTGGAAGTAATATTTTGTCACAGGAATAATTCGGTAAATCTGAG 281 - 179 | chr01 133524 133568 ATTAATCAATAAAGGAAAAGCAAGGTTGGAATACGGTTTCATCCT 389 + 180 | 181 | There are six columns in each row, which are the same as ChorusNGSfilter output. 182 | The final probes can be synthesized directly for oligo-FISH or imported into ChorusPBGUI for further selection. 183 | -------------------------------------------------------------------------------- /docs/_build/html/_static/doctools.js: -------------------------------------------------------------------------------- 1 | /* 2 | * doctools.js 3 | * ~~~~~~~~~~~ 4 | * 5 | * Sphinx JavaScript utilities for all documentation. 6 | * 7 | * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /** 13 | * select a different prefix for underscore 14 | */ 15 | $u = _.noConflict(); 16 | 17 | /** 18 | * make the code below compatible with browsers without 19 | * an installed firebug like debugger 20 | if (!window.console || !console.firebug) { 21 | var names = ["log", "debug", "info", "warn", "error", "assert", "dir", 22 | "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", 23 | "profile", "profileEnd"]; 24 | window.console = {}; 25 | for (var i = 0; i < names.length; ++i) 26 | window.console[names[i]] = function() {}; 27 | } 28 | */ 29 | 30 | /** 31 | * small helper function to urldecode strings 32 | */ 33 | jQuery.urldecode = function(x) { 34 | return decodeURIComponent(x).replace(/\+/g, ' '); 35 | }; 36 | 37 | /** 38 | * small helper function to urlencode strings 39 | */ 40 | jQuery.urlencode = encodeURIComponent; 41 | 42 | /** 43 | * This function returns the parsed url parameters of the 44 | * current request. Multiple values per key are supported, 45 | * it will always return arrays of strings for the value parts. 46 | */ 47 | jQuery.getQueryParameters = function(s) { 48 | if (typeof s === 'undefined') 49 | s = document.location.search; 50 | var parts = s.substr(s.indexOf('?') + 1).split('&'); 51 | var result = {}; 52 | for (var i = 0; i < parts.length; i++) { 53 | var tmp = parts[i].split('=', 2); 54 | var key = jQuery.urldecode(tmp[0]); 55 | var value = jQuery.urldecode(tmp[1]); 56 | if (key in result) 57 | result[key].push(value); 58 | else 59 | result[key] = [value]; 60 | } 61 | return result; 62 | }; 63 | 64 | /** 65 | * highlight a given string on a jquery object by wrapping it in 66 | * span elements with the given class name. 67 | */ 68 | jQuery.fn.highlightText = function(text, className) { 69 | function highlight(node, addItems) { 70 | if (node.nodeType === 3) { 71 | var val = node.nodeValue; 72 | var pos = val.toLowerCase().indexOf(text); 73 | if (pos >= 0 && 74 | !jQuery(node.parentNode).hasClass(className) && 75 | !jQuery(node.parentNode).hasClass("nohighlight")) { 76 | var span; 77 | var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); 78 | if (isInSVG) { 79 | span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); 80 | } else { 81 | span = document.createElement("span"); 82 | span.className = className; 83 | } 84 | span.appendChild(document.createTextNode(val.substr(pos, text.length))); 85 | node.parentNode.insertBefore(span, node.parentNode.insertBefore( 86 | document.createTextNode(val.substr(pos + text.length)), 87 | node.nextSibling)); 88 | node.nodeValue = val.substr(0, pos); 89 | if (isInSVG) { 90 | var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); 91 | var bbox = node.parentElement.getBBox(); 92 | rect.x.baseVal.value = bbox.x; 93 | rect.y.baseVal.value = bbox.y; 94 | rect.width.baseVal.value = bbox.width; 95 | rect.height.baseVal.value = bbox.height; 96 | rect.setAttribute('class', className); 97 | addItems.push({ 98 | "parent": node.parentNode, 99 | "target": rect}); 100 | } 101 | } 102 | } 103 | else if (!jQuery(node).is("button, select, textarea")) { 104 | jQuery.each(node.childNodes, function() { 105 | highlight(this, addItems); 106 | }); 107 | } 108 | } 109 | var addItems = []; 110 | var result = this.each(function() { 111 | highlight(this, addItems); 112 | }); 113 | for (var i = 0; i < addItems.length; ++i) { 114 | jQuery(addItems[i].parent).before(addItems[i].target); 115 | } 116 | return result; 117 | }; 118 | 119 | /* 120 | * backward compatibility for jQuery.browser 121 | * This will be supported until firefox bug is fixed. 122 | */ 123 | if (!jQuery.browser) { 124 | jQuery.uaMatch = function(ua) { 125 | ua = ua.toLowerCase(); 126 | 127 | var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || 128 | /(webkit)[ \/]([\w.]+)/.exec(ua) || 129 | /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || 130 | /(msie) ([\w.]+)/.exec(ua) || 131 | ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || 132 | []; 133 | 134 | return { 135 | browser: match[ 1 ] || "", 136 | version: match[ 2 ] || "0" 137 | }; 138 | }; 139 | jQuery.browser = {}; 140 | jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; 141 | } 142 | 143 | /** 144 | * Small JavaScript module for the documentation. 145 | */ 146 | var Documentation = { 147 | 148 | init : function() { 149 | this.fixFirefoxAnchorBug(); 150 | this.highlightSearchWords(); 151 | this.initIndexTable(); 152 | if (DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) { 153 | this.initOnKeyListeners(); 154 | } 155 | }, 156 | 157 | /** 158 | * i18n support 159 | */ 160 | TRANSLATIONS : {}, 161 | PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; }, 162 | LOCALE : 'unknown', 163 | 164 | // gettext and ngettext don't access this so that the functions 165 | // can safely bound to a different name (_ = Documentation.gettext) 166 | gettext : function(string) { 167 | var translated = Documentation.TRANSLATIONS[string]; 168 | if (typeof translated === 'undefined') 169 | return string; 170 | return (typeof translated === 'string') ? translated : translated[0]; 171 | }, 172 | 173 | ngettext : function(singular, plural, n) { 174 | var translated = Documentation.TRANSLATIONS[singular]; 175 | if (typeof translated === 'undefined') 176 | return (n == 1) ? singular : plural; 177 | return translated[Documentation.PLURALEXPR(n)]; 178 | }, 179 | 180 | addTranslations : function(catalog) { 181 | for (var key in catalog.messages) 182 | this.TRANSLATIONS[key] = catalog.messages[key]; 183 | this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); 184 | this.LOCALE = catalog.locale; 185 | }, 186 | 187 | /** 188 | * add context elements like header anchor links 189 | */ 190 | addContextElements : function() { 191 | $('div[id] > :header:first').each(function() { 192 | $('\u00B6'). 193 | attr('href', '#' + this.id). 194 | attr('title', _('Permalink to this headline')). 195 | appendTo(this); 196 | }); 197 | $('dt[id]').each(function() { 198 | $('\u00B6'). 199 | attr('href', '#' + this.id). 200 | attr('title', _('Permalink to this definition')). 201 | appendTo(this); 202 | }); 203 | }, 204 | 205 | /** 206 | * workaround a firefox stupidity 207 | * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 208 | */ 209 | fixFirefoxAnchorBug : function() { 210 | if (document.location.hash && $.browser.mozilla) 211 | window.setTimeout(function() { 212 | document.location.href += ''; 213 | }, 10); 214 | }, 215 | 216 | /** 217 | * highlight the search words provided in the url in the text 218 | */ 219 | highlightSearchWords : function() { 220 | var params = $.getQueryParameters(); 221 | var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; 222 | if (terms.length) { 223 | var body = $('div.body'); 224 | if (!body.length) { 225 | body = $('body'); 226 | } 227 | window.setTimeout(function() { 228 | $.each(terms, function() { 229 | body.highlightText(this.toLowerCase(), 'highlighted'); 230 | }); 231 | }, 10); 232 | $('') 234 | .appendTo($('#searchbox')); 235 | } 236 | }, 237 | 238 | /** 239 | * init the domain index toggle buttons 240 | */ 241 | initIndexTable : function() { 242 | var togglers = $('img.toggler').click(function() { 243 | var src = $(this).attr('src'); 244 | var idnum = $(this).attr('id').substr(7); 245 | $('tr.cg-' + idnum).toggle(); 246 | if (src.substr(-9) === 'minus.png') 247 | $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); 248 | else 249 | $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); 250 | }).css('display', ''); 251 | if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { 252 | togglers.click(); 253 | } 254 | }, 255 | 256 | /** 257 | * helper function to hide the search marks again 258 | */ 259 | hideSearchWords : function() { 260 | $('#searchbox .highlight-link').fadeOut(300); 261 | $('span.highlighted').removeClass('highlighted'); 262 | }, 263 | 264 | /** 265 | * make the url absolute 266 | */ 267 | makeURL : function(relativeURL) { 268 | return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; 269 | }, 270 | 271 | /** 272 | * get the current relative url 273 | */ 274 | getCurrentURL : function() { 275 | var path = document.location.pathname; 276 | var parts = path.split(/\//); 277 | $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { 278 | if (this === '..') 279 | parts.pop(); 280 | }); 281 | var url = parts.join('/'); 282 | return path.substring(url.lastIndexOf('/') + 1, path.length - 1); 283 | }, 284 | 285 | initOnKeyListeners: function() { 286 | $(document).keydown(function(event) { 287 | var activeElementType = document.activeElement.tagName; 288 | // don't navigate when in search box or textarea 289 | if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT' 290 | && !event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey) { 291 | switch (event.keyCode) { 292 | case 37: // left 293 | var prevHref = $('link[rel="prev"]').prop('href'); 294 | if (prevHref) { 295 | window.location.href = prevHref; 296 | return false; 297 | } 298 | case 39: // right 299 | var nextHref = $('link[rel="next"]').prop('href'); 300 | if (nextHref) { 301 | window.location.href = nextHref; 302 | return false; 303 | } 304 | } 305 | } 306 | }); 307 | } 308 | }; 309 | 310 | // quick alias for translations 311 | _ = Documentation.gettext; 312 | 313 | $(document).ready(function() { 314 | Documentation.init(); 315 | }); 316 | --------------------------------------------------------------------------------