Skip to content

Commit eba1b8b

Browse files
committed
Handle #N/A values
1 parent 30c5659 commit eba1b8b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src-tauri/src/serializer.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,19 @@ fn serialize_peptides(
129129
wtr.write_record(&headers_str)?;
130130

131131
for peptide in peptides {
132+
let intensities = peptide
133+
.intensities
134+
.iter()
135+
.map(|i| {
136+
match i {
137+
None => "#N/A".to_string(),
138+
Some(i) => i.to_string(),
139+
}
140+
}).collect();
141+
132142
let record = [
133143
vec![peptide.protein, peptide.name, peptide.mass_charge_ratio.to_string()],
134-
peptide.intensities.iter().map(|i| i.unwrap().to_string()).collect()
144+
intensities
135145
].concat();
136146
wtr.write_record(&record)?;
137147
}

0 commit comments

Comments
 (0)