Skip to content

Commit 593b105

Browse files
committed
added in sc2 ilumina handling for pass/fail dividing
1 parent 89128cb commit 593b105

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

src/utils/data_processing.rs

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1248,7 +1248,7 @@ pub fn divide_into_pass_fail_df(
12481248
for entry in nt_seq_df {
12491249
if platform == "illumina" && virus == "flu" {
12501250
if entry.pass_fail_decision == "Pass"
1251-
|| entry.pass_fail_decision == "Premature stop codon"
1251+
|| entry.pass_fail_decision.contains("Premature stop codon")
12521252
&& !entry.pass_fail_decision.contains(';')
12531253
&& !entry.reference.contains("HA")
12541254
&& !entry.reference.contains("NA")
@@ -1268,6 +1268,29 @@ pub fn divide_into_pass_fail_df(
12681268
sequence: entry.sequence.clone(),
12691269
});
12701270
}
1271+
} else if platform == "illumina" && virus == "sc2-wgs" {
1272+
if entry.pass_fail_decision == "Pass"
1273+
|| entry.pass_fail_decision.contains("Premature stop codon")
1274+
&& !entry.pass_fail_decision.contains(';')
1275+
&& !entry
1276+
.pass_fail_decision
1277+
.contains("Premature stop codon 'S'")
1278+
{
1279+
pass_df.push(SeqData {
1280+
name: format!("{} | {}", entry.sample_id.clone(), entry.reference),
1281+
sequence: entry.sequence.clone(),
1282+
});
1283+
} else {
1284+
fail_df.push(SeqData {
1285+
name: format!(
1286+
"{} | {} | {}",
1287+
entry.sample_id.clone(),
1288+
entry.reference,
1289+
entry.pass_fail_decision
1290+
),
1291+
sequence: entry.sequence.clone(),
1292+
});
1293+
}
12711294
} else {
12721295
// If platform or virus doesn't match, treat as a failure
12731296
fail_df.push(SeqData {

0 commit comments

Comments
 (0)