Skip to content

Commit 9f3303b

Browse files
mandysullinbx0
authored andcommitted
Dev (#25)
* update docs * tweaking package to include subtype as a filter when filtering variants of interest (#24)
1 parent c087763 commit 9f3303b

File tree

1 file changed

+10
-1
lines changed
  • mutations_of_interest_table/src

1 file changed

+10
-1
lines changed

mutations_of_interest_table/src/main.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ pub struct RefInput {
9696

9797
#[derive(Deserialize, Debug)]
9898
pub struct MutsOfInterestInput {
99+
subtype: String,
99100
protein: String,
100101
aa_position: String,
101102
aa: String,
@@ -121,6 +122,7 @@ pub struct Entry<'a> {
121122
impl Entry<'_> {
122123
fn update_entry_from_alignment(
123124
&mut self,
125+
subtype: &str,
124126
aa_1: u8,
125127
aa_2: u8,
126128
muts_columns: &Vec<MutsOfInterestInput>,
@@ -130,7 +132,10 @@ impl Entry<'_> {
130132
let hold_aa_mut = self.aa_mut.to_string();
131133
//aa differences that are also in our "mutations of interest" list are written to file
132134
for muts_entry in muts_columns {
133-
if self.protein == muts_entry.protein
135+
//println!("ref {}", subtype);
136+
//println!("mut {}", muts_entry.subtype);
137+
if subtype == muts_entry.subtype
138+
&& self.protein == muts_entry.protein
134139
&& self.aa_position.to_string() == muts_entry.aa_position
135140
{
136141
if hold_aa_mut == muts_entry.aa {
@@ -296,6 +301,7 @@ fn main() -> Result<(), Box<dyn Error>> {
296301

297302
//aa difference moved forward in process;
298303
if entry.update_entry_from_alignment(
304+
&ref_entry.subtype,
299305
ref_aa,
300306
query_aa,
301307
&muts_interest,
@@ -346,6 +352,7 @@ fn main() -> Result<(), Box<dyn Error>> {
346352

347353
//aa difference moved forward in process;
348354
if entry.update_entry_from_alignment(
355+
&ref_entry.subtype,
349356
partial_codon,
350357
partial_codon,
351358
&muts_interest,
@@ -435,6 +442,7 @@ fn main() -> Result<(), Box<dyn Error>> {
435442

436443
//aa difference moved forward in process;
437444
if entry.update_entry_from_alignment(
445+
&ref_entry.subtype,
438446
ref_aa,
439447
query_aa,
440448
&muts_interest,
@@ -485,6 +493,7 @@ fn main() -> Result<(), Box<dyn Error>> {
485493

486494
//aa difference moved forward in process;
487495
if entry.update_entry_from_alignment(
496+
&ref_entry.subtype,
488497
partial_codon,
489498
partial_codon,
490499
&muts_interest,

0 commit comments

Comments
 (0)