Renaming project to NSBDiagnosisToolkit
This commit is contained in:
parent
6ff0dca3ae
commit
2cd56ca1ec
2
.vscode/launch.json
vendored
2
.vscode/launch.json
vendored
@ -9,7 +9,7 @@
|
|||||||
"name": "Python Debugger: Current File with Arguments",
|
"name": "Python Debugger: Current File with Arguments",
|
||||||
"type": "debugpy",
|
"type": "debugpy",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "${workspaceFolder}/src/mlstmyfasta/cli/program.py",
|
"program": "${workspaceFolder}/src/nsbdiagnosistoolkit/cli/program.py",
|
||||||
"console": "integratedTerminal",
|
"console": "integratedTerminal",
|
||||||
"args": [
|
"args": [
|
||||||
"-fa",
|
"-fa",
|
||||||
|
2
Jenkinsfile
vendored
2
Jenkinsfile
vendored
@ -27,7 +27,7 @@ pipeline {
|
|||||||
stage("test installation") {
|
stage("test installation") {
|
||||||
steps {
|
steps {
|
||||||
sh "python3.11 -m pip install dist/*.whl --force-reinstall"
|
sh "python3.11 -m pip install dist/*.whl --force-reinstall"
|
||||||
sh "mlstmyfasta -h"
|
sh "nsbdiagnosistoolkit -h"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage("archive") {
|
stage("archive") {
|
||||||
|
@ -3,7 +3,7 @@ requires = ["setuptools >= 61.0"]
|
|||||||
build-backend = "setuptools.build_meta"
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "mlstmyfasta"
|
name = "nsbdiagnosistoolkit"
|
||||||
dynamic = ["version"]
|
dynamic = ["version"]
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"biopython",
|
"biopython",
|
||||||
@ -13,7 +13,7 @@ requires-python = ">=3.11"
|
|||||||
description = "A tool to rapidly fetch fetch MLST profiles given sequences for various diseases."
|
description = "A tool to rapidly fetch fetch MLST profiles given sequences for various diseases."
|
||||||
|
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
mlstmyfasta = "mlstmyfasta.cli.program:cli"
|
nsbdiagnosistoolkit = "nsbdiagnosistoolkit.cli.program:cli"
|
||||||
|
|
||||||
[tool.pyright]
|
[tool.pyright]
|
||||||
extraPaths = ["src"]
|
extraPaths = ["src"]
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
from os import path
|
from os import path
|
||||||
from typing import Any, AsyncGenerator, AsyncIterable, Iterable, Sequence
|
from typing import Any, AsyncGenerator, AsyncIterable, Iterable, Sequence
|
||||||
from mlstmyfasta.engine.data.MLST import MLSTProfile
|
from nsbdiagnosistoolkit.engine.data.MLST import MLSTProfile
|
||||||
from mlstmyfasta.engine.data.genomics import NamedString
|
from nsbdiagnosistoolkit.engine.data.genomics import NamedString
|
||||||
from mlstmyfasta.engine.local.abif import read_abif
|
from nsbdiagnosistoolkit.engine.local.abif import read_abif
|
||||||
from mlstmyfasta.engine.local.fasta import read_fasta
|
from nsbdiagnosistoolkit.engine.local.fasta import read_fasta
|
||||||
from mlstmyfasta.engine.remote.databases.institutpasteur.profiling import InstitutPasteurProfiler
|
from nsbdiagnosistoolkit.engine.remote.databases.institutpasteur.profiling import InstitutPasteurProfiler
|
||||||
|
|
||||||
|
|
||||||
async def aggregate_sequences(fastas: Iterable[str], abifs: Iterable[str]) -> AsyncGenerator[str, Any]:
|
async def aggregate_sequences(fastas: Iterable[str], abifs: Iterable[str]) -> AsyncGenerator[str, Any]:
|
@ -2,11 +2,11 @@ import argparse
|
|||||||
import asyncio
|
import asyncio
|
||||||
from os import path
|
from os import path
|
||||||
|
|
||||||
from mlstmyfasta.cli import aggregator
|
from nsbdiagnosistoolkit.cli import aggregator
|
||||||
from mlstmyfasta.engine.data.genomics import NamedString
|
from nsbdiagnosistoolkit.engine.data.genomics import NamedString
|
||||||
from mlstmyfasta.engine.local.abif import read_abif
|
from nsbdiagnosistoolkit.engine.local.abif import read_abif
|
||||||
from mlstmyfasta.engine.local.csv import write_mlst_profiles_as_csv
|
from nsbdiagnosistoolkit.engine.local.csv import write_mlst_profiles_as_csv
|
||||||
from mlstmyfasta.engine.local.fasta import read_fasta
|
from nsbdiagnosistoolkit.engine.local.fasta import read_fasta
|
||||||
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
@ -6,8 +6,8 @@ from Bio import Entrez
|
|||||||
from Bio import SeqIO
|
from Bio import SeqIO
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
from mlstmyfasta.engine.data.genomics import AnnotatedString, StringAnnotation
|
from nsbdiagnosistoolkit.engine.data.genomics import AnnotatedString, StringAnnotation
|
||||||
from mlstmyfasta.engine.remote.databases.ncbi.genbank import fetch_ncbi_genbank
|
from nsbdiagnosistoolkit.engine.remote.databases.ncbi.genbank import fetch_ncbi_genbank
|
||||||
|
|
||||||
|
|
||||||
async def annotate_from_genbank(genbank_id: str, query_name: str, query_string: str, max_annotation_length:int = 512, gene_targets:Set = set()):
|
async def annotate_from_genbank(genbank_id: str, query_name: str, query_string: str, max_annotation_length:int = 512, gene_targets:Set = set()):
|
@ -2,7 +2,7 @@ import asyncio
|
|||||||
from numbers import Number
|
from numbers import Number
|
||||||
from os import path
|
from os import path
|
||||||
from typing import Sequence, Union
|
from typing import Sequence, Union
|
||||||
from mlstmyfasta.engine.data.genomics import SangerTraceData
|
from nsbdiagnosistoolkit.engine.data.genomics import SangerTraceData
|
||||||
from Bio.SeqRecord import SeqRecord
|
from Bio.SeqRecord import SeqRecord
|
||||||
from Bio import SeqIO
|
from Bio import SeqIO
|
||||||
|
|
@ -3,7 +3,7 @@ from io import TextIOWrapper
|
|||||||
from os import PathLike
|
from os import PathLike
|
||||||
from typing import AsyncIterable, Iterable, Mapping, Sequence, Union
|
from typing import AsyncIterable, Iterable, Mapping, Sequence, Union
|
||||||
|
|
||||||
from mlstmyfasta.engine.data.MLST import Allele, MLSTProfile
|
from nsbdiagnosistoolkit.engine.data.MLST import Allele, MLSTProfile
|
||||||
|
|
||||||
|
|
||||||
def loci_alleles_variants_from_loci(alleles_map: Mapping[str, Sequence[Allele]]):
|
def loci_alleles_variants_from_loci(alleles_map: Mapping[str, Sequence[Allele]]):
|
@ -3,7 +3,7 @@ from io import TextIOWrapper
|
|||||||
from typing import Any, AsyncGenerator, Generator, Sequence, Union
|
from typing import Any, AsyncGenerator, Generator, Sequence, Union
|
||||||
from Bio import SeqIO
|
from Bio import SeqIO
|
||||||
|
|
||||||
from mlstmyfasta.engine.data.genomics import NamedString
|
from nsbdiagnosistoolkit.engine.data.genomics import NamedString
|
||||||
|
|
||||||
async def read_fasta(handle: Union[str, TextIOWrapper]) -> AsyncGenerator[NamedString, Any]:
|
async def read_fasta(handle: Union[str, TextIOWrapper]) -> AsyncGenerator[NamedString, Any]:
|
||||||
fasta_sequences = asyncio.to_thread(SeqIO.parse, handle=handle, format="fasta")
|
fasta_sequences = asyncio.to_thread(SeqIO.parse, handle=handle, format="fasta")
|
@ -3,8 +3,8 @@ from contextlib import AbstractAsyncContextManager
|
|||||||
import re
|
import re
|
||||||
from typing import Any, AsyncGenerator, AsyncIterable, Generator, Iterable, Sequence, Union
|
from typing import Any, AsyncGenerator, AsyncIterable, Generator, Iterable, Sequence, Union
|
||||||
from aiohttp import ClientSession, ClientTimeout
|
from aiohttp import ClientSession, ClientTimeout
|
||||||
from mlstmyfasta.engine.data.MLST import Allele, MLSTProfile
|
from nsbdiagnosistoolkit.engine.data.MLST import Allele, MLSTProfile
|
||||||
from mlstmyfasta.engine.data.genomics import NamedString
|
from nsbdiagnosistoolkit.engine.data.genomics import NamedString
|
||||||
|
|
||||||
class InstitutPasteurProfiler(AbstractAsyncContextManager):
|
class InstitutPasteurProfiler(AbstractAsyncContextManager):
|
||||||
|
|
@ -5,7 +5,7 @@ from Bio import SeqIO
|
|||||||
# TODO Change this out for a more professional approach
|
# TODO Change this out for a more professional approach
|
||||||
Entrez.email = "yunyangdeng@outlook.com"
|
Entrez.email = "yunyangdeng@outlook.com"
|
||||||
|
|
||||||
from mlstmyfasta.engine.data.genomics import AnnotatedString, StringAnnotation
|
from nsbdiagnosistoolkit.engine.data.genomics import AnnotatedString, StringAnnotation
|
||||||
|
|
||||||
|
|
||||||
async def fetch_ncbi_genbank(genbank_id: str) -> AnnotatedString:
|
async def fetch_ncbi_genbank(genbank_id: str) -> AnnotatedString:
|
@ -1,6 +1,6 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
from mlstmyfasta.engine.local.abif import read_abif
|
from nsbdiagnosistoolkit.engine.local.abif import read_abif
|
||||||
|
|
||||||
async def test_load_sanger_sequence_has_data():
|
async def test_load_sanger_sequence_has_data():
|
||||||
assert os.path.exists("tests/resources/1I1_F_P1815443_047.ab1")
|
assert os.path.exists("tests/resources/1I1_F_P1815443_047.ab1")
|
@ -1,4 +1,4 @@
|
|||||||
from mlstmyfasta.engine.local.fasta import read_fasta
|
from nsbdiagnosistoolkit.engine.local.fasta import read_fasta
|
||||||
|
|
||||||
|
|
||||||
async def test_fasta_reader_not_none():
|
async def test_fasta_reader_not_none():
|
@ -1,6 +1,6 @@
|
|||||||
from Bio import SeqIO
|
from Bio import SeqIO
|
||||||
from mlstmyfasta.engine.data.MLST import Allele, MLSTProfile
|
from nsbdiagnosistoolkit.engine.data.MLST import Allele, MLSTProfile
|
||||||
from mlstmyfasta.engine.remote.databases.institutpasteur.profiling import InstitutPasteurProfiler
|
from nsbdiagnosistoolkit.engine.remote.databases.institutpasteur.profiling import InstitutPasteurProfiler
|
||||||
|
|
||||||
|
|
||||||
async def test_profiling_results_in_exact_matches_when_exact():
|
async def test_profiling_results_in_exact_matches_when_exact():
|
@ -1,4 +1,4 @@
|
|||||||
from mlstmyfasta.engine.remote.databases.ncbi.genbank import fetch_ncbi_genbank
|
from nsbdiagnosistoolkit.engine.remote.databases.ncbi.genbank import fetch_ncbi_genbank
|
||||||
|
|
||||||
|
|
||||||
async def test_fetch_ncbi_genbank_with_id_works():
|
async def test_fetch_ncbi_genbank_with_id_works():
|
@ -1,7 +1,7 @@
|
|||||||
from mlstmyfasta.engine.annotate import annotate_from_genbank, fetch_ncbi_genbank
|
from nsbdiagnosistoolkit.engine.annotate import annotate_from_genbank, fetch_ncbi_genbank
|
||||||
from Bio import SeqIO
|
from Bio import SeqIO
|
||||||
|
|
||||||
from mlstmyfasta.engine.data.genomics import AnnotatedString
|
from nsbdiagnosistoolkit.engine.data.genomics import AnnotatedString
|
||||||
|
|
||||||
async def test_annotate_from_genbank_for_adk_annotation():
|
async def test_annotate_from_genbank_for_adk_annotation():
|
||||||
sequence = str(SeqIO.read("tests/resources/tohama_I_bpertussis.fasta", "fasta").seq)
|
sequence = str(SeqIO.read("tests/resources/tohama_I_bpertussis.fasta", "fasta").seq)
|
Loading…
x
Reference in New Issue
Block a user