Skip to content

Commit

Permalink
Rename "error" to "code" in defects.csv
Browse files Browse the repository at this point in the history
  • Loading branch information
Donaim committed Jul 29, 2024
1 parent 0eec88b commit 04596a7
Show file tree
Hide file tree
Showing 22 changed files with 14 additions and 20,641 deletions.
2 changes: 1 addition & 1 deletion src/cfeintact/defect.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,4 @@ def __str__(self) -> str:
@dataclass(frozen=True)
class Defect:
qseqid: str
error: DefectType
code: DefectType
2 changes: 1 addition & 1 deletion src/cfeintact/intact.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ def write(self, sequence, subtype, is_intact, regions, defects, holistic):

defects_dicts = [{
"qseqid": d.qseqid,
"error": d.error.__class__.__name__,
"code": d.error.__class__.__name__,
"message": str(d.error),
"region": d.error.q.name if isinstance(d.error, ORFDefect) else None,
} for d in defects]
Expand Down
65 changes: 1 addition & 64 deletions tests/expected-results-edgy/defects.json
Original file line number Diff line number Diff line change
@@ -1,64 +1 @@
{
"Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455": [
{
"qseqid": "Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455",
"error": "Frameshift",
"message": "ORF 'vpr' at 5559-5850 contains out of frame indels that impact 61 positions.",
"region": "vpr"
},
{
"qseqid": "Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455",
"error": "InternalStop",
"message": "ORF 'vpr' at 5559-5850 contains an internal stop codon at 5793.",
"region": "vpr"
},
{
"qseqid": "Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455",
"error": "MutatedStopCodon",
"message": "ORF 'vpr' has a mutated stop codon: 'GAC'.",
"region": "vpr"
},
{
"qseqid": "Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455",
"error": "Deletion",
"message": "ORF 'vpu' exceeds maximum deletion tolerance. Contains 30 deletions with max tolerance of 6 deletions.",
"region": "vpu"
},
{
"qseqid": "Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455",
"error": "SequenceDivergence",
"message": "ORF 'vpu' exceeds maximum distance tolerance. It is 2.00873 units of distance away from its reference ORF's aminoacid sequence with max tolerance of 1.07949.",
"region": "vpu"
},
{
"qseqid": "Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455",
"error": "MutatedStartCodon",
"message": "ORF 'vpu' has a mutated start codon: 'ACG'.",
"region": "vpu"
},
{
"qseqid": "Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455",
"error": "Frameshift",
"message": "ORF 'tat_exon2' at 8377-8469 contains out of frame indels that impact 32 positions.",
"region": "tat_exon2"
},
{
"qseqid": "Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455",
"error": "Deletion",
"message": "ORF 'tat_exon2' exceeds maximum deletion tolerance. Contains 45 deletions with max tolerance of 0 deletions.",
"region": "tat_exon2"
},
{
"qseqid": "Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455",
"error": "Frameshift",
"message": "ORF 'nef' at 8797-9417 contains out of frame indels that impact 168 positions.",
"region": "nef"
},
{
"qseqid": "Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455",
"error": "InternalStop",
"message": "ORF 'nef' at 8797-9417 contains an internal stop codon at 9166.",
"region": "nef"
}
]
}
{}
17 changes: 1 addition & 16 deletions tests/expected-results-edgy/holistic.json
Original file line number Diff line number Diff line change
@@ -1,16 +1 @@
{
"Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455": {
"intact": false,
"qlen": 9719,
"hypermutation_probablility": 0.0,
"inferred_subtype": "Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE",
"blast_matched_qlen": 9719,
"blast_sseq_coverage": 1.130479522535501,
"blast_qseq_coverage": 1.1304660973351168,
"blast_sseq_orfs_coverage": 1.0,
"orfs_start": 789,
"orfs_end": 8793,
"blast_n_conseqs": 3,
"is_reverse_complement": false
}
}
{}
159 changes: 1 addition & 158 deletions tests/expected-results-edgy/regions.json

Large diffs are not rendered by default.

261 changes: 0 additions & 261 deletions tests/expected-results-large-csv/defects.csv

Large diffs are not rendered by default.

41 changes: 0 additions & 41 deletions tests/expected-results-large-csv/holistic.csv
Original file line number Diff line number Diff line change
@@ -1,42 +1 @@
qseqid,intact,qlen,hypermutation_probablility,inferred_subtype,blast_matched_qlen,blast_sseq_coverage,blast_qseq_coverage,blast_sseq_orfs_coverage,orfs_start,orfs_end,blast_n_conseqs,is_reverse_complement
KX505501.1,False,1997,0.7087072014754221,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,1997,0.2498456472525211,1.2158237356034052,0.17666166916541728,789,8793,4,False
MN691959,False,9493,0.19667690182893238,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9493,1.0817040543321672,1.1086063415148004,1.0,789,8793,3,False
MN692074,False,4178,0.36378645339477633,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,4178,0.5042189750977567,1.1728099569171853,0.411544227886057,789,8793,4,False
MN692145,True,9689,0.1672411051048176,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9689,1.130479522535501,1.1271545051088863,1.0,789,8793,3,False
MN090335,False,9069,0.1771850809736527,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9069,0.9842560197571517,1.0603153600176425,1.000374812593703,789,8793,3,False
MN090376,False,8985,0.026415767987601813,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,8985,0.9784935171846059,1.0604340567612687,0.9943778110944528,789,8793,3,False
MK115581.1,True,9495,0.6919440876652894,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9495,0.987034369211772,1.0046340179041602,1.0,789,8793,2,False
MK115690.1,False,9689,0.051230576250981485,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9689,1.004630582424367,1.0113530808132933,1.0,789,8793,3,False
MK115571.1,False,9394,0.8029570594372466,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9394,0.9866227618851615,1.0113902490951672,1.0,789,8793,2,False
MK115514.1,False,9382,0.6482462132632603,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9382,0.9864169582218564,1.0173736943082499,1.0,789,8793,2,False
MK115488.1,False,9623,0.6534999185838631,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9623,1.0255196542498457,1.0325262392185388,1.0,789,8793,6,False
MK115030.1,False,9126,0.032014462397289556,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9126,0.994031693764149,1.0655270655270654,1.0,789,8793,3,False
MK115498.1,True,9461,0.83547963060225,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9461,0.9866227618851615,1.0080329774865235,1.0,789,8793,2,False
MK115211.1,False,9032,0.11818291879607423,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9032,0.995060712080675,1.0598981399468557,1.0,789,8793,3,False
MK115158.1,False,9143,0.002572269807584293,Ref.47_BF.ES.08.P1942.GQ372987,9143,0.9921577414295317,0.9699223449633599,1.0,234,8211,1,False
MK114705.1,False,9411,0.14584270737492833,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9411,1.098065445564931,1.122622463075125,1.0,789,8793,6,False
MK114856.1,False,9477,1.0,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9477,1.0485696645400289,1.0812493405085997,1.0,789,8793,4,False
MK115009.1,False,9207,1.0,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9207,0.9965013377238114,1.0590854784403172,1.0,789,8793,3,False
MK115387.1,False,9136,0.5436355526687852,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9136,0.9796254373327845,1.040936952714536,1.0,789,8793,2,False
MK115491.1,True,9422,0.8961809048805741,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9422,1.0037044659394938,1.0299299511780937,1.0,789,8793,2,False
MK116110.1,False,8967,0.07021438897893317,Ref.B.TH.90.BK132.AY173951,8967,0.9957759004001778,0.9972119995539199,0.9986220719027934,140,8123,3,False
MK115527.1,True,9481,0.770862998910788,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9481,0.9867256637168141,1.0056956017297753,1.0,789,8793,2,False
MK114997.1,False,9055,0.05560625344150194,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9055,0.9784935171846059,1.0516841524019878,1.0,789,8793,2,False
MK115518.1,True,9537,0.6408152618300496,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9537,0.9847705289154147,0.9996854356715948,1.0,789,8793,3,False
MK115065.1,False,9214,0.033954952452739495,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9214,1.0080263428689031,1.069459518124593,1.0,789,8793,6,False
MK115464.1,False,9663,1.0,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9663,0.9838444124305412,0.9893407844354756,1.0,789,8793,2,False
MK115530.1,True,9544,0.5812621948015355,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9544,0.9866227618851615,0.9992665549036044,1.0,789,8793,2,False
MK115520.1,False,9589,0.5225247969864292,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9589,0.9786993208479111,0.987902805297737,1.012118940529735,789,8793,3,False
MK115503.1,True,9617,0.42870398270204335,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9617,0.987034369211772,0.9953207861079338,1.0,789,8793,2,False
MK115570.1,False,9485,0.7406166892211931,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9485,0.9866227618851615,1.0057986294148655,1.0,789,8793,2,False
MK115509.1,True,9353,0.7883768413537747,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9353,0.9866227618851615,1.0197797498128942,1.0,789,8793,2,False
MK115702.1,False,9098,0.1454272422215308,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9098,0.9874459765383824,1.0596834469114091,1.0198650674662668,789,8793,4,False
MK115095.1,False,9137,1.0,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9137,0.9907388351512657,1.060085367188355,1.0,789,8793,2,False
MK115490.1,True,9347,0.8875203448314265,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9347,0.9848734307470673,1.0204343639670483,1.0,789,8793,3,False
MK115576.1,True,9266,0.8197662757563093,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9266,0.9917678534677917,1.0342110943233327,1.0,789,8793,3,False
OQ092466,False,9686,0.3858261890626,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9686,1.1015641078411196,1.1192442700805285,1.0,789,8793,3,False
OQ092463,False,9605,0.21628713708846803,Ref.B.TH.90.BK132.AY173951,9605,1.0529124055135617,0.9884435190005205,1.0,140,8123,2,False
OQ092465,False,9659,0.02412789935966586,Ref.28_BF.BR.99.BREPM12817.DQ085874,9659,1.0429696287964005,0.9620043482762191,1.0,200,8207,2,False
OQ092462,False,9714,0.10883643311676816,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9714,1.1306853261988064,1.1301214741610048,1.0,789,8793,3,False
OQ092464,False,9556,0.006887768010151674,Ref.28_BF.BR.99.BREPM12817.DQ085874,9556,1.0427446569178853,0.9678735872750105,1.0,200,8207,2,False
OQ092467,False,9936,0.6438715160567257,Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455.CfE,9936,1.1308911298621116,1.0962157809983897,1.0,789,8793,3,False
Loading

0 comments on commit 04596a7

Please sign in to comment.