Skip to content

Commit

Permalink
Merge pull request #36 from jodyphelan/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
jodyphelan authored Mar 22, 2024
2 parents a2cca8f + 7470f7e commit e47f7fc
Show file tree
Hide file tree
Showing 9 changed files with 321 additions and 323 deletions.
4 changes: 2 additions & 2 deletions ntm_profiler/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .utils import *
from .output import *
from .reformat import *
from .db import *
__version__="0.3.0"

__version__="0.4.0"
76 changes: 0 additions & 76 deletions ntm_profiler/db.py

This file was deleted.

33 changes: 33 additions & 0 deletions ntm_profiler/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
from pathogenprofiler import models, object_list2text
from pathogenprofiler.models import Gene, Variant, BarcodeResult, DrGene, DrVariant, SpeciesPrediction, BamQC, FastaQC, VcfQC, FastqQC
from pydantic import BaseModel
from typing import List, Optional, Union


class Result(BaseModel):
id: str

class SpeciesResult(Result):
result_type: str = 'Species'
species: SpeciesPrediction
qc: Union[FastqQC,FastaQC]

class ProfileResult(SpeciesResult):
result_type: str = 'Profile'
notes: List[str] = []
resistance_db: dict = {}
barcode: Optional[List[BarcodeResult]] = []
dr_variants: List[DrVariant] = []
dr_genes: List[DrGene] = []
other_variants: List[Variant] = []
other_genes: List[Gene] = []
fail_variants: List[Variant] = []
qc: Union[BamQC, FastaQC, VcfQC]
result_type: str = 'Profile'

def get_qc(self):
if isinstance(self.qc, (BamQC, FastaQC)):
text = object_list2text(l = self.qc.target_qc)
else:
text = "Not available for VCF input"
return text
Loading

0 comments on commit e47f7fc

Please sign in to comment.