rnftools 0.4.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rnftools-0.4.0.0/LICENSE +22 -0
- rnftools-0.4.0.0/PKG-INFO +70 -0
- rnftools-0.4.0.0/README.rst +45 -0
- rnftools-0.4.0.0/rnftools/__init__.py +129 -0
- rnftools-0.4.0.0/rnftools/include_all.snake +20 -0
- rnftools-0.4.0.0/rnftools/lavender/Bam.py +962 -0
- rnftools-0.4.0.0/rnftools/lavender/Panel.py +373 -0
- rnftools-0.4.0.0/rnftools/lavender/Report.py +325 -0
- rnftools-0.4.0.0/rnftools/lavender/__init__.py +109 -0
- rnftools-0.4.0.0/rnftools/lavender/lavender.snake +159 -0
- rnftools-0.4.0.0/rnftools/mishmash/ArtIllumina.py +174 -0
- rnftools-0.4.0.0/rnftools/mishmash/CuReSim.py +278 -0
- rnftools-0.4.0.0/rnftools/mishmash/DwgSim.py +355 -0
- rnftools-0.4.0.0/rnftools/mishmash/MasonIllumina.py +157 -0
- rnftools-0.4.0.0/rnftools/mishmash/Sample.py +90 -0
- rnftools-0.4.0.0/rnftools/mishmash/Source.py +265 -0
- rnftools-0.4.0.0/rnftools/mishmash/WgSim.py +330 -0
- rnftools-0.4.0.0/rnftools/mishmash/__init__.py +79 -0
- rnftools-0.4.0.0/rnftools/mishmash/mishmash.snake +64 -0
- rnftools-0.4.0.0/rnftools/rnfformat/FqCreator.py +127 -0
- rnftools-0.4.0.0/rnftools/rnfformat/FqMerger.py +229 -0
- rnftools-0.4.0.0/rnftools/rnfformat/ReadTuple.py +106 -0
- rnftools-0.4.0.0/rnftools/rnfformat/RnfLifter.py +106 -0
- rnftools-0.4.0.0/rnftools/rnfformat/RnfProfile.py +148 -0
- rnftools-0.4.0.0/rnftools/rnfformat/Segment.py +71 -0
- rnftools-0.4.0.0/rnftools/rnfformat/Validator.py +115 -0
- rnftools-0.4.0.0/rnftools/rnfformat/__init__.py +9 -0
- rnftools-0.4.0.0/rnftools/scripts.py +990 -0
- rnftools-0.4.0.0/rnftools/utils/Chain.py +114 -0
- rnftools-0.4.0.0/rnftools/utils/ChainSequence.py +89 -0
- rnftools-0.4.0.0/rnftools/utils/FaIdx.py +78 -0
- rnftools-0.4.0.0/rnftools/utils/__init__.py +56 -0
- rnftools-0.4.0.0/rnftools/version.py +1 -0
- rnftools-0.4.0.0/rnftools.egg-info/PKG-INFO +70 -0
- rnftools-0.4.0.0/rnftools.egg-info/SOURCES.txt +39 -0
- rnftools-0.4.0.0/rnftools.egg-info/dependency_links.txt +1 -0
- rnftools-0.4.0.0/rnftools.egg-info/entry_points.txt +2 -0
- rnftools-0.4.0.0/rnftools.egg-info/requires.txt +6 -0
- rnftools-0.4.0.0/rnftools.egg-info/top_level.txt +1 -0
- rnftools-0.4.0.0/setup.cfg +4 -0
- rnftools-0.4.0.0/setup.py +70 -0
rnftools-0.4.0.0/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015 Karel Břinda
|
|
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
|
+
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: rnftools
|
|
3
|
+
Version: 0.4.0.0
|
|
4
|
+
Summary: RNF framework for NGS: simulation of reads, evaluation of mappers, conversion of RNF-compliant data.
|
|
5
|
+
Home-page: http://karel-brinda.github.io/rnftools/
|
|
6
|
+
Author: Karel Brinda
|
|
7
|
+
Author-email: karel.brinda@univ-mlv.fr
|
|
8
|
+
License: MIT
|
|
9
|
+
Keywords: Bioinformatics,Computational Biology,Next-Generation Sequencing,Read Simulation,Mappers Evaluation
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Natural Language :: English
|
|
15
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
16
|
+
Classifier: Operating System :: Unix
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Requires-Dist: argparse
|
|
20
|
+
Requires-Dist: beautifulsoup4
|
|
21
|
+
Requires-Dist: pyfaidx
|
|
22
|
+
Requires-Dist: pysam
|
|
23
|
+
Requires-Dist: snakemake
|
|
24
|
+
Requires-Dist: svg42pdf>=0.1.1
|
|
25
|
+
|
|
26
|
+
RNFtools
|
|
27
|
+
========
|
|
28
|
+
|
|
29
|
+
.. image:: https://github.com/karel-brinda/rnftools/actions/workflows/ci.yml/badge.svg?branch=master
|
|
30
|
+
:target: https://github.com/karel-brinda/rnftools/actions/workflows/ci.yml
|
|
31
|
+
|
|
32
|
+
.. image:: https://readthedocs.org/projects/rnftools/badge/?version=latest
|
|
33
|
+
:target: http://rnftools.rtfd.org
|
|
34
|
+
|
|
35
|
+
.. image:: https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg?style=flat-square
|
|
36
|
+
:target: https://anaconda.org/bioconda/rnftools
|
|
37
|
+
|
|
38
|
+
.. image:: https://badge.fury.io/py/RNFtools.svg
|
|
39
|
+
:target: https://badge.fury.io/py/RNFtools
|
|
40
|
+
|
|
41
|
+
.. image:: https://img.shields.io/badge/doi-10.1093%2Fbioinformatics%2Fbtv524-brightgreen.svg
|
|
42
|
+
:target: http://dx.doi.org/10.1093/bioinformatics/btv524
|
|
43
|
+
|
|
44
|
+
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.1066626.svg
|
|
45
|
+
:target: https://doi.org/10.5281/zenodo.1066626
|
|
46
|
+
|
|
47
|
+
**Read Naming Format** is a generic format for assigning
|
|
48
|
+
read names with encoded information about original positions.
|
|
49
|
+
**RNFtools** is an associated
|
|
50
|
+
software package which can:
|
|
51
|
+
|
|
52
|
+
* simulate RNF-compliant reads using a wide class of integrated read simulators (Art, DwgSim, Mason, WgSim, etc.), either from a single genome (i.e., a whole genome sequencing) or multiple genomes (i.e., a metagenomic simulation);
|
|
53
|
+
* evaluate mappers using RNF reads;
|
|
54
|
+
* convert non-RNF simulated reads to RNF (e.g., from SAM format);
|
|
55
|
+
* transform genomic coordinates of RNF reads between different coordinate systems (using chain LiftOver format).
|
|
56
|
+
|
|
57
|
+
Links
|
|
58
|
+
-----
|
|
59
|
+
|
|
60
|
+
**Web of the project:** http://karel-brinda.github.io/rnftools/
|
|
61
|
+
|
|
62
|
+
**RNF specification:** http://karel-brinda.github.io/rnf-spec/
|
|
63
|
+
|
|
64
|
+
**Documentation:** http://rnftools.rtfd.org
|
|
65
|
+
|
|
66
|
+
**Installation:** http://rnftools.readthedocs.org/en/latest/tutorial/00_installation.html
|
|
67
|
+
|
|
68
|
+
**Examples of usage:** http://github.com/karel-brinda/rnftools/tree/master/examples/01_tutorial
|
|
69
|
+
|
|
70
|
+
**Publication:** http://dx.doi.org/10.1093/bioinformatics/btv524
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
RNFtools
|
|
2
|
+
========
|
|
3
|
+
|
|
4
|
+
.. image:: https://github.com/karel-brinda/rnftools/actions/workflows/ci.yml/badge.svg?branch=master
|
|
5
|
+
:target: https://github.com/karel-brinda/rnftools/actions/workflows/ci.yml
|
|
6
|
+
|
|
7
|
+
.. image:: https://readthedocs.org/projects/rnftools/badge/?version=latest
|
|
8
|
+
:target: http://rnftools.rtfd.org
|
|
9
|
+
|
|
10
|
+
.. image:: https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg?style=flat-square
|
|
11
|
+
:target: https://anaconda.org/bioconda/rnftools
|
|
12
|
+
|
|
13
|
+
.. image:: https://badge.fury.io/py/RNFtools.svg
|
|
14
|
+
:target: https://badge.fury.io/py/RNFtools
|
|
15
|
+
|
|
16
|
+
.. image:: https://img.shields.io/badge/doi-10.1093%2Fbioinformatics%2Fbtv524-brightgreen.svg
|
|
17
|
+
:target: http://dx.doi.org/10.1093/bioinformatics/btv524
|
|
18
|
+
|
|
19
|
+
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.1066626.svg
|
|
20
|
+
:target: https://doi.org/10.5281/zenodo.1066626
|
|
21
|
+
|
|
22
|
+
**Read Naming Format** is a generic format for assigning
|
|
23
|
+
read names with encoded information about original positions.
|
|
24
|
+
**RNFtools** is an associated
|
|
25
|
+
software package which can:
|
|
26
|
+
|
|
27
|
+
* simulate RNF-compliant reads using a wide class of integrated read simulators (Art, DwgSim, Mason, WgSim, etc.), either from a single genome (i.e., a whole genome sequencing) or multiple genomes (i.e., a metagenomic simulation);
|
|
28
|
+
* evaluate mappers using RNF reads;
|
|
29
|
+
* convert non-RNF simulated reads to RNF (e.g., from SAM format);
|
|
30
|
+
* transform genomic coordinates of RNF reads between different coordinate systems (using chain LiftOver format).
|
|
31
|
+
|
|
32
|
+
Links
|
|
33
|
+
-----
|
|
34
|
+
|
|
35
|
+
**Web of the project:** http://karel-brinda.github.io/rnftools/
|
|
36
|
+
|
|
37
|
+
**RNF specification:** http://karel-brinda.github.io/rnf-spec/
|
|
38
|
+
|
|
39
|
+
**Documentation:** http://rnftools.rtfd.org
|
|
40
|
+
|
|
41
|
+
**Installation:** http://rnftools.readthedocs.org/en/latest/tutorial/00_installation.html
|
|
42
|
+
|
|
43
|
+
**Examples of usage:** http://github.com/karel-brinda/rnftools/tree/master/examples/01_tutorial
|
|
44
|
+
|
|
45
|
+
**Publication:** http://dx.doi.org/10.1093/bioinformatics/btv524
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import builtins
|
|
2
|
+
import sys
|
|
3
|
+
import snakemake
|
|
4
|
+
import os
|
|
5
|
+
import re
|
|
6
|
+
|
|
7
|
+
import rnftools.mishmash
|
|
8
|
+
import rnftools.lavender
|
|
9
|
+
import rnftools.rnfformat
|
|
10
|
+
import rnftools.utils
|
|
11
|
+
|
|
12
|
+
# version detection
|
|
13
|
+
try:
|
|
14
|
+
from importlib.metadata import version, PackageNotFoundError
|
|
15
|
+
__version__ = version("rnftools")
|
|
16
|
+
except (ImportError, PackageNotFoundError):
|
|
17
|
+
__version__ = ""
|
|
18
|
+
|
|
19
|
+
DEFAULT_RNFTOOLS_CONF = {
|
|
20
|
+
'print_info': sys.argv[0] == "snakemake",
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
# default configuration
|
|
24
|
+
try:
|
|
25
|
+
RNFTOOLS_CONF = builtins.RNFTOOLS_CONF
|
|
26
|
+
except AttributeError:
|
|
27
|
+
RNFTOOLS_CONF = {}
|
|
28
|
+
|
|
29
|
+
assert type(RNFTOOLS_CONF) is dict, "builtins.RNFTOOLS_CONF must be a dictionary"
|
|
30
|
+
for key in DEFAULT_RNFTOOLS_CONF.keys():
|
|
31
|
+
if not key in RNFTOOLS_CONF:
|
|
32
|
+
RNFTOOLS_CONF[key] = DEFAULT_RNFTOOLS_CONF[key]
|
|
33
|
+
|
|
34
|
+
# print info
|
|
35
|
+
if RNFTOOLS_CONF["print_info"]:
|
|
36
|
+
message("", program="RNFtools")
|
|
37
|
+
message("RNFtools", program="RNFtools")
|
|
38
|
+
message("~~~~~~~~", program="RNFtools")
|
|
39
|
+
message("Version: {}".format(__version__), program="RNFtools")
|
|
40
|
+
message("Web: http://karel-brinda.github.io/rnftools/", program="RNFtools")
|
|
41
|
+
message("Contact: Karel Brinda, karel.brinda@univ-mlv.fr", program="RNFtools")
|
|
42
|
+
message("Publication: K. Brinda, V. Boeva, G. Kucherov. RNF: a general framework to evaluate", program="RNFtools")
|
|
43
|
+
message(
|
|
44
|
+
" NGS read mappers, Bioinformatics 32(1), 2016 [DOI:10.1093/bioinformatics/btv524].",
|
|
45
|
+
program="RNFtools"
|
|
46
|
+
)
|
|
47
|
+
message("", program="RNFtools")
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def include():
|
|
51
|
+
return os.path.join(
|
|
52
|
+
os.path.dirname(__file__),
|
|
53
|
+
"include_all.snake",
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def input():
|
|
58
|
+
return [
|
|
59
|
+
rnftools.lavender.input(),
|
|
60
|
+
rnftools.mishmash.input(),
|
|
61
|
+
]
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def message(message, program=None, subprogram=None):
|
|
65
|
+
if program == None:
|
|
66
|
+
program_part = ""
|
|
67
|
+
subprogram_part = ""
|
|
68
|
+
else:
|
|
69
|
+
program_part = "[{}] ".format(program)
|
|
70
|
+
if subprogram == None:
|
|
71
|
+
subprogram_part = ""
|
|
72
|
+
else:
|
|
73
|
+
subprogram_part = "{}: ".format(subprogram)
|
|
74
|
+
|
|
75
|
+
print(
|
|
76
|
+
"".join([program_part, subprogram_part, message]),
|
|
77
|
+
file=sys.stderr,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
#cprint(
|
|
81
|
+
# "".join([program_part, subprogram_part, message]),
|
|
82
|
+
# "blue",
|
|
83
|
+
# attrs=['bold'],
|
|
84
|
+
#)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def error(message, program=None, subprogram=None, exception=None):
|
|
88
|
+
if exception != None:
|
|
89
|
+
assert issubclass(exception, Exception)
|
|
90
|
+
|
|
91
|
+
if program == None:
|
|
92
|
+
program_part = ""
|
|
93
|
+
subprogram_part = ""
|
|
94
|
+
else:
|
|
95
|
+
program_part = "[{}] ".format(program)
|
|
96
|
+
if subprogram == None:
|
|
97
|
+
subprogram_part = ""
|
|
98
|
+
else:
|
|
99
|
+
subprogram_part = "{}: ".format(subprogram)
|
|
100
|
+
|
|
101
|
+
print(
|
|
102
|
+
"".join([program_part, subprogram_part, "Error: ", message]),
|
|
103
|
+
file=sys.stderr,
|
|
104
|
+
)
|
|
105
|
+
#cprint(
|
|
106
|
+
# "".join([program_part, subprogram_part, "Error: ", message]),
|
|
107
|
+
# "red",
|
|
108
|
+
# attrs=['bold'],
|
|
109
|
+
#)
|
|
110
|
+
|
|
111
|
+
if exception != None:
|
|
112
|
+
raise exception(message)
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
def shell(
|
|
116
|
+
cmd,
|
|
117
|
+
remove_spaces=True,
|
|
118
|
+
iterable=False,
|
|
119
|
+
read=False,
|
|
120
|
+
):
|
|
121
|
+
if remove_spaces:
|
|
122
|
+
# print("removing spaces from command")
|
|
123
|
+
cmd = re.sub(r'[ \t\f\v]+', ' ', cmd).strip()
|
|
124
|
+
|
|
125
|
+
return snakemake.shell(
|
|
126
|
+
cmd=cmd,
|
|
127
|
+
iterable=iterable,
|
|
128
|
+
read=read,
|
|
129
|
+
)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from snakemake.utils import min_version
|
|
2
|
+
|
|
3
|
+
include: "mishmash/mishmash.snake"
|
|
4
|
+
include: "lavender/lavender.snake"
|
|
5
|
+
|
|
6
|
+
rule index_fasta:
|
|
7
|
+
output:
|
|
8
|
+
"{filename}.{suffix}.fai"
|
|
9
|
+
input:
|
|
10
|
+
"{filename}.{suffix}"
|
|
11
|
+
message:
|
|
12
|
+
"Creating index for a FASTA file ({input})."
|
|
13
|
+
shell:
|
|
14
|
+
"""
|
|
15
|
+
(
|
|
16
|
+
samtools faidx "{input}"
|
|
17
|
+
) > /dev/null
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
|