Skip to content

Commit

Permalink
Chore/restructure (#102)
Browse files Browse the repository at this point in the history
* restructure project
  • Loading branch information
matthdsm committed Apr 19, 2024
1 parent ea6342c commit b16b310
Show file tree
Hide file tree
Showing 50 changed files with 108 additions and 69 deletions.
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
repos:
- repo: https://github.com/psf/black
rev: 21.9b0
hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
recursive-include wisecondorX *.R
recursive-include wisecondorx *.R
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ WisecondorX convert input.bam/cram output.npz [--optional arguments]
| `--binsize x` | Size per bin in bp; the reference bin size should be a multiple of this value. Note that this parameter does not impact the resolution, yet it can be used to optimize processing speed (default: x=5e3) |
| `--normdup` | Use this flag to avoid duplicate removal |

→ Bash recipe at `./pipeline/convert.sh`
→ Bash recipe at `docs/include/pipeline/convert.sh`

### Stage (2) Create reference

Expand All @@ -91,7 +91,7 @@ WisecondorX newref reference_input_dir/*.npz reference_output.npz [--optional ar
| `--plotyfrac x` | plots Y read fraction histogram and Gaussian mixture fit to file x, can help when setting `--yfrac` manually; software quits after plotting |
| `--cpus x` | Number of threads requested (default: x=1) |

→ Bash recipe at `./pipeline/newref.sh`
→ Bash recipe at `docs/include/pipeline/newref.sh`

### Stage (3) Predict copy number alterations

Expand All @@ -116,7 +116,7 @@ WisecondorX predict test_input.npz reference_input.npz output_id [--optional arg

<sup>**(\*)** At least one of these output formats should be selected</sup>

&rarr; Bash recipe at `./pipeline/predict.sh`
&rarr; Bash recipe at `docs/include/pipeline/predict.sh`

### Additional functionality

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 17 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[tool.black]
line-length = 79
target_version = ['py36','py37','py38','py39']
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
'''
63 changes: 63 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
[metadata]
name = wisecondorx
version = 1.2.6dev
description = description="WisecondorX -- an evolved WISECONDOR"
long_description = file: README.md
author = "Matthias De Smet, Lennart Raman",
author_email = "ict@cmgg.be",
license = "by-nc-sa"
license_file = LICENSE.md
platforms = unix, linux, osx, win32
keywords=
bioinformatics
biology
sequencing
NGS
next generation sequencing
CNV
SWGS
Shallow Whole Genome Sequencing
classifiers =
Environment :: Console
Intended Audience :: Science/Research
Natural Language :: English
Operating System :: MacOS :: MacOS X
Operating System :: POSIX
Operating System :: Unix
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Topic :: Scientific/Engineering
Topic :: Scientific/Engineering :: Bio-Informatics


[options]
packages = wisecondorx
package_dir =
=src
include_package_data=True
python_requires= >=3.6
install_requires =
scipy
scikit-learn
pysam
numpy
zip_safe = False

[options.entry_points]
console_scripts =
wisecondorx = wisecondorx.main:main
WisecondorX = wisecondorx.main:main
wisecondorX = wisecondorx.main:main


[options.extras_require]
testing =
flake8
black
pre-commit

[flake8]
ignore = E266, E203, E501, C901, W503
max-line-length = 79
max-complexity = 18
58 changes: 4 additions & 54 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,55 +1,5 @@
#! /usr/bin/env python
from setuptools import setup, find_packages
#!/usr/bin/env python
from setuptools import setup

version = "1.2.4"
dl_version = "master" if "dev" in version else "{}".format(version)

setup(
name="WisecondorX",
version=version,
author="Matthias De Smet, Lennart Raman",
author_email="Lennart.raman@ugent.be",
description="WisecondorX -- an evolved WISECONDOR",
long_description=__doc__,
keywords=[
"bioinformatics",
"biology",
"sequencing",
"NGS",
"next generation sequencing",
"CNV",
"SWGS",
"Shallow Whole Genome Sequencing",
],
download_url="https://github.com/CenterForMedicalGeneticsGhent/WisecondorX/archive/v{}.tar.gz".format(
dl_version
),
license="Attribution-NonCommercial-ShareAlike CC BY-NC-SA",
packages=find_packages("."),
python_requires=">=2.7",
include_package_data=True,
zip_safe=False,
install_requires=[
'futures;python_version<"3"',
"scipy",
"scikit-learn",
"pysam",
"numpy",
],
entry_points={"console_scripts": ["WisecondorX = wisecondorX.main:main"]},
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: Console",
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX",
"Operating System :: Unix",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Bio-Informatics",
],
)
if __name__ == "__main__":
setup()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions wisecondorX/main.py → src/wisecondorx/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@

import numpy as np

from wisecondorX.convert_tools import convert_reads
from wisecondorX.newref_control import (
from wisecondorx.convert_tools import convert_reads
from wisecondorx.newref_control import (
tool_newref_prep,
tool_newref_main,
tool_newref_merge,
)
from wisecondorX.newref_tools import train_gender_model, get_mask
from wisecondorX.overall_tools import gender_correct, scale_sample
from wisecondorX.predict_control import normalize, get_post_processed_result
from wisecondorX.predict_output import generate_output_tables, exec_write_plots
from wisecondorX.predict_tools import (
from wisecondorx.newref_tools import train_gender_model, get_mask
from wisecondorx.overall_tools import gender_correct, scale_sample
from wisecondorx.predict_control import normalize, get_post_processed_result
from wisecondorx.predict_output import generate_output_tables, exec_write_plots
from wisecondorx.predict_tools import (
log_trans,
exec_cbs,
apply_blacklist,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import numpy as np
from concurrent import futures

from wisecondorX.newref_tools import normalize_and_mask, train_pca, get_reference
from wisecondorx.newref_tools import normalize_and_mask, train_pca, get_reference

"""
Outputs preparation files of read depth normalized
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# WisecondorX

from wisecondorX.predict_tools import (
from wisecondorx.predict_tools import (
coverage_normalize_and_mask,
project_pc,
get_optimal_cutoff,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import numpy as np

from wisecondorX.overall_tools import (
from wisecondorx.overall_tools import (
exec_R,
get_z_score,
get_median_segment_variance,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from scipy.stats import norm
from sklearn.decomposition import PCA

from wisecondorX.overall_tools import exec_R, get_z_score
from wisecondorx.overall_tools import exec_R, get_z_score

"""
Returns gender based on Gaussian mixture
Expand Down

0 comments on commit b16b310

Please sign in to comment.