sjteresi / TE_Density

Python script calculating transposable element density for all genes in a genome. Publication: https://mobilednajournal.biomedcentral.com/articles/10.1186/s13100-022-00264-4
GNU General Public License v3.0
28 stars 4 forks source link

add setup.py #136

Closed teresi closed 1 year ago

teresi commented 1 year ago

DISCUSSION

I wanted to try 3.11.3 and had it compiled on my machine for another project, and you removed the tables requirement, so I went ahead and updated the dependencies and gave it a shot.

Running the system test didn't show any significant differences wrt execution time, but we could profile cpu / memory usage more precisely in the future.

I also remembered that a few users had some issues installing the dependencies, so I added the setup.py and fleshed out the readme/installation.

(Note that the setup.py has more generic dependencies than requirements.txt.)

TESTING

does the installation section of the readme make sense?

vim README.md

can you install using the setup.py?

[13:49 GOKU]:/tmp
[ins]▸$ mkvirtualenv test
created virtual environment CPython3.11.3.final.0-64 in 169ms
...
(test) [13:49 GOKU]:/tmp
[cmd]▸$ pip install 'te-density @ git+https://github.com/sjteresi/TE_Density.git@f/setup.py'
Collecting te-density@ git+https://github.com/sjteresi/TE_Density.git@f/setup.py
...

does process_genome show up as a script when installed this way?

(test) [13:50 GOKU]:/tmp
[ins]▸$ process_genome.py -h
usage: process_genome.py [-h] [--num_threads NUM_THREADS] [--config_file CONFIG_FILE] [--reset_h5] [--revise_anno] [--output_dir OUTPUT_DIR] [--single_process] [-v]
                         genes_input_file tes_input_file genome_id

calculate TE density
...

do the tests pass?

(genes_310) [13:54 GOKU][f/setup.py]->(f758):/data/genes/TE_Density
[cmd]▸$ pytest
================================================================================ test session starts =================================================================================
platform linux -- Python 3.10.6, pytest-7.3.1, pluggy-1.0.0
rootdir: /data/genes/TE_Density
collected 197 items

tests/unit/test_DensityData.py .                                                                                                                                               [  0%]
tests/unit/test_GeneDatum.py ....                                                                                                                                              [  2%]
tests/unit/test_MergeData.py ..................ss                                                                                                                              [ 12%]
tests/unit/test_Overlap.py ........................................................................                                                                            [ 49%]
tests/unit/test_OverlapData.py ..............                                                                                                                                  [ 56%]
tests/unit/test_ReviseAnno.py .........                                                                                                                                        [ 60%]
tests/unit/test_WorkerProcess.py ...                                                                                                                                           [ 62%]
tests/unit/test_data.py ....                                                                                                                                                   [ 64%]
tests/unit/test_density.py .........................................................                                                                                           [ 93%]
tests/unit/test_gene_data.py ....                                                                                                                                              [ 95%]
tests/unit/test_import_genes.py ...                                                                                                                                            [ 96%]
tests/unit/test_preprocess.py ..                                                                                                                                               [ 97%]
tests/unit/test_transposon_data.py ....                                                                                                                                        [100%]

=========================================================================== 195 passed, 2 skipped in 3.59s ===========================================================================

does the system test run?

$ make system_test