mimseq
Advanced tools
| import hashlib | ||
| import os | ||
| import subprocess | ||
| import yaml | ||
| def read_yaml(filepath = 'tests/md5sums.yml'): | ||
| with open(filepath, 'r') as infile: | ||
| yaml_dict = yaml.load(infile.read(), Loader=yaml.Loader) | ||
| return yaml_dict | ||
| def get_md5(filepath, encoding = 'utf-8'): | ||
| with open(filepath, 'r') as file: | ||
| md5sum = hashlib.md5(file.read().encode(encoding)).hexdigest() | ||
| return md5sum | ||
| def check_snapshot_md5sums(files): | ||
| all_equal = True | ||
| for snapshot in files: | ||
| observed_md5 = get_md5(snapshot['path']) | ||
| expected_md5 = snapshot['md5sum'] | ||
| if observed_md5 != expected_md5: | ||
| all_equal = False | ||
| print("md5sum changed for", snapshot['path'], '\n\texpected:', expected_md5, "observed:", observed_md5) | ||
| return all_equal | ||
| def run_cli(command): | ||
| out = subprocess.run( | ||
| command, | ||
| shell=True, | ||
| text=True, | ||
| capture_output=True, | ||
| ) | ||
| if out.returncode: | ||
| print(out.stdout) | ||
| print(out.stderr) | ||
| return out | ||
| def test_cli(): | ||
| mimseq_out = run_cli( | ||
| "mimseq --species Hsap --cluster-id 0.97 --threads 2 --min-cov 0.0005 --max-mismatches 0.075 --control-condition HEK293T -n hg38_test --out-dir test_cli --max-multi 4 --remap --remap-mismatches 0.05 tests/data/sampleData_subset_HEKvsK562.txt" | ||
| ) | ||
| is_success = mimseq_out.returncode == 0 | ||
| snapshot_files = read_yaml('tests/md5sums.yml')['test_cli'] | ||
| assert is_success and check_snapshot_md5sums(snapshot_files) | ||
| # def test_cli_local_modomics(): | ||
| # mimseq_out = run_cli( | ||
| # "mimseq --species Hsap --cluster-id 0.97 --threads 2 --min-cov 0.0005 --max-mismatches 0.075 --control-condition HEK293T -n hg38_test --out-dir test_cli_local_modomics --max-multi 4 --remap --remap-mismatches 0.05 --local-modomics tests/data/sampleData_subset_HEKvsK562.txt" | ||
| # ) | ||
| # is_success = mimseq_out.returncode == 0 | ||
| # snapshot_files = read_yaml('tests/md5sums.yml')['test_cli_local_modomics'] | ||
| # assert is_success and check_snapshot_md5sums(snapshot_files) |
| Metadata-Version: 2.1 | ||
| Name: mimseq | ||
| Version: 1.3.9 | ||
| Version: 1.3.10 | ||
| Summary: Custom high-throughput tRNA sequencing alignment and quantification pipeline based on modification induced misincorporation cDNA synthesis. | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/nedialkova-lab/mim-tRNAseq |
@@ -172,2 +172,3 @@ LICENSE.txt | ||
| mimseq/data/schiPomb-eColitK/schiPomb_972H-tRNAs.fa | ||
| mimseq/data/schiPomb-eColitK/schiPomb_eschColi-tRNAs.out | ||
| mimseq/data/schiPomb-eColitK/schiPomb_eschColi-tRNAs.out | ||
| tests/test_cli.py |
@@ -129,4 +129,2 @@ #!/usr/bin/env python3 | ||
| anticodon = data['anticodon'] | ||
| if anticodon == None: | ||
| print(data) | ||
| new_anticodon = getUnmodSeq(anticodon, modifications) | ||
@@ -278,3 +276,3 @@ if "N" in new_anticodon: | ||
| for data in modifications_table.values(): | ||
| modifications[data["abbrev"].strip()] = {'name':data["name"].strip(), 'abbr':data["short_name"].strip(), 'ref':data["reference_moiety"][0].strip()} | ||
| modifications[data["new_abbrev"].strip()] = {'name':data["name"].strip(), 'abbr':data["short_name"].strip(), 'ref':data["reference_moiety"][0].strip()} | ||
@@ -281,0 +279,0 @@ elif not fetch: |
@@ -1,1 +0,1 @@ | ||
| __version__ = "v1.3.9" | ||
| __version__ = "v1.3.10" |
+1
-1
| Metadata-Version: 2.1 | ||
| Name: mimseq | ||
| Version: 1.3.9 | ||
| Version: 1.3.10 | ||
| Summary: Custom high-throughput tRNA sequencing alignment and quantification pipeline based on modification induced misincorporation cDNA synthesis. | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/nedialkova-lab/mim-tRNAseq |
+7
-1
@@ -43,5 +43,11 @@ <p align="center"> | ||
| conda activate mimseq | ||
| mamba install -c bioconda mimseq | ||
| mamba install -c conda-forge -c bioconda mimseq | ||
| ``` | ||
| Sometimes using `mamba` we have noticed that very old versions of `mimseq` are installed. Please check using `mimseq --version` that you have the latest [version](https://github.com/nedialkova-lab/mim-tRNAseq/blob/master/mimseq/version.py) installed. If not, try running the following in your `mimseq` environment: | ||
| ``` | ||
| mamba install mimseq=VERSION | ||
| #replace VERSION with version number, e.g., mimseq=1.3.9 | ||
| ``` | ||
| usearch needs to be acquired and installed. Please do the following: | ||
@@ -48,0 +54,0 @@ ```bash |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
17725842
0.01%175
0.57%3655
1.22%