-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from jodyphelan/dev
Dev
- Loading branch information
Showing
9 changed files
with
321 additions
and
323 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.