From cf579212d0cfbea20328948a1e6ef409108a9e87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Balajti?= Date: Wed, 20 Sep 2023 15:13:23 +0200 Subject: [PATCH] refactor: update code, add readme --- README.md | 42 ++++++++++++++ environment-dev.yml | 14 +++++ environment.yml | 13 +---- .../requirements.txt => requirements.txt | 5 +- .../__init__.py | 0 scRNAsim_toolz/cdna_generator/.gitlab-ci.yml | 34 ------------ scRNAsim_toolz/cdna_generator/Dockerfile | 46 ---------------- scRNAsim_toolz/cdna_generator/cli.py | 2 +- .../cdna_generator/requirements.txt | 3 - .../cdna_generator/requirements_dev.txt | 7 --- scRNAsim_toolz/cdna_generator/setup.py | 29 ---------- .../README.md | 0 scRNAsim_toolz/fragment_selector/__init__.py | 1 + .../cli.py | 6 +- .../fragmentation.py | 0 .../utils.py | 0 .../priming_site_predictor/.gitlab-ci.yml | 34 ------------ scRNAsim_toolz/priming_site_predictor/cli.py | 4 +- .../priming_site_predictor/requirements.txt | 4 -- .../requirements_dev.txt | 6 -- .../priming_site_predictor/setup.py | 28 ---------- scRNAsim_toolz/read_sequencer/.gitlab-ci.yml | 34 ------------ scRNAsim_toolz/read_sequencer/cli.py | 2 +- .../read_sequencer/requirements-dev.txt | 7 --- .../read_sequencer/requirements.txt | 2 - scRNAsim_toolz/read_sequencer/setup.py | 30 ---------- .../README.md | 0 .../__init__.py | 0 .../cli.py | 6 +- .../exon_concat.py} | 0 .../poly_a.py | 2 +- .../pre_bedtools.py | 0 .../README.md | 0 .../structure_generator/__init__.py | 4 ++ .../__main__.py | 2 +- .../cli.py | 2 +- .../main.py | 2 +- .../terminal_fragment_selector/.gitlab-ci.yml | 34 ------------ .../requirements.txt | 4 -- .../requirements_dev.txt | 6 -- .../terminal_fragment_selector/setup.py | 28 ---------- .../transcript_sampler/.gitlab-ci.yml | 34 ------------ scRNAsim_toolz/transcript_sampler/cli.py | 6 +- ...tch_reptrans_explvl.py => match_explvl.py} | 0 .../transcript_sampler/poisson_sampling.py | 4 +- .../transcript_sampler/requirements_dev.txt | 7 --- scRNAsim_toolz/transcript_sampler/setup.py | 25 --------- .../.gitlab-ci.yml | 34 ------------ .../requirements.txt | 4 -- .../requirements_dev.txt | 7 --- .../transcript_sequence_extractor/setup.py | 29 ---------- .../.gitlab-ci.yml | 34 ------------ .../__init__.py | 6 -- .../requirements.txt | 2 - .../requirements_dev.txt | 9 --- .../transcript_structure_generator/setup.py | 26 --------- setup.py | 55 +++++++++++++++++++ tests/cdna_generator/test_cdna.py | 4 +- .../__init__.py | 0 .../test_cli.py | 6 +- .../test_files/test.csv | 0 .../test_files/test.fasta | 0 .../test_files/test_tab.csv | 0 .../test_frag.py | 6 +- .../test_utils.py | 6 +- tests/priming_site_predictor/test_cli.py | 6 +- tests/priming_site_predictor/test_psp.py | 7 ++- tests/read_sequencer/test_cli.py | 6 +- tests/read_sequencer/test_read_sequencer.py | 4 +- .../__init__.py | 0 .../test_exon_concatenation.py | 4 +- .../test_files/post_bedtools_test.fa | 0 .../test_files/test.bed | 0 .../test_files/test.gtf | 0 .../test_files/test_1.fa | 0 .../test_files/test_2.fa | 0 .../test_poly_a.py | 5 +- .../__init__.py | 0 .../resources/Annotation1.gtf | 0 .../resources/Annotations2.gtf | 0 .../resources/Transcript1.csv | 0 .../resources/Transcript2.tsv | 0 .../test_main.py | 5 +- .../{tests => }/__init__.py | 0 .../{tests => }/inputs/.gitkeep | 0 .../{tests => }/inputs/expression.csv | 0 .../{tests => }/inputs/test.gtf | 0 .../inputs/test_dict_repr_trans.txt | 0 ...ncode.vM31.annotation_intermediat_file.txt | 0 .../{tests => }/inputs/test_gene_exprL | 0 .../inputs/test_gene_exprL_csv.csv | 0 .../{tests => }/inputs/test_ref_output.tsv | 0 .../{tests => }/test_functions.py | 2 +- .../{tests => }/test_match_reptrans_explvl.py | 9 +-- 94 files changed, 183 insertions(+), 612 deletions(-) create mode 100644 README.md create mode 100644 environment-dev.yml rename scRNAsim_toolz/transcript_sampler/requirements.txt => requirements.txt (69%) rename scRNAsim_toolz/{terminal_fragment_selector => }/__init__.py (100%) delete mode 100644 scRNAsim_toolz/cdna_generator/.gitlab-ci.yml delete mode 100644 scRNAsim_toolz/cdna_generator/Dockerfile delete mode 100644 scRNAsim_toolz/cdna_generator/requirements.txt delete mode 100644 scRNAsim_toolz/cdna_generator/requirements_dev.txt delete mode 100644 scRNAsim_toolz/cdna_generator/setup.py rename scRNAsim_toolz/{terminal_fragment_selector => fragment_selector}/README.md (100%) create mode 100644 scRNAsim_toolz/fragment_selector/__init__.py rename scRNAsim_toolz/{terminal_fragment_selector => fragment_selector}/cli.py (97%) rename scRNAsim_toolz/{terminal_fragment_selector => fragment_selector}/fragmentation.py (100%) rename scRNAsim_toolz/{terminal_fragment_selector => fragment_selector}/utils.py (100%) delete mode 100644 scRNAsim_toolz/priming_site_predictor/.gitlab-ci.yml delete mode 100644 scRNAsim_toolz/priming_site_predictor/requirements.txt delete mode 100644 scRNAsim_toolz/priming_site_predictor/requirements_dev.txt delete mode 100644 scRNAsim_toolz/priming_site_predictor/setup.py delete mode 100644 scRNAsim_toolz/read_sequencer/.gitlab-ci.yml delete mode 100644 scRNAsim_toolz/read_sequencer/requirements-dev.txt delete mode 100644 scRNAsim_toolz/read_sequencer/requirements.txt delete mode 100644 scRNAsim_toolz/read_sequencer/setup.py rename scRNAsim_toolz/{transcript_sequence_extractor => sequence_extractor}/README.md (100%) rename scRNAsim_toolz/{transcript_sequence_extractor => sequence_extractor}/__init__.py (100%) rename scRNAsim_toolz/{transcript_sequence_extractor => sequence_extractor}/cli.py (93%) rename scRNAsim_toolz/{transcript_sequence_extractor/exon_concatenation.py => sequence_extractor/exon_concat.py} (100%) rename scRNAsim_toolz/{transcript_sequence_extractor => sequence_extractor}/poly_a.py (97%) rename scRNAsim_toolz/{transcript_sequence_extractor => sequence_extractor}/pre_bedtools.py (100%) rename scRNAsim_toolz/{transcript_structure_generator => structure_generator}/README.md (100%) create mode 100644 scRNAsim_toolz/structure_generator/__init__.py rename scRNAsim_toolz/{transcript_structure_generator => structure_generator}/__main__.py (70%) rename scRNAsim_toolz/{transcript_structure_generator => structure_generator}/cli.py (98%) rename scRNAsim_toolz/{transcript_structure_generator => structure_generator}/main.py (99%) delete mode 100644 scRNAsim_toolz/terminal_fragment_selector/.gitlab-ci.yml delete mode 100644 scRNAsim_toolz/terminal_fragment_selector/requirements.txt delete mode 100644 scRNAsim_toolz/terminal_fragment_selector/requirements_dev.txt delete mode 100644 scRNAsim_toolz/terminal_fragment_selector/setup.py delete mode 100644 scRNAsim_toolz/transcript_sampler/.gitlab-ci.yml rename scRNAsim_toolz/transcript_sampler/{match_reptrans_explvl.py => match_explvl.py} (100%) delete mode 100644 scRNAsim_toolz/transcript_sampler/requirements_dev.txt delete mode 100644 scRNAsim_toolz/transcript_sampler/setup.py delete mode 100644 scRNAsim_toolz/transcript_sequence_extractor/.gitlab-ci.yml delete mode 100644 scRNAsim_toolz/transcript_sequence_extractor/requirements.txt delete mode 100644 scRNAsim_toolz/transcript_sequence_extractor/requirements_dev.txt delete mode 100644 scRNAsim_toolz/transcript_sequence_extractor/setup.py delete mode 100644 scRNAsim_toolz/transcript_structure_generator/.gitlab-ci.yml delete mode 100644 scRNAsim_toolz/transcript_structure_generator/__init__.py delete mode 100644 scRNAsim_toolz/transcript_structure_generator/requirements.txt delete mode 100644 scRNAsim_toolz/transcript_structure_generator/requirements_dev.txt delete mode 100644 scRNAsim_toolz/transcript_structure_generator/setup.py create mode 100644 setup.py rename tests/{terminal_fragment_selector => fragment_selector}/__init__.py (100%) rename tests/{terminal_fragment_selector => fragment_selector}/test_cli.py (87%) rename tests/{terminal_fragment_selector => fragment_selector}/test_files/test.csv (100%) rename tests/{terminal_fragment_selector => fragment_selector}/test_files/test.fasta (100%) rename tests/{terminal_fragment_selector => fragment_selector}/test_files/test_tab.csv (100%) rename tests/{terminal_fragment_selector => fragment_selector}/test_frag.py (86%) rename tests/{terminal_fragment_selector => fragment_selector}/test_utils.py (82%) rename tests/{transcript_sequence_extractor => sequence_extractor}/__init__.py (100%) rename tests/{transcript_sequence_extractor => sequence_extractor}/test_exon_concatenation.py (92%) rename tests/{transcript_sequence_extractor => sequence_extractor}/test_files/post_bedtools_test.fa (100%) rename tests/{transcript_sequence_extractor => sequence_extractor}/test_files/test.bed (100%) rename tests/{transcript_sequence_extractor => sequence_extractor}/test_files/test.gtf (100%) rename tests/{transcript_sequence_extractor => sequence_extractor}/test_files/test_1.fa (100%) rename tests/{transcript_sequence_extractor => sequence_extractor}/test_files/test_2.fa (100%) rename tests/{transcript_sequence_extractor => sequence_extractor}/test_poly_a.py (89%) rename tests/{transcript_structure_generator => structure_generator}/__init__.py (100%) rename tests/{transcript_structure_generator => structure_generator}/resources/Annotation1.gtf (100%) rename tests/{transcript_structure_generator => structure_generator}/resources/Annotations2.gtf (100%) rename tests/{transcript_structure_generator => structure_generator}/resources/Transcript1.csv (100%) rename tests/{transcript_structure_generator => structure_generator}/resources/Transcript2.tsv (100%) rename tests/{transcript_structure_generator => structure_generator}/test_main.py (96%) rename tests/transcript_sampler/{tests => }/__init__.py (100%) rename tests/transcript_sampler/{tests => }/inputs/.gitkeep (100%) rename tests/transcript_sampler/{tests => }/inputs/expression.csv (100%) rename tests/transcript_sampler/{tests => }/inputs/test.gtf (100%) rename tests/transcript_sampler/{tests => }/inputs/test_dict_repr_trans.txt (100%) rename tests/transcript_sampler/{tests => }/inputs/test_gencode.vM31.annotation_intermediat_file.txt (100%) rename tests/transcript_sampler/{tests => }/inputs/test_gene_exprL (100%) rename tests/transcript_sampler/{tests => }/inputs/test_gene_exprL_csv.csv (100%) rename tests/transcript_sampler/{tests => }/inputs/test_ref_output.tsv (100%) rename tests/transcript_sampler/{tests => }/test_functions.py (98%) rename tests/transcript_sampler/{tests => }/test_match_reptrans_explvl.py (97%) diff --git a/README.md b/README.md new file mode 100644 index 0000000..d9760e3 --- /dev/null +++ b/README.md @@ -0,0 +1,42 @@ +# Simulating single cell RNA library generation (scRNA-seq) + +Although all cells in a multicellular organism carry the same genomic information, they differ a lot in their function, due to the fact that they are equipped with distinct toolboxes of molecular functions, implemented by different proteins and RNAs. Thus, being able to detect and measure the abundance of gene products (RNAs and/or proteins) in individual cells holds the key to understanding how organisms are organized and function. In the past decade, much progress has been made in the development of technologies for single cell RNA sequencing. They make use of microfluidic devices that allow RNA-seq sample preparation for individual cells encapsulated in droplets, followed by pooling of the resulting DNA fragments and sequencing. The broadly used 10x Genomics technology uses oligo-dT primers to initiate the cDNA sequencing from the poly(A) tails of fragmented RNAs. Subsequent sequencing yields *libraries* of relatively short (100-200 nucleotides) *reads* that come predominantly from the 3’ ends of RNAs given the priming on the poly(A) tail. As in the ideal case (no amplification bias) each read came from the end of one mRNA, simply counting the reads that map to mRNAs of individual genes provides estimates of the expression levels of those genes within the respective cell. Currently, typical data sets cover thousands of genes in tens-to-hundreds of thousands of cells. However, we are still far from being able to prepare ideal libraries, for many reasons. First, as gene expression is a bursty, stochastic process, there will be fluctuations in the number of RNAs (corresponding to a given gene) that are present in any one cell at the time of sampling, even when the time-average of those RNA numbers were to be the same across cells. Secondly, the sample preparation steps are carried out by various enzymes with limited efficiency. This leads to substantial fluctuations in the number of molecules that are “captured” for a gene in a given cell, even if all cells were to have the same abundance of these molecules at the time of sampling. Third, the biochemical reactions that are part of sample preparation do not have absolute specificity. A clear example is the priming of the cDNA synthesis with oligo(dT): although the primer is intended for the poly(A) tails at the 3’ ends of RNAs, it is clear that the primer also binds to A-rich stretches that are internal to transcripts, and especially located in intronic regions. Finally, a conceptual issue with the single cell data is that one cannot apply the principle of averaging measurement values across replicate experiments to obtain more precise estimates, because we do not know which cells could be considered replicates of each other (if that is at all conceivable). + +For all of these reasons, testing the accuracy of computational analysis methods for scRNA-seq data is not trivial. One generally does not have “ground truth” data on which to benchmark computational methods, but there are various ways in which scientists get around this problem. One is to generate *in vitro* data sets for which the analysis should produce results that fall within predictable bounds. For example, this was done in one case as follows (https://www.nature.com/articles/nmeth.2930): after pooling the RNAs from many cells, the authors have sampled “single-cell equivalent” pools of RNAs, and passed them through the sample preparation protocol. In this case, the assumption that the single-cell equivalents are noisy samples from a unique vector of gene expression levels holds. Fluctuations in the estimates of expression levels were therefore due to 2 factors only: the sampling of the single-cell equivalents and the sampling steps in the sample preparation protocol. +The second approach to assessing the accuracy of computational analysis methods is to use *synthetic data*. That is, to generate data sets by simulating the experimental steps and determine whether the computational analysis can recover properties of the data that was assumed in the simulation. For example, if the goal of the computational analysis is to infer gene expression levels from scRNA-seq data, then one simulates such data assuming specific transcript abundances, which should be recovered by the computational method. In general, it is very difficult to accurately model each step of the experimental procedure, and therefore, simulations still leave out some (possibly a lot) of the complexities of the experiment. Thus, the fact that a computational method performs well on simulated data provides more of a sanity check on the method than the confidence that the method will give accurate results on *real* data. Nevertheless, such sanity checks should be done. Furthermore, simulations can help build intuitions as to which steps of the experiment have the largest consequences for the outcome, where specific behaviors may come from etc. + +In this project we will implement a procedure for sampling reads from mRNA sequences, incorporating a few sources of “noise”. These include the presence of multiple transcript isoforms from a given gene, some that are incompletely spliced, stochastic binding of primers to RNA fragments and stochastic sampling of DNA fragments for sequencing. We will then use standard methods to estimate gene expression from the simulated data. We will repeat the process multiple times, each time corresponding to a single cell. We will then compare the estimates obtained from the simulated cells with the gene expression values assumed in the simulation. We will also try to explore which steps in the sample preparation have the largest impact on the accuracy of gene expression estimates. + +Inputs to the simulation: +1. Total number of transcripts per cell and csv-formatted table “GeneID,Counts” specifying the number of transcripts that are expressed, on average, for gene GeneID in a given cell type. These can come for example from a bulk RNA-seq experiment of sorted cells of a given type. +2. File with the genome sequence +3. gff/gtf-formatted file with the transcript annotation of the genome +4. Output directory +5. Number of reads to sequence +6. Number of cells to simulate +7. Mean and standard deviation of RNA fragment length +8. Read length and nucleotide frequencies for padding +9. Probability of intron inclusion - considered constant per intron to start with, can be extended to intron-specific. In the latter case, estimates could be obtained from bulk RNA-seq data by dividing the average per-position coverage in a given intron by the average per-position coverage of the gene, or of flanking exons. +10. Option to add poly(A) tails to transcripts and an associated function for generating these tails (with specific length distribution and non-A nucleotide frequency). +11. Parameters for evaluating internal priming: primer sequence, function implementing the constraints on priming sites (accessibility, energy of interaction, perfect matching at last primer position etc.). + +The workflow will then go through the following steps, repeated for the *number of cells* times, to simulate data for multiple cells. +1. Pick the number of transcripts coming from each gene. As #input 1 we get a file with the expression level of individual transcripts from some real sample. For simplicity, we first pick a representative transcript per gene, e.g. with most annotation support (support level 1 or TSL=1). Then, given a total number of transcripts per cell (input #1, we generate, for each representative transcript, a Poisson sample given the average count from input #1. +2. Generate the exon/intron structure for each transcript. For each gene there is a reference set of exons (specified in input #3), but to account for the possibility that the transcript is not completely processed, introns are included in individual transcripts. This is done by going through all the possible introns of a transcript and choosing which ones to include (according to input #9). Then the generated structures are written to a gtf file (because new exons are effectively generated which look like exon_n;intron_n;exon_n+1) and the number of transcripts with each unique structure is also saved. +3. To start the "sample preparation" process, the transcript sequences need to be constructe based on the structure specified in the gff/gtf file and the genome sequence. Poly(A) tails are added to transcripts accoroding to input #10. +4. Knowing that during the cDNA synthesis process poly(A) stretches act as priming sites, we predict how likely it is to initiate synthesis at every position on each transcript. We assume that this depends on the energy of binding between the poly(T) primer and the stretch of transcript starting at the specified position. We run an external program to predict this energy and we thus obtain, for each each transcript a list of positions where priming as non-0 probability (according to hybridization parameters specified by input #11). +5. The possible priming sites are sampled with the probabilities computed at the previous step, to pick a site for generating the complementary DNA. +6. The resulting cDNAs are fragmented according to the parameters specified by input #7, and the end-fragments of the cDNA are selected. +7. The terminal fragments from the previous step are sampled according to input #5, to pick a fragment for sequencing. Then a piece of length input #8 is taken fromm the 5' end of the fragment to form a read. If the fragment is shorter than the read length (input #8), the fragment is padded with random sequence, given a vector of relative probability for A,C,G,T to appear in the random sequence (input #8). The output of this step will be a fasta file with "sequenced reads", which is the output of the simulation. + +We can use the simulated data to evaluate methods that map reads to genome/transcripts and quantify transcript abundance. For instance, the following analyses can be implemeted. +1. Map reads to genome - use the STAR aligner to map the reads obtained from each cell to the genome, obtaining one bam file per cell. +2. Quantify gene expression in every cell - assign reads to genes based on the genome anotation (taking into account that reads can map to more than one location in the genome) and generate a table of GeneID-count_in_cell_1-count_in_cell_2-count_in_cell_3-... +3. Calculate mean and variance of expression level for each gene across cells +4. Visualize these numbers as "M-A plots", which are countour plots where the x-axis is the average expression level, the y-axis is the variance and the contours show the density of genes with specific mean-variance values. +5. Given a GeneID and the counts per cells, construct the histogram of the counts for the gene across cells +6. Check the accuracy of gene expression inference by comparing the average input expression (input #1) with the inferred gene expression levels (calculated at step #3 above). + +Each processing step should be wrapped into a *Nextflow* process, and the whole simulation should be put together as a *Nextflow* workflow. + +For each step, test cases should be generated. diff --git a/environment-dev.yml b/environment-dev.yml new file mode 100644 index 0000000..0f63933 --- /dev/null +++ b/environment-dev.yml @@ -0,0 +1,14 @@ +name: scrnasim +channels: + - conda-forge + - bioconda +dependencies: + - black + - coverage + - flake8 + - flake8-docstrings + - mypy + - pylint + - pytest + - pip: + - -e . diff --git a/environment.yml b/environment.yml index 709fe3b..d3ae40f 100644 --- a/environment.yml +++ b/environment.yml @@ -1,21 +1,12 @@ name: scrnasim channels: - - defaults - - bioconda - conda-forge + - bioconda dependencies: - - argparse - biopython>=1.78 - - black - - coverage - - flake8 - - flake8-docstrings - - gtfparse - polars==0.16.17 - - mypy + - gtfparse - numpy>=1.23.3 - - pylint - - pytest - nextflow - pandas>=1.4.4 - pip>=20.2.3 diff --git a/scRNAsim_toolz/transcript_sampler/requirements.txt b/requirements.txt similarity index 69% rename from scRNAsim_toolz/transcript_sampler/requirements.txt rename to requirements.txt index 5dbb14e..ab66941 100644 --- a/scRNAsim_toolz/transcript_sampler/requirements.txt +++ b/requirements.txt @@ -1,6 +1,7 @@ argparse biopython +numpy>=1.23.3 +pandas>=1.4.4 polars==0.16.17 gtfparse -numpy>=1.23.3 -pandas>=1.4.4 \ No newline at end of file +setuptools diff --git a/scRNAsim_toolz/terminal_fragment_selector/__init__.py b/scRNAsim_toolz/__init__.py similarity index 100% rename from scRNAsim_toolz/terminal_fragment_selector/__init__.py rename to scRNAsim_toolz/__init__.py diff --git a/scRNAsim_toolz/cdna_generator/.gitlab-ci.yml b/scRNAsim_toolz/cdna_generator/.gitlab-ci.yml deleted file mode 100644 index 38b2edf..0000000 --- a/scRNAsim_toolz/cdna_generator/.gitlab-ci.yml +++ /dev/null @@ -1,34 +0,0 @@ -default: - tags: - - docker - image: python:3.10-slim-buster - -stages: # List of stages for jobs, and their order of execution - - build - - test - -build-job: # This job runs in the build stage, which runs first. - stage: build - script: - - pip install -r requirements.txt - - pip install -r requirements_dev.txt - - pip install -e . - -unit-test-job: # This job runs in the test stage. - stage: test # It only starts when the job in the build stage completes successfully. - script: - - pip install -r requirements.txt - - pip install -r requirements_dev.txt - - pip install -e . - - coverage run --source cdna -m pytest - - coverage report -m - -lint-test-job: # This job also runs in the test stage. - stage: test # It can run at the same time as unit-test-job (in parallel). - script: - - pip install -r requirements.txt - - pip install -r requirements_dev.txt - - pip install -e . - - flake8 --docstring-convention google cdna/ tests/ - - pylint cdna/ tests/ - - mypy cdna/ tests/ \ No newline at end of file diff --git a/scRNAsim_toolz/cdna_generator/Dockerfile b/scRNAsim_toolz/cdna_generator/Dockerfile deleted file mode 100644 index 1e8f2cb..0000000 --- a/scRNAsim_toolz/cdna_generator/Dockerfile +++ /dev/null @@ -1,46 +0,0 @@ -FROM python:3.11.1-slim-bullseye - -# set maintainer -MAINTAINER zavolab-biozentrum@unibas.ch - -# set names for user, group and user home -ARG USER="bioc" -ARG GROUP="bioc" -ARG WORKDIR="/home/${USER}" - -# create user, group, user home & makes the user and group -# the owner of the user home -RUN mkdir -p $WORKDIR \ - && groupadd -r $GROUP \ - && useradd --no-log-init -r -g $GROUP $USER \ - && chown -R ${USER}:${GROUP} $WORKDIR \ - && chmod 700 $WORKDIR - -# set the user, make sure the location where pip -# installs binaries/executables is part of the $PATH -# and set the working directory to the user's home -USER $USER -ENV PATH="${WORKDIR}/.local/bin:${PATH}" -WORKDIR $WORKDIR - -# copy entire content of the current directory to the -# working directory; ensure that this does not contain any -# files that you don't want to have end up in the Docker -# image, especially not any secrets! -# use `.dockerignore` to set files that you do NOT want -# Docker to copy -COPY --chown=${USER}:${GROUP} . $WORKDIR - -# install app and development dependencies -# assumes that dependencies in `requirements.txt` are -# automatically installed when installing the app; if -# that is not the case, they need to be installed -# _before_ installing the app -RUN pip install -e . \ - && pip install --no-cache-dir -r requirements-dev.txt - -# set default command; optional -CMD ["bash exampleInput.sh"] - - - diff --git a/scRNAsim_toolz/cdna_generator/cli.py b/scRNAsim_toolz/cdna_generator/cli.py index 5416b78..4cb1cc6 100644 --- a/scRNAsim_toolz/cdna_generator/cli.py +++ b/scRNAsim_toolz/cdna_generator/cli.py @@ -10,7 +10,7 @@ ) LOG = logging.getLogger(__name__) -from cdna.cdna import CDNAGen # noqa: E402,E501 # pylint:disable=wrong-import-position +from .cdna import CDNAGen # noqa: E402,E501 # pylint:disable=wrong-import-position def main(): diff --git a/scRNAsim_toolz/cdna_generator/requirements.txt b/scRNAsim_toolz/cdna_generator/requirements.txt deleted file mode 100644 index d9abb6b..0000000 --- a/scRNAsim_toolz/cdna_generator/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -gtfparse -biopython -pandas diff --git a/scRNAsim_toolz/cdna_generator/requirements_dev.txt b/scRNAsim_toolz/cdna_generator/requirements_dev.txt deleted file mode 100644 index 4360923..0000000 --- a/scRNAsim_toolz/cdna_generator/requirements_dev.txt +++ /dev/null @@ -1,7 +0,0 @@ -pytest -coverage -black -flake8 -flake8-docstrings -mypy -pylint diff --git a/scRNAsim_toolz/cdna_generator/setup.py b/scRNAsim_toolz/cdna_generator/setup.py deleted file mode 100644 index d57b413..0000000 --- a/scRNAsim_toolz/cdna_generator/setup.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Set up project.""" -from pathlib import Path -from setuptools import setup, find_packages - -project_root_dir = Path(__file__).parent.resolve() - -with open(project_root_dir / "requirements.txt", - "r", encoding="utf-8") as f: - INSTALL_REQUIRED = f.read().splitlines() - -URL = ('https://git.scicore.unibas.ch/zavolan_group/' - 'tools/cdna-generator') - -setup( - name='cdna-generator', - version='0.1.1', - url=URL, - license='MIT', - author='Eric Boittier, Bastian Wagner, Quentin Badolle', - author_email='me@email.org', - description='cDNA generator', - packages=find_packages(), - install_required=INSTALL_REQUIRED, - entry_points={ - 'console_scripts': [ - 'cdna-generator=cdna.cli:main' - ] - } -) diff --git a/scRNAsim_toolz/terminal_fragment_selector/README.md b/scRNAsim_toolz/fragment_selector/README.md similarity index 100% rename from scRNAsim_toolz/terminal_fragment_selector/README.md rename to scRNAsim_toolz/fragment_selector/README.md diff --git a/scRNAsim_toolz/fragment_selector/__init__.py b/scRNAsim_toolz/fragment_selector/__init__.py new file mode 100644 index 0000000..bb7d5f3 --- /dev/null +++ b/scRNAsim_toolz/fragment_selector/__init__.py @@ -0,0 +1 @@ +"""Initialise package.""" diff --git a/scRNAsim_toolz/terminal_fragment_selector/cli.py b/scRNAsim_toolz/fragment_selector/cli.py similarity index 97% rename from scRNAsim_toolz/terminal_fragment_selector/cli.py rename to scRNAsim_toolz/fragment_selector/cli.py index 37188c9..a05ca2a 100644 --- a/scRNAsim_toolz/terminal_fragment_selector/cli.py +++ b/scRNAsim_toolz/fragment_selector/cli.py @@ -3,12 +3,12 @@ import logging from pathlib import Path from Bio import SeqIO # type: ignore -import numpy as np +import numpy as np # type: ignore import pandas as pd # type: ignore -from term_frag_sel.fragmentation import fragmentation -from term_frag_sel.utils import check_positive +from .fragmentation import fragmentation +from .utils import check_positive logging.basicConfig( format='[%(asctime)s: %(levelname)s] %(message)s \ diff --git a/scRNAsim_toolz/terminal_fragment_selector/fragmentation.py b/scRNAsim_toolz/fragment_selector/fragmentation.py similarity index 100% rename from scRNAsim_toolz/terminal_fragment_selector/fragmentation.py rename to scRNAsim_toolz/fragment_selector/fragmentation.py diff --git a/scRNAsim_toolz/terminal_fragment_selector/utils.py b/scRNAsim_toolz/fragment_selector/utils.py similarity index 100% rename from scRNAsim_toolz/terminal_fragment_selector/utils.py rename to scRNAsim_toolz/fragment_selector/utils.py diff --git a/scRNAsim_toolz/priming_site_predictor/.gitlab-ci.yml b/scRNAsim_toolz/priming_site_predictor/.gitlab-ci.yml deleted file mode 100644 index 4d36a6f..0000000 --- a/scRNAsim_toolz/priming_site_predictor/.gitlab-ci.yml +++ /dev/null @@ -1,34 +0,0 @@ -default: # Set default - tags: - - docker - image: python:3.10-slim-buster - -stages: # List of stages for jobs, and their order of execution - - build - - test - -build-job: # This job runs in the build stage, which runs first. - stage: build - script: - - pip install -r requirements.txt - - pip install -r requirements_dev.txt - - pip install . - -unit-test-job: # This job runs in the test stage. - stage: test # It only starts when the job in the build stage completes successfully. - script: - - pip install -r requirements.txt - - pip install -r requirements_dev.txt - - pip install . - - coverage run --source primingsitepredictor -m pytest - - coverage report -m - -lint-test-job: # This job also runs in the test stage. - stage: test # It can run at the same time as unit-test-job (in parallel). - script: - - pip install -r requirements.txt - - pip install -r requirements_dev.txt - - pip install . - - flake8 --docstring-convention google primingsitepredictor/ - - pylint primingsitepredictor/ - - mypy primingsitepredictor/ diff --git a/scRNAsim_toolz/priming_site_predictor/cli.py b/scRNAsim_toolz/priming_site_predictor/cli.py index 530cab4..e9c105f 100644 --- a/scRNAsim_toolz/priming_site_predictor/cli.py +++ b/scRNAsim_toolz/priming_site_predictor/cli.py @@ -1,8 +1,8 @@ """Receive command line arguments.""" import argparse import logging -from primingsitepredictor.psp import CreatePrimer -from primingsitepredictor.psp import PrimingSitePredictor +from .psp import CreatePrimer +from .psp import PrimingSitePredictor LOG = logging.getLogger(__name__) diff --git a/scRNAsim_toolz/priming_site_predictor/requirements.txt b/scRNAsim_toolz/priming_site_predictor/requirements.txt deleted file mode 100644 index 8a9674c..0000000 --- a/scRNAsim_toolz/priming_site_predictor/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -argparse -biopython -numpy >= 1.23.3 -pandas >= 1.4.4 \ No newline at end of file diff --git a/scRNAsim_toolz/priming_site_predictor/requirements_dev.txt b/scRNAsim_toolz/priming_site_predictor/requirements_dev.txt deleted file mode 100644 index 19f4ed8..0000000 --- a/scRNAsim_toolz/priming_site_predictor/requirements_dev.txt +++ /dev/null @@ -1,6 +0,0 @@ -pytest -coverage -flake8 -flake8-docstrings -mypy -pylint diff --git a/scRNAsim_toolz/priming_site_predictor/setup.py b/scRNAsim_toolz/priming_site_predictor/setup.py deleted file mode 100644 index aa38ae3..0000000 --- a/scRNAsim_toolz/priming_site_predictor/setup.py +++ /dev/null @@ -1,28 +0,0 @@ -"""Set up project.""" -from pathlib import Path -from setuptools import setup, find_packages - -project_root_dir = Path(__file__).parent.resolve() -with open(project_root_dir / "requirements.txt", - "r", encoding="utf-8") as f: - INSTALL_REQUIRES = f.read().splitlines() - -URL = ('https://git.scicore.unibas.ch/zavolan_group/' - 'tools/priming-site-predictor') - - -setup( - name='primingsitepredictor', - url=URL, - author='Robin Christen & Max Baer', - author_email='robin.christen@stud.unibas.ch & max.baer@swisstph.ch', - description='Priming Site Predictor', - license='MIT,', - version='0.1.0', - packages=find_packages(), - install_requires=INSTALL_REQUIRES, - entry_points={ - 'console_scripts': [ - 'primingsitepredictor = primingsitepredictor.cli:main' - ] - }) diff --git a/scRNAsim_toolz/read_sequencer/.gitlab-ci.yml b/scRNAsim_toolz/read_sequencer/.gitlab-ci.yml deleted file mode 100644 index ae8d3a2..0000000 --- a/scRNAsim_toolz/read_sequencer/.gitlab-ci.yml +++ /dev/null @@ -1,34 +0,0 @@ -default: # Set default - tags: - - docker - image: python:3.10-slim-buster - -stages: # List of stages for jobs, and their order of execution - - build - - test - -build-job: # This job runs in the build stage, which runs first. - stage: build - script: - - pip install -r requirements.txt - - pip install -r requirements-dev.txt - - pip install -e . - -unit-test-job: # This job runs in the test stage. - stage: test # It only starts when the job in the build stage completes successfully. - script: - - pip install -r requirements.txt - - pip install -r requirements-dev.txt - - pip install -e . - - coverage run --source readsequencer -m pytest - - coverage report -m - -lint-test-job: # This job also runs in the test stage. - stage: test # It can run at the same time as unit-test-job (in parallel). - script: - - pip install -r requirements.txt - - pip install -r requirements-dev.txt - - pip install -e . - - flake8 --docstring-convention google readsequencer/ tests/ - - pylint readsequencer/ tests/ - - mypy readsequencer/ tests/ \ No newline at end of file diff --git a/scRNAsim_toolz/read_sequencer/cli.py b/scRNAsim_toolz/read_sequencer/cli.py index 89653d1..914ca8d 100644 --- a/scRNAsim_toolz/read_sequencer/cli.py +++ b/scRNAsim_toolz/read_sequencer/cli.py @@ -1,7 +1,7 @@ """Receive command line arguments.""" import argparse import logging -from readsequencer.read_sequencer import ReadSequencer +from .read_sequencer import ReadSequencer logging.basicConfig( format='[%(asctime)s: %(levelname)s] %(message)s \ diff --git a/scRNAsim_toolz/read_sequencer/requirements-dev.txt b/scRNAsim_toolz/read_sequencer/requirements-dev.txt deleted file mode 100644 index 36ace64..0000000 --- a/scRNAsim_toolz/read_sequencer/requirements-dev.txt +++ /dev/null @@ -1,7 +0,0 @@ -pytest -coverage -flake8 -flake8-docstrings -mypy -pylint -cli_test_helpers \ No newline at end of file diff --git a/scRNAsim_toolz/read_sequencer/requirements.txt b/scRNAsim_toolz/read_sequencer/requirements.txt deleted file mode 100644 index bb3fee8..0000000 --- a/scRNAsim_toolz/read_sequencer/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -Bio -argparse \ No newline at end of file diff --git a/scRNAsim_toolz/read_sequencer/setup.py b/scRNAsim_toolz/read_sequencer/setup.py deleted file mode 100644 index ceb391d..0000000 --- a/scRNAsim_toolz/read_sequencer/setup.py +++ /dev/null @@ -1,30 +0,0 @@ -"""Setup tool.""" -from pathlib import Path -from setuptools import setup, find_packages # type: ignore - -project_root_dir = Path(__file__).parent.resolve() -with open( - project_root_dir / "requirements.txt", "r", encoding="utf-8" -) as _file: - INSTALL_REQUIRES = _file.read().splitlines() - -URL = ('https://git.scicore.unibas.ch/zavolan_group/' - 'tools/read-sequencer') - -setup( - name='readsequencer', - version='0.1.1', - url=URL, - license='MIT', - author='Clara Serger, Michael Sandholzer and Christoph Harmel', - author_email='christoph.harmel@unibas.ch', - description='Simulates sequencing with a specified read length from' - 'sequences specified by a FASTA file.', - packages=find_packages(), - install_requires=INSTALL_REQUIRES, - entry_points={ - 'console_scripts': [ - 'readsequencer=readsequencer.cli:main' - ] - } -) diff --git a/scRNAsim_toolz/transcript_sequence_extractor/README.md b/scRNAsim_toolz/sequence_extractor/README.md similarity index 100% rename from scRNAsim_toolz/transcript_sequence_extractor/README.md rename to scRNAsim_toolz/sequence_extractor/README.md diff --git a/scRNAsim_toolz/transcript_sequence_extractor/__init__.py b/scRNAsim_toolz/sequence_extractor/__init__.py similarity index 100% rename from scRNAsim_toolz/transcript_sequence_extractor/__init__.py rename to scRNAsim_toolz/sequence_extractor/__init__.py diff --git a/scRNAsim_toolz/transcript_sequence_extractor/cli.py b/scRNAsim_toolz/sequence_extractor/cli.py similarity index 93% rename from scRNAsim_toolz/transcript_sequence_extractor/cli.py rename to scRNAsim_toolz/sequence_extractor/cli.py index 1b2a120..05d3186 100644 --- a/scRNAsim_toolz/transcript_sequence_extractor/cli.py +++ b/scRNAsim_toolz/sequence_extractor/cli.py @@ -1,9 +1,9 @@ """CLI to be run on output fasta file from bedtools getfasta.""" import argparse import logging -from sequence_extractor.pre_bedtools import pre_bedtools_mode -from sequence_extractor.exon_concatenation import exon_concatenation -from sequence_extractor.poly_a import poly_a_addition_to_fasta_list +from .pre_bedtools import pre_bedtools_mode +from .exon_concat import exon_concatenation +from .poly_a import poly_a_addition_to_fasta_list LOG = logging.getLogger(__name__) diff --git a/scRNAsim_toolz/transcript_sequence_extractor/exon_concatenation.py b/scRNAsim_toolz/sequence_extractor/exon_concat.py similarity index 100% rename from scRNAsim_toolz/transcript_sequence_extractor/exon_concatenation.py rename to scRNAsim_toolz/sequence_extractor/exon_concat.py diff --git a/scRNAsim_toolz/transcript_sequence_extractor/poly_a.py b/scRNAsim_toolz/sequence_extractor/poly_a.py similarity index 97% rename from scRNAsim_toolz/transcript_sequence_extractor/poly_a.py rename to scRNAsim_toolz/sequence_extractor/poly_a.py index f2cdf51..5122b02 100644 --- a/scRNAsim_toolz/transcript_sequence_extractor/poly_a.py +++ b/scRNAsim_toolz/sequence_extractor/poly_a.py @@ -1,5 +1,5 @@ """Add poly A tail to the concatenated exon.""" -import numpy as np +import numpy as np # type: ignore # To do: Taking probabilities of nucleotides from user # and raising errorif sum != 1 diff --git a/scRNAsim_toolz/transcript_sequence_extractor/pre_bedtools.py b/scRNAsim_toolz/sequence_extractor/pre_bedtools.py similarity index 100% rename from scRNAsim_toolz/transcript_sequence_extractor/pre_bedtools.py rename to scRNAsim_toolz/sequence_extractor/pre_bedtools.py diff --git a/scRNAsim_toolz/transcript_structure_generator/README.md b/scRNAsim_toolz/structure_generator/README.md similarity index 100% rename from scRNAsim_toolz/transcript_structure_generator/README.md rename to scRNAsim_toolz/structure_generator/README.md diff --git a/scRNAsim_toolz/structure_generator/__init__.py b/scRNAsim_toolz/structure_generator/__init__.py new file mode 100644 index 0000000..5a677f9 --- /dev/null +++ b/scRNAsim_toolz/structure_generator/__init__.py @@ -0,0 +1,4 @@ +"""Structure generator package.""" +from .main import Gtf, TranscriptGenerator, sample_transcripts + +__all__ = ["Gtf", "TranscriptGenerator", "sample_transcripts"] diff --git a/scRNAsim_toolz/transcript_structure_generator/__main__.py b/scRNAsim_toolz/structure_generator/__main__.py similarity index 70% rename from scRNAsim_toolz/transcript_structure_generator/__main__.py rename to scRNAsim_toolz/structure_generator/__main__.py index b4fac98..d7f0cb8 100644 --- a/scRNAsim_toolz/transcript_structure_generator/__main__.py +++ b/scRNAsim_toolz/structure_generator/__main__.py @@ -1,5 +1,5 @@ """Main module.""" -from tsg.cli import app +from .cli import app if __name__ == "__main__": app() diff --git a/scRNAsim_toolz/transcript_structure_generator/cli.py b/scRNAsim_toolz/structure_generator/cli.py similarity index 98% rename from scRNAsim_toolz/transcript_structure_generator/cli.py rename to scRNAsim_toolz/structure_generator/cli.py index 30a2dec..d9a912f 100644 --- a/scRNAsim_toolz/transcript_structure_generator/cli.py +++ b/scRNAsim_toolz/structure_generator/cli.py @@ -3,7 +3,7 @@ import logging from pathlib import Path -from tsg.main import sample_transcripts +from .main import sample_transcripts def setup_logging(loglevel: str) -> None: diff --git a/scRNAsim_toolz/transcript_structure_generator/main.py b/scRNAsim_toolz/structure_generator/main.py similarity index 99% rename from scRNAsim_toolz/transcript_structure_generator/main.py rename to scRNAsim_toolz/structure_generator/main.py index 7926ef5..eec35d9 100644 --- a/scRNAsim_toolz/transcript_structure_generator/main.py +++ b/scRNAsim_toolz/structure_generator/main.py @@ -2,7 +2,7 @@ import logging -import numpy as np +import numpy as np # type: ignore import pandas as pd # type: ignore LOG = logging.getLogger(__name__) diff --git a/scRNAsim_toolz/terminal_fragment_selector/.gitlab-ci.yml b/scRNAsim_toolz/terminal_fragment_selector/.gitlab-ci.yml deleted file mode 100644 index 0c14af8..0000000 --- a/scRNAsim_toolz/terminal_fragment_selector/.gitlab-ci.yml +++ /dev/null @@ -1,34 +0,0 @@ -default: # Set default - tags: - - docker - image: python:3.10-slim-buster - -stages: # List of stages for jobs, and their order of execution - - build - - test - -build-job: # This job runs in the build stage, which runs first. - stage: build - script: - - pip install -r requirements.txt - - pip install -r requirements_dev.txt - - pip install -e . - -unit-test-job: # This job runs in the test stage. - stage: test # It only starts when the job in the build stage completes successfully. - script: - - pip install -r requirements.txt - - pip install -r requirements_dev.txt - - pip install -e . - - coverage run --source term_frag_sel -m pytest - - coverage report -m - -lint-test-job: # This job also runs in the test stage. - stage: test # It can run at the same time as unit-test-job (in parallel). - script: - - pip install -r requirements.txt - - pip install -r requirements_dev.txt - - pip install -e . - - flake8 --docstring-convention google term_frag_sel/ tests/ - - pylint term_frag_sel/ tests/ - - mypy term_frag_sel/ tests/ diff --git a/scRNAsim_toolz/terminal_fragment_selector/requirements.txt b/scRNAsim_toolz/terminal_fragment_selector/requirements.txt deleted file mode 100644 index 8a9674c..0000000 --- a/scRNAsim_toolz/terminal_fragment_selector/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -argparse -biopython -numpy >= 1.23.3 -pandas >= 1.4.4 \ No newline at end of file diff --git a/scRNAsim_toolz/terminal_fragment_selector/requirements_dev.txt b/scRNAsim_toolz/terminal_fragment_selector/requirements_dev.txt deleted file mode 100644 index 19f4ed8..0000000 --- a/scRNAsim_toolz/terminal_fragment_selector/requirements_dev.txt +++ /dev/null @@ -1,6 +0,0 @@ -pytest -coverage -flake8 -flake8-docstrings -mypy -pylint diff --git a/scRNAsim_toolz/terminal_fragment_selector/setup.py b/scRNAsim_toolz/terminal_fragment_selector/setup.py deleted file mode 100644 index 469d786..0000000 --- a/scRNAsim_toolz/terminal_fragment_selector/setup.py +++ /dev/null @@ -1,28 +0,0 @@ -"""Set up project.""" -from pathlib import Path -from setuptools import setup, find_packages # type: ignore - -project_root_dir = Path(__file__).parent.resolve() -with open(project_root_dir / "requirements.txt", - "r", encoding="utf-8") as f: - INSTALL_REQUIRES = f.read().splitlines() - -URL = ('https://git.scicore.unibas.ch/zavolan_group/' - 'tools/terminal-fragment-selector') - -setup( - name='terminal-fragment-selector', - version='0.1.1', - url=URL, - license='MIT', - author='Hugo Madge Leon, Sunho Kim, Tanya Nandan', - author_email='hmadge@ethz.ch', - description='Terminal fragment selector', - packages=find_packages(), - install_requires=INSTALL_REQUIRES, - entry_points={ - 'console_scripts': [ - 'terminal-fragment-selector=term_frag_sel.cli:main' - ] - } -) diff --git a/scRNAsim_toolz/transcript_sampler/.gitlab-ci.yml b/scRNAsim_toolz/transcript_sampler/.gitlab-ci.yml deleted file mode 100644 index e34cd6f..0000000 --- a/scRNAsim_toolz/transcript_sampler/.gitlab-ci.yml +++ /dev/null @@ -1,34 +0,0 @@ -default: # Set default - tags: - - docker - image: python:3.10-slim-buster - -stages: # List of stages for jobs, and their order of execution - - build - - test - -build-job: # This job runs in the build stage, which runs first. - stage: build - script: - - pip install -r requirements.txt - - pip install -r requirements_dev.txt - - pip install -e . - -unit-test-job: # This job runs in the test stage. - stage: test # It only starts when the job in the build stage completes successfully. - script: - - pip install -r requirements.txt - - pip install -r requirements_dev.txt - - pip install -e . - - coverage run --source transcript_sampler -m pytest - - coverage report -m - -lint-test-job: # This job also runs in the test stage. - stage: test # It can run at the same time as unit-test-job (in parallel). - script: - - pip install -r requirements.txt - - pip install -r requirements_dev.txt - - pip install -e . - - flake8 --docstring-convention google transcript_sampler/ tests/ - - pylint transcript_sampler/ tests/ - - mypy transcript_sampler/ tests/ \ No newline at end of file diff --git a/scRNAsim_toolz/transcript_sampler/cli.py b/scRNAsim_toolz/transcript_sampler/cli.py index 13446a4..02775c3 100644 --- a/scRNAsim_toolz/transcript_sampler/cli.py +++ b/scRNAsim_toolz/transcript_sampler/cli.py @@ -9,9 +9,9 @@ level=logging.INFO, ) -from transcript_sampler.find_reptrans import FindRepTrans # noqa: E402,E501 # pylint:disable=wrong-import-position -from transcript_sampler.match_reptrans_explvl import MatchReptransExplvl # noqa: E402,E501 # pylint:disable=wrong-import-position -from transcript_sampler.poisson_sampling import SampleTranscript # noqa: E402,E501 # pylint:disable=wrong-import-position +from .find_reptrans import FindRepTrans # noqa: E402,E501 # pylint:disable=wrong-import-position # type: ignore +from .match_explvl import MatchReptransExplvl # noqa: E402,E501 # pylint:disable=wrong-import-position +from .poisson_sampling import SampleTranscript # noqa: E402,E501 # pylint:disable=wrong-import-position find_rep_trans = FindRepTrans() match_reptrs_explvl = MatchReptransExplvl() diff --git a/scRNAsim_toolz/transcript_sampler/match_reptrans_explvl.py b/scRNAsim_toolz/transcript_sampler/match_explvl.py similarity index 100% rename from scRNAsim_toolz/transcript_sampler/match_reptrans_explvl.py rename to scRNAsim_toolz/transcript_sampler/match_explvl.py diff --git a/scRNAsim_toolz/transcript_sampler/poisson_sampling.py b/scRNAsim_toolz/transcript_sampler/poisson_sampling.py index 0df129c..89f9081 100644 --- a/scRNAsim_toolz/transcript_sampler/poisson_sampling.py +++ b/scRNAsim_toolz/transcript_sampler/poisson_sampling.py @@ -1,7 +1,7 @@ """Sample transcripts by Poisson-sampling.""" -import pandas as pd # type: ignore -import numpy as np +import pandas as pd # type: ignore +import numpy as np # type: ignore # pylint: disable=R0903 diff --git a/scRNAsim_toolz/transcript_sampler/requirements_dev.txt b/scRNAsim_toolz/transcript_sampler/requirements_dev.txt deleted file mode 100644 index e4f1065..0000000 --- a/scRNAsim_toolz/transcript_sampler/requirements_dev.txt +++ /dev/null @@ -1,7 +0,0 @@ -pytest -coverage -flake8 -flake8-docstrings -pyarrow -mypy -pylint diff --git a/scRNAsim_toolz/transcript_sampler/setup.py b/scRNAsim_toolz/transcript_sampler/setup.py deleted file mode 100644 index 721659b..0000000 --- a/scRNAsim_toolz/transcript_sampler/setup.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Set up project.""" -from pathlib import Path -from setuptools import setup, find_packages # type: ignore - -project_root_dir = Path(__file__).parent.resolve() -with open(project_root_dir / "requirements.txt", - "r", encoding="utf-8") as f: - INSTALL_REQUIRES = f.read().splitlines() - -URL = 'https://git.scicore.unibas.ch/zavolan_group/tools/transcript-sampler' - -setup( - name='transcript-sampler', - version='0.2.1', - url=URL, - license='MIT', - author='Laura Urbanska, Hugo Gillet, Jakob Rien, Máté Balajti', - author_email='mate.balajti@unibas.ch', - description='Transcript sampler', - packages=find_packages(), - install_requires=INSTALL_REQUIRES, - entry_points={ - 'console_scripts': ['transcript-sampler=transcript_sampler.cli:main'] - } -) diff --git a/scRNAsim_toolz/transcript_sequence_extractor/.gitlab-ci.yml b/scRNAsim_toolz/transcript_sequence_extractor/.gitlab-ci.yml deleted file mode 100644 index 2c845cd..0000000 --- a/scRNAsim_toolz/transcript_sequence_extractor/.gitlab-ci.yml +++ /dev/null @@ -1,34 +0,0 @@ -default: # Set default - tags: - - docker - image: python:3.10-slim-buster - -stages: # List of employment runs, starts with build ends with deploy. - - build - - test - -build-job: # First stage deployment and installation of dependencies. - stage: build # Build Stage - script: - - pip install -r requirements.txt - - pip install -r requirements_dev.txt - - pip install -e . - -unit-test-job: # This job runs in the test stage. - stage: test # It only starts when the job in the build stage completes successfully. - script: - - pip install -r requirements.txt - - pip install -r requirements_dev.txt - - pip install -e . - - coverage run --source sequence_extractor -m pytest - - coverage report -m - -lint-test-job: # Test Stage - stage: test # Deploys and runs all 3 linters. - script: - - pip install -r requirements.txt - - pip install -r requirements_dev.txt - - pip install -e . - - flake8 --docstring-convention google sequence_extractor/ tests/ - - pylint sequence_extractor/ tests/ - - mypy sequence_extractor/ tests/ diff --git a/scRNAsim_toolz/transcript_sequence_extractor/requirements.txt b/scRNAsim_toolz/transcript_sequence_extractor/requirements.txt deleted file mode 100644 index c3cba87..0000000 --- a/scRNAsim_toolz/transcript_sequence_extractor/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -numpy>=1.23.3 -pandas>=1.4.4 -gtfparse -polars==0.16.17 diff --git a/scRNAsim_toolz/transcript_sequence_extractor/requirements_dev.txt b/scRNAsim_toolz/transcript_sequence_extractor/requirements_dev.txt deleted file mode 100644 index 4588ded..0000000 --- a/scRNAsim_toolz/transcript_sequence_extractor/requirements_dev.txt +++ /dev/null @@ -1,7 +0,0 @@ -pytest -coverage -black>=22.10 -flake8 -flake8-docstrings -mypy -pylint diff --git a/scRNAsim_toolz/transcript_sequence_extractor/setup.py b/scRNAsim_toolz/transcript_sequence_extractor/setup.py deleted file mode 100644 index d52e28b..0000000 --- a/scRNAsim_toolz/transcript_sequence_extractor/setup.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Set up project.""" -from pathlib import Path -from setuptools import setup, find_packages # type: ignore - -project_root_dir = Path(__file__).parent.resolve() -with open(project_root_dir / "requirements.txt", - "r", encoding="utf-8") as file: - INSTALL_REQUIRES = file.read().splitlines() - -URL = ('https://git.scicore.unibas.ch/zavolan_group/' - 'tools/transcript-sequence-extractor') - -setup( - name='transcript-sequence-extractor', - version='0.1.0', - url=URL, - license='MIT', - author='Samuel Mondal', - author_email='samuel.mondal@unibas.ch', - description=('Extracts transcript sequences from gtf file' - 'and adds polyA tail to the output sequence'), - packages=find_packages(), - install_requires=INSTALL_REQUIRES, - entry_points={ - 'console_scripts': [ - 'sequence-extractor=sequence_extractor.cli:main' - ] - } -) diff --git a/scRNAsim_toolz/transcript_structure_generator/.gitlab-ci.yml b/scRNAsim_toolz/transcript_structure_generator/.gitlab-ci.yml deleted file mode 100644 index 28ed56a..0000000 --- a/scRNAsim_toolz/transcript_structure_generator/.gitlab-ci.yml +++ /dev/null @@ -1,34 +0,0 @@ -default: - tags: - - docker - image: python:3.10-slim-buster - -stages: # List of employment runs, starts with build ends with deploy. - - build - - test - -build-job: # First stage deployment and installation of dependencies. - stage: build # Build Stage - script: - - pip install -r requirements.txt - - pip install -r requirements_dev.txt - - pip install -e . - -unit-test-job: # Test Stage - stage: test # Starts when the above build stages finishes installing dependencies. - script: - - pip install -r requirements.txt - - pip install -r requirements_dev.txt - - pip install -e . - - coverage run --source tsg -m pytest - - coverage report -m - -lint-test-job: # Test Stage - stage: test # Deploys and runs all 3 linters. - script: - - pip install -r requirements.txt - - pip install -r requirements_dev.txt - - pip install -e . - - flake8 --docstring-convention google tsg/ tests/ - - pylint tsg/ tests/ - - mypy tsg/ tests/ diff --git a/scRNAsim_toolz/transcript_structure_generator/__init__.py b/scRNAsim_toolz/transcript_structure_generator/__init__.py deleted file mode 100644 index 296c6d5..0000000 --- a/scRNAsim_toolz/transcript_structure_generator/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -"""Transcript structure generator package.""" -import importlib.metadata -from tsg.main import Gtf, TranscriptGenerator, sample_transcripts - -__version__ = importlib.metadata.version("transcript-structure-generator") -__all__ = ["Gtf", "TranscriptGenerator", "sample_transcripts"] diff --git a/scRNAsim_toolz/transcript_structure_generator/requirements.txt b/scRNAsim_toolz/transcript_structure_generator/requirements.txt deleted file mode 100644 index babdd14..0000000 --- a/scRNAsim_toolz/transcript_structure_generator/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -matplotlib -pandas diff --git a/scRNAsim_toolz/transcript_structure_generator/requirements_dev.txt b/scRNAsim_toolz/transcript_structure_generator/requirements_dev.txt deleted file mode 100644 index f973661..0000000 --- a/scRNAsim_toolz/transcript_structure_generator/requirements_dev.txt +++ /dev/null @@ -1,9 +0,0 @@ -matplotlib -pandas -pip -mypy -flake8 -flake8-docstrings -pytest -pylint -coverage diff --git a/scRNAsim_toolz/transcript_structure_generator/setup.py b/scRNAsim_toolz/transcript_structure_generator/setup.py deleted file mode 100644 index 8b652f8..0000000 --- a/scRNAsim_toolz/transcript_structure_generator/setup.py +++ /dev/null @@ -1,26 +0,0 @@ -"""Set up project.""" -from pathlib import Path -from setuptools import setup, find_packages # type: ignore - -project_root_dir = Path(__file__).parent.resolve() -with open(project_root_dir / "requirements.txt", - "r", encoding="utf-8") as f: - INSTALL_REQUIRES = f.read().splitlines() - -URL = ('https://git.scicore.unibas.ch/zavolan_group/' - 'tools/transcript-structure-generator') - -setup( - name='transcript-structure-generator', - version='0.2.0', - url=URL, - license='MIT', - author='Larissa Glass, Michael Zimmermann, Andri Fraenkl', - author_email='mate.balajti@unibas.ch', - description='Transcript structure generator', - packages=find_packages(), - install_requires=INSTALL_REQUIRES, - entry_points={ - 'console_scripts': ['transcript-structure-generator=tsg.cli:app'] - } -) diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..684599f --- /dev/null +++ b/setup.py @@ -0,0 +1,55 @@ +"""scRNAsim package definition.""" +from pathlib import Path +from setuptools import setup, find_packages # type: ignore + +# Read long description from file +with open("README.md", "r", encoding="utf-8") as fh: + LONG_DESCRIPTION = fh.read() + +# Read requirements from file +INSTALL_REQUIRES = [] +project_root_dir = Path(__file__).parent.resolve() +with open(project_root_dir / "requirements.txt", + "r", encoding="utf-8") as fh: + INSTALL_REQUIRES = fh.read().splitlines() + +setup( + name="scrnasim", + version="0.1.0", + description=( + "Repository for the tools used by scRNAsim" + ), + long_description=LONG_DESCRIPTION, + long_description_content_type="text/markdown", + url="https://github.com/zavolanlab/htsinfer", + author="Zavolan Lab, Biozentrum, University of Basel", + maintainer="Máté Balajti", + maintainer_email="mate.balajti@unibas.ch", + project_urls={ + "Repository": "https://github.com/zavolanlab/scRNAsim_toolz", + }, + packages=find_packages(), + install_requires=INSTALL_REQUIRES, + include_package_data=True, + setup_requires=[ + "setuptools_git == 1.2", + ], + entry_points={ + 'console_scripts': [ + 'transcript-sampler = scRNAsim_toolz.' + 'transcript_sampler.cli:main', + 'structure-generator = scRNAsim_toolz.' + 'structure_generator.cli:app', + 'sequence-extractor = scRNAsim_toolz.' + 'sequence_extractor.cli:main', + 'priming-site-predictor = scRNAsim_toolz.' + 'priming_site_predictor.cli:main', + 'cdna-generator = scRNAsim_toolz.' + 'cdna_generator.cli:main', + 'fragment-selector = scRNAsim_toolz.' + 'fragment_selector.cli:main', + 'read-sequencer = scRNAsim_toolz.' + 'read_sequencer.cli:main', + ], + }, +) diff --git a/tests/cdna_generator/test_cdna.py b/tests/cdna_generator/test_cdna.py index 43bb563..8eb34ed 100644 --- a/tests/cdna_generator/test_cdna.py +++ b/tests/cdna_generator/test_cdna.py @@ -1,6 +1,8 @@ """Tests for cDNA functions.""" import pytest # type: ignore -from cdna.cdna import complement, seq_complement +from ...scRNAsim_toolz.cdna_generator.cdna import ( # type: ignore + complement, seq_complement +) @pytest.mark.parametrize( diff --git a/tests/terminal_fragment_selector/__init__.py b/tests/fragment_selector/__init__.py similarity index 100% rename from tests/terminal_fragment_selector/__init__.py rename to tests/fragment_selector/__init__.py diff --git a/tests/terminal_fragment_selector/test_cli.py b/tests/fragment_selector/test_cli.py similarity index 87% rename from tests/terminal_fragment_selector/test_cli.py rename to tests/fragment_selector/test_cli.py index ca94612..78545a8 100644 --- a/tests/terminal_fragment_selector/test_cli.py +++ b/tests/fragment_selector/test_cli.py @@ -1,7 +1,9 @@ """Test cli.py functions.""" -import pytest +import pytest # type: ignore -from term_frag_sel.cli import file_validation, main # type: ignore +from ...scRNAsim_toolz.fragment_selector.cli import ( # type: ignore + file_validation, main +) FASTA_FILE = "tests/test_files/test.fasta" CSV_FILE = "tests/test_files/test.csv" diff --git a/tests/terminal_fragment_selector/test_files/test.csv b/tests/fragment_selector/test_files/test.csv similarity index 100% rename from tests/terminal_fragment_selector/test_files/test.csv rename to tests/fragment_selector/test_files/test.csv diff --git a/tests/terminal_fragment_selector/test_files/test.fasta b/tests/fragment_selector/test_files/test.fasta similarity index 100% rename from tests/terminal_fragment_selector/test_files/test.fasta rename to tests/fragment_selector/test_files/test.fasta diff --git a/tests/terminal_fragment_selector/test_files/test_tab.csv b/tests/fragment_selector/test_files/test_tab.csv similarity index 100% rename from tests/terminal_fragment_selector/test_files/test_tab.csv rename to tests/fragment_selector/test_files/test_tab.csv diff --git a/tests/terminal_fragment_selector/test_frag.py b/tests/fragment_selector/test_frag.py similarity index 86% rename from tests/terminal_fragment_selector/test_frag.py rename to tests/fragment_selector/test_frag.py index 90c0f94..62eecde 100644 --- a/tests/terminal_fragment_selector/test_frag.py +++ b/tests/fragment_selector/test_frag.py @@ -1,9 +1,11 @@ """Test utils.py functions.""" import pandas as pd # type: ignore -import pytest +import pytest # type: ignore from Bio import SeqIO # type: ignore -from term_frag_sel.fragmentation import fragmentation +from ...scRNAsim_toolz.fragment_selector.fragmentation import ( # type: ignore + fragmentation +) FASTA_FILE = "tests/test_files/test.fasta" CSV_FILE = "tests/test_files/test.csv" diff --git a/tests/terminal_fragment_selector/test_utils.py b/tests/fragment_selector/test_utils.py similarity index 82% rename from tests/terminal_fragment_selector/test_utils.py rename to tests/fragment_selector/test_utils.py index 32cf347..87eb986 100644 --- a/tests/terminal_fragment_selector/test_utils.py +++ b/tests/fragment_selector/test_utils.py @@ -1,8 +1,10 @@ """Test utils.py functions.""" import argparse -import pytest +import pytest # type: ignore -from term_frag_sel.utils import check_positive # type: ignore +from ...scRNAsim_toolz.fragment_selector.utils import ( # type: ignore + check_positive +) def test_positive(): diff --git a/tests/priming_site_predictor/test_cli.py b/tests/priming_site_predictor/test_cli.py index 624f474..403bf51 100644 --- a/tests/priming_site_predictor/test_cli.py +++ b/tests/priming_site_predictor/test_cli.py @@ -1,8 +1,10 @@ """Test functions for cli.py.""" import unittest from unittest.mock import patch -from primingsitepredictor import cli -from primingsitepredictor.cli import setup_logging +from ...scRNAsim_toolz.priming_site_predictor import cli # type: ignore +from ...scRNAsim_toolz.priming_site_predictor.cli import ( # type: ignore + setup_logging +) class TestCli(unittest.TestCase): diff --git a/tests/priming_site_predictor/test_psp.py b/tests/priming_site_predictor/test_psp.py index 988a2e2..3842cf2 100644 --- a/tests/priming_site_predictor/test_psp.py +++ b/tests/priming_site_predictor/test_psp.py @@ -4,9 +4,10 @@ from unittest import mock import math import pandas as pd # type: ignore -import pytest -from primingsitepredictor.psp import CreatePrimer -from primingsitepredictor.psp import PrimingSitePredictor +import pytest # type: ignore +from ...scRNAsim_toolz.priming_site_predictor.psp import ( # type: ignore + CreatePrimer, PrimingSitePredictor +) class TestCreatePrimer(unittest.TestCase): diff --git a/tests/read_sequencer/test_cli.py b/tests/read_sequencer/test_cli.py index b2b302c..c1c9a23 100644 --- a/tests/read_sequencer/test_cli.py +++ b/tests/read_sequencer/test_cli.py @@ -1,7 +1,7 @@ """Test cli.py.""" -import pytest +import pytest # type: ignore from cli_test_helpers import ArgvContext, shell # type: ignore -import readsequencer.cli +from ...scRNAsim_toolz.read_sequencer import cli # type: ignore def test_entrypoint(): @@ -13,7 +13,7 @@ def test_entrypoint(): def test_usage_no_args(): """Test if CLI aborts w/o arguments, displaying usage instructions.""" with ArgvContext('readsequencer'), pytest.raises(SystemExit): - readsequencer.cli.main() + cli.main() result = shell('readsequencer') diff --git a/tests/read_sequencer/test_read_sequencer.py b/tests/read_sequencer/test_read_sequencer.py index 86a589d..203145a 100644 --- a/tests/read_sequencer/test_read_sequencer.py +++ b/tests/read_sequencer/test_read_sequencer.py @@ -1,7 +1,9 @@ """Test read_sequencer.py.""" import os import glob -from readsequencer.read_sequencer import ReadSequencer +from ...scRNAsim_toolz.read_sequencer.read_sequencer import ( # type: ignore + ReadSequencer +) def test_init_default(): diff --git a/tests/transcript_sequence_extractor/__init__.py b/tests/sequence_extractor/__init__.py similarity index 100% rename from tests/transcript_sequence_extractor/__init__.py rename to tests/sequence_extractor/__init__.py diff --git a/tests/transcript_sequence_extractor/test_exon_concatenation.py b/tests/sequence_extractor/test_exon_concatenation.py similarity index 92% rename from tests/transcript_sequence_extractor/test_exon_concatenation.py rename to tests/sequence_extractor/test_exon_concatenation.py index bb91a4d..fb9e627 100644 --- a/tests/transcript_sequence_extractor/test_exon_concatenation.py +++ b/tests/sequence_extractor/test_exon_concatenation.py @@ -1,6 +1,8 @@ """Test exon_concatenation.py.""" from pathlib import Path -from sequence_extractor.exon_concatenation import exon_concatenation +from ...scRNAsim_toolz.sequence_extractor.exon_concat import ( # type: ignore + exon_concatenation +) test_dir = Path(__file__).parent.resolve() diff --git a/tests/transcript_sequence_extractor/test_files/post_bedtools_test.fa b/tests/sequence_extractor/test_files/post_bedtools_test.fa similarity index 100% rename from tests/transcript_sequence_extractor/test_files/post_bedtools_test.fa rename to tests/sequence_extractor/test_files/post_bedtools_test.fa diff --git a/tests/transcript_sequence_extractor/test_files/test.bed b/tests/sequence_extractor/test_files/test.bed similarity index 100% rename from tests/transcript_sequence_extractor/test_files/test.bed rename to tests/sequence_extractor/test_files/test.bed diff --git a/tests/transcript_sequence_extractor/test_files/test.gtf b/tests/sequence_extractor/test_files/test.gtf similarity index 100% rename from tests/transcript_sequence_extractor/test_files/test.gtf rename to tests/sequence_extractor/test_files/test.gtf diff --git a/tests/transcript_sequence_extractor/test_files/test_1.fa b/tests/sequence_extractor/test_files/test_1.fa similarity index 100% rename from tests/transcript_sequence_extractor/test_files/test_1.fa rename to tests/sequence_extractor/test_files/test_1.fa diff --git a/tests/transcript_sequence_extractor/test_files/test_2.fa b/tests/sequence_extractor/test_files/test_2.fa similarity index 100% rename from tests/transcript_sequence_extractor/test_files/test_2.fa rename to tests/sequence_extractor/test_files/test_2.fa diff --git a/tests/transcript_sequence_extractor/test_poly_a.py b/tests/sequence_extractor/test_poly_a.py similarity index 89% rename from tests/transcript_sequence_extractor/test_poly_a.py rename to tests/sequence_extractor/test_poly_a.py index c22e833..29d3a95 100644 --- a/tests/transcript_sequence_extractor/test_poly_a.py +++ b/tests/sequence_extractor/test_poly_a.py @@ -1,7 +1,6 @@ """Test poly_a.py script.""" - -import numpy as np -from sequence_extractor.poly_a import ( +import numpy as np # type: ignore +from ...scRNAsim_toolz.sequence_extractor.poly_a import ( # type: ignore poly_a_generator, poly_a_addition_to_fasta_list ) diff --git a/tests/transcript_structure_generator/__init__.py b/tests/structure_generator/__init__.py similarity index 100% rename from tests/transcript_structure_generator/__init__.py rename to tests/structure_generator/__init__.py diff --git a/tests/transcript_structure_generator/resources/Annotation1.gtf b/tests/structure_generator/resources/Annotation1.gtf similarity index 100% rename from tests/transcript_structure_generator/resources/Annotation1.gtf rename to tests/structure_generator/resources/Annotation1.gtf diff --git a/tests/transcript_structure_generator/resources/Annotations2.gtf b/tests/structure_generator/resources/Annotations2.gtf similarity index 100% rename from tests/transcript_structure_generator/resources/Annotations2.gtf rename to tests/structure_generator/resources/Annotations2.gtf diff --git a/tests/transcript_structure_generator/resources/Transcript1.csv b/tests/structure_generator/resources/Transcript1.csv similarity index 100% rename from tests/transcript_structure_generator/resources/Transcript1.csv rename to tests/structure_generator/resources/Transcript1.csv diff --git a/tests/transcript_structure_generator/resources/Transcript2.tsv b/tests/structure_generator/resources/Transcript2.tsv similarity index 100% rename from tests/transcript_structure_generator/resources/Transcript2.tsv rename to tests/structure_generator/resources/Transcript2.tsv diff --git a/tests/transcript_structure_generator/test_main.py b/tests/structure_generator/test_main.py similarity index 96% rename from tests/transcript_structure_generator/test_main.py rename to tests/structure_generator/test_main.py index fd7718a..2c4e500 100644 --- a/tests/transcript_structure_generator/test_main.py +++ b/tests/structure_generator/test_main.py @@ -1,7 +1,8 @@ """Tests for main module.""" - import pandas as pd # type: ignore -from tsg.main import Gtf, TranscriptGenerator, dict_to_str, str_to_dict +from ...scRNAsim_toolz.structure_generator.main import ( # type: ignore + Gtf, TranscriptGenerator, dict_to_str, str_to_dict +) class TestFreeTextParsing: diff --git a/tests/transcript_sampler/tests/__init__.py b/tests/transcript_sampler/__init__.py similarity index 100% rename from tests/transcript_sampler/tests/__init__.py rename to tests/transcript_sampler/__init__.py diff --git a/tests/transcript_sampler/tests/inputs/.gitkeep b/tests/transcript_sampler/inputs/.gitkeep similarity index 100% rename from tests/transcript_sampler/tests/inputs/.gitkeep rename to tests/transcript_sampler/inputs/.gitkeep diff --git a/tests/transcript_sampler/tests/inputs/expression.csv b/tests/transcript_sampler/inputs/expression.csv similarity index 100% rename from tests/transcript_sampler/tests/inputs/expression.csv rename to tests/transcript_sampler/inputs/expression.csv diff --git a/tests/transcript_sampler/tests/inputs/test.gtf b/tests/transcript_sampler/inputs/test.gtf similarity index 100% rename from tests/transcript_sampler/tests/inputs/test.gtf rename to tests/transcript_sampler/inputs/test.gtf diff --git a/tests/transcript_sampler/tests/inputs/test_dict_repr_trans.txt b/tests/transcript_sampler/inputs/test_dict_repr_trans.txt similarity index 100% rename from tests/transcript_sampler/tests/inputs/test_dict_repr_trans.txt rename to tests/transcript_sampler/inputs/test_dict_repr_trans.txt diff --git a/tests/transcript_sampler/tests/inputs/test_gencode.vM31.annotation_intermediat_file.txt b/tests/transcript_sampler/inputs/test_gencode.vM31.annotation_intermediat_file.txt similarity index 100% rename from tests/transcript_sampler/tests/inputs/test_gencode.vM31.annotation_intermediat_file.txt rename to tests/transcript_sampler/inputs/test_gencode.vM31.annotation_intermediat_file.txt diff --git a/tests/transcript_sampler/tests/inputs/test_gene_exprL b/tests/transcript_sampler/inputs/test_gene_exprL similarity index 100% rename from tests/transcript_sampler/tests/inputs/test_gene_exprL rename to tests/transcript_sampler/inputs/test_gene_exprL diff --git a/tests/transcript_sampler/tests/inputs/test_gene_exprL_csv.csv b/tests/transcript_sampler/inputs/test_gene_exprL_csv.csv similarity index 100% rename from tests/transcript_sampler/tests/inputs/test_gene_exprL_csv.csv rename to tests/transcript_sampler/inputs/test_gene_exprL_csv.csv diff --git a/tests/transcript_sampler/tests/inputs/test_ref_output.tsv b/tests/transcript_sampler/inputs/test_ref_output.tsv similarity index 100% rename from tests/transcript_sampler/tests/inputs/test_ref_output.tsv rename to tests/transcript_sampler/inputs/test_ref_output.tsv diff --git a/tests/transcript_sampler/tests/test_functions.py b/tests/transcript_sampler/test_functions.py similarity index 98% rename from tests/transcript_sampler/tests/test_functions.py rename to tests/transcript_sampler/test_functions.py index a81b075..a3e37e5 100644 --- a/tests/transcript_sampler/tests/test_functions.py +++ b/tests/transcript_sampler/test_functions.py @@ -1,7 +1,7 @@ """Tests functions.""" import os import pandas as pd # type: ignore -import numpy as np +import numpy as np # type: ignore # pylint: disable=C0103 diff --git a/tests/transcript_sampler/tests/test_match_reptrans_explvl.py b/tests/transcript_sampler/test_match_reptrans_explvl.py similarity index 97% rename from tests/transcript_sampler/tests/test_match_reptrans_explvl.py rename to tests/transcript_sampler/test_match_reptrans_explvl.py index 495155d..7da6e3d 100644 --- a/tests/transcript_sampler/tests/test_match_reptrans_explvl.py +++ b/tests/transcript_sampler/test_match_reptrans_explvl.py @@ -1,12 +1,13 @@ """Tests for match representative transcript with expression level.""" -import pytest +import pytest # type: ignore import pandas as pd # type: ignore -import numpy as np +import numpy as np # type: ignore from pandas.testing import assert_frame_equal # type: ignore -from transcript_sampler.match_reptrans_explvl import ( + +from ...scRNAsim_toolz.transcript_sampler.match_explvl import ( # type: ignore MatchReptransExplvl as match ) -import tests.test_functions as tFun +import test_functions as tFun # type: ignore class TestMatchReptrans: