Repository: PoonLab/sierra-local (language: python)

Issue:
Fail to run with iupac codes
Hello,
I'm using sierra-local for predicting HIV-1 resistance in sequences generated by a low frequency calls pipeline. This made necessary to use IUPAC codes in some mutation sites. Using some sequences, even with iupac codes, the program runs fine. However, when using sequences that contain a larger number of IUPAC codes nucleotides, I receive this error:


| 2023-01-30T16:30:38.339-03:00 | searching path /usr/local/lib/python3.6/dist-packages/sierralocal/data/HIVDB*.xml
| 2023-01-30T16:30:38.339-03:00 | searching path /usr/local/lib/python3.6/dist-packages/sierralocal/data/apobec*.tsv
| 2023-01-30T16:30:38.339-03:00 | HIVdb version 8.8
| 2023-01-30T16:30:38.339-03:00 | Found NucAmino binary /usr/local/lib/python3.6/dist-packages/sierralocal/bin/nucamino-linux-amd64
| 2023-01-30T16:30:38.339-03:00 | Aligned /tmp/scratch/path_to_file/HIVRes/dd186464-42ee-4232-b3d0-6d4e1ddcb863/call-GenerateConsensusSensitive015/sample.fasta
| 2023-01-30T16:30:38.342-03:00 | Traceback (most recent call last):
| 2023-01-30T16:30:38.342-03:00 | File "/usr/local/bin/sierralocal", line 11, in <module>
| 2023-01-30T16:30:38.342-03:00 | exit_code = main.main()
| 2023-01-30T16:30:38.342-03:00 | File "/usr/local/lib/python3.6/dist-packages/sierralocal/main.py", line 179, in main
| 2023-01-30T16:30:38.342-03:00 | cleanup=args.cleanup, forceupdate=args.forceupdate)
| 2023-01-30T16:30:38.342-03:00 | File "/usr/local/lib/python3.6/dist-packages/sierralocal/main.py", line 122, in sierralocal
| 2023-01-30T16:30:38.342-03:00 | file_trims, subtypes = scorefile(input_file, algorithm)
| 2023-01-30T16:30:38.342-03:00 | File "/usr/local/lib/python3.6/dist-packages/sierralocal/main.py", line 51, in scorefile
| 2023-01-30T16:30:38.342-03:00 | aligner.get_mutations(result)
| 2023-01-30T16:30:38.342-03:00 | File "/usr/local/lib/python3.6/dist-packages/sierralocal/nucaminohook.py", line 283, in get_mutations
| 2023-01-30T16:30:38.342-03:00 | subtype = self.typer.getClosestSubtype(record['Sequence'], offset)
| 2023-01-30T16:30:38.342-03:00 | File "/usr/local/lib/python3.6/dist-packages/sierralocal/subtyper.py", line 102, in getClosestSubtype
| 2023-01-30T16:30:38.342-03:00 | dists = self.getDistances(sequence, offset)
| 2023-01-30T16:30:38.342-03:00 | File "/usr/local/lib/python3.6/dist-packages/sierralocal/subtyper.py", line 75, in getDistances
| 2023-01-30T16:30:38.342-03:00 | dists[header] = self.uncorrectedDistance(sequence, reference[offset:])
| 2023-01-30T16:30:38.342-03:00 | File "/usr/local/lib/python3.6/dist-packages/sierralocal/subtyper.py", line 58, in uncorrectedDistance
| 2023-01-30T16:30:38.342-03:00 | if not ref[idx] in self.ambiguities[nuc]:
| 2023-01-30T16:30:38.342-03:00 | KeyError: ' '

The same sequence runs fine in the sierra web service. Is there something I could do?


Discussion / hints:
Hi, I couldn't replicate your issue

I've tried running an RT sequence with ambiguous nucleotides on `HIVdb version 8.8` and `HIVdb version 9.4` and didn't get any error messages.

could you try using the `HIVdb version 9.4` through the submodule to see if this issue still occurs?
No follow up from user, closing
Hello,
Sorry for taking so long for a follow up.
I am now using HIVdb version 9.4 in a pipeline for detection of low-frequencies mutations that lead to ARV resistance. In this pipeline, 3 consensus sequences are generate, one of them containing low frequencies mutations and commonly has IUPAC nucleotides.
This consensus sequence generates the error first mentioned, even with version 9.4, however works fine in sierra-web. This is the consensus sequence:

```
>consensus
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN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GAYACAGGAGCAGATG
ATACAGTATTMGAAGACRTAGATTTACCAGGAAAMTGGAAGCCAAAAATAATAGGGGGAR
TTGGAGGTTTTSTCARAGTAAARCAGTATGATAACRTACWCATAGAAATTTGTGGRCAYA
ARGTTACAGGTACAGTAGTAGTAGGACCTACACCTRYSAAYATAATTGGAAGAAATCTGT
TGACTCAGCTGGGTTGCACTTTAAATTTTCCCATWAGTCCTATTGAAACTGTACCAGTAA
AATTAAAGCCAGGAATGGATGGCCCAAAAGTTAAACAATGGCCATTGACAGAAGAAAAAA
TAAAAGCATTAACAGAAATATGTACAGAAATGGAAAAAGAAGGGAAAATTTCAAAAATTG
GGCCTGAAAATCCATAYAATACTCCARTATTTGCCATAAAGAAAAARRACAGTWCTAGAT
GGAGAAAATTAGTAGATTTCAGRGAACTTAATAAAAGAACTCAAGATTTTTGGGAGGTTC
AATTAGGAATACCGCATCCTGCGGGATTAMAAAAGAAAAAATCAGTAACAGTACTGGATG
TGGGTGATGCATATTTTTCAGTTCCCTTAGATGAAGAYTTCAGGAAGTATACTGCATTTA
CCATACCTAGTACMAATAATGAGACACCRGGGATTAGATATCAGTACAATGTGCTTCCAC
AAGGATGGAAAGGATCACCAGCAATATTCCAAAGCAGCATGACAAAAATCTTAGAGCCCT
TTAGAAAACAAAACCCGGACATAGTGATYTATCAATAYGTGGATGATTTGTATGTAGGAT
CTGATYTAGAAATAGGGCAGCATAGAACAAAAWWRAGGAACTGAGACARCATCTRTTGAC
GTGGGGATTGACCACACCAGATMAAAAACACCAGAAAGAACMTCCATTTCTTTGGATGGG
KTATGAACTCCATCCTGATAAATGGACAGTACAGCCTATAGAGCTGCCAGAAAAGGAYAG
CTGGACTGTCAATGACATACAGAAGTTAGTGGGAAAATTRAATTGGGCAAGTCAGATTTA
CCCAGGGATTAARGTAAAGCAATTATGTAGACTCCTTARGGGAACCAAGGCRCTAACAGA
AGTAGTACCMCTAACAAAAGARGCAGAGTTAGAACTGGCAGAAAACAGGGAAATTCTAAA
GGAAC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NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
N
```
PS: The consensus sequence is generated by applying variants present in a VCF file to a reference sequence (HXB2). This sequence in particular was obtained by sequencing specific genome targets by amplicon sequencing, therefore so many N's, corresponding to regions with no coverage.

I would still appreciate help with this.
Thank you
Hi Erick,

No worries about the time. 

I ran this sequence through the new alignment program we are swapping to--listed in #71--and it successfully aligned your sequence.

This issue should get fixed in the incoming PR
Thank you for such a quick answer.
I'll wait for the incoming PR.
Hello,

I have tried with the current version in main containing the new alignment program, and indeed I don't get the error anymore. However, the total score of some ARV are wrong, with mutations that are not there due to lack of coverage.
For example, the mutation N348I in RT don't exist, the sequence has an N in this position, wich is confirmed in the list of mutations in RT, but the mutation is still called for the score of NVP drug. Many more of this can be found along the genome, specially in the IN gene.
I will look further into this. 

While testing this program I didn't get to test it much on IN, which could explain the many errors. 
There are incorrectly labelled APOBEC mutations which I have found and working on a fix for. This is likely due to an outdated version of the `apobec_drm.json` file. 

Regarding incorrectly identifying mutations, I compared sierralocal, running on postalign, with sierrapy, and the output position and AA matched. Could you elaborate on where you are comparing the outputs so I can have a deeper look?
Hello,

Thank you for the investigation. I'll wait for the fix on the `apobec_drm.json` file.

To assure that we are using the same sequence for these tests, I'll repost it here:

```
>consensus
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
N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TTGGAGGTTTTSTCARAGTAAARCAGTATGATAACRTACWCATAGAAATTTGTGGRCAYA
ARGTTACAGGTACAGTAGTAGTAGGACCTACACCTRYSAAYATAATTGGAAGAAATCTGT
TGACTCAGCTGGGTTGCACTTTAAATTTTCCCATWAGTCCTATTGAAACTGTACCAGTAA
AATTAAAGCCAGGAATGGATGGCCCAAAAGTTAAACAATGGCCATTGACAGAAGAAAAAA
TAAAAGCATTAACAGAAATATGTACAGAAATGGAAAAAGAAGGGAAAATTTCAAAAATTG
GGCCTGAAAATCCATAYAATACTCCARTATTTGCCATAAAGAAAAARRACAGTWCTAGAT
GGAGAAAATTAGTAGATTTCAGRGAACTTAATAAAAGAACTCAAGATTTTTGGGAGGTTC
AATTAGGAATACCGCATCCTGCGGGATTAMAAAAGAAAAAATCAGTAACAGTACTGGATG
TGGGTGATGCATATTTTTCAGTTCCCTTAGATGAAGAYTTCAGGAAGTATACTGCATTTA
CCATACCTAGTACMAATAATGAGACACCRGGGATTAGATATCAGTACAATGTGCTTCCAC
AAGGATGGAAAGGATCACCAGCAATATTCCAAAGCAGCATGACAAAAATCTTAGAGCCCT
TTAGAAAACAAAACCCGGACATAGTGATYTATCAATAYGTGGATGATTTGTATGTAGGAT
CTGATYTAGAAATAGGGCAGCATAGAACAAAAWWRAGGAACTGAGACARCATCTRTTGAC
GTGGGGATTGACCACACCAGATMAAAAACACCAGAAAGAACMTCCATTTCTTTGGATGGG
KTATGAACTCCATCCTGATAAATGGACAGTACAGCCTATAGAGCTGCCAGAAAAGGAYAG
CTGGACTGTCAATGACATACAGAAGTTAGTGGGAAAATTRAATTGGGCAAGTCAGATTTA
CCCAGGGATTAARGTAAAGCAATTATGTAGACTCCTTARGGGAACCAAGGCRCTAACAGA
AGTAGTACCMCTAACAAAAGARGCAGAGTTAGAACTGGCAGAAAACAGGGAAATTCTAAA
GGAACCAGTACATGGAGTGTATTATGACCCATCAAAAGACNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNN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NNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
N
```
For generating this consensus sequence, obtained reads were mapped to HXB2 reference, variants were called (AF >= 0.15) and consensus were generated with bcftools. We used "N" for regions without coverage (this is an aplicon-based sequencing). IUPAC codes were used for with 2 or more haplotypes. The first sequence that I posted in this issue was generated by mapping in a different HIV-1 sequence (a genbank refseq NC_001802.1), so there may be some differences.

I'm using sierra-web-service for output comparison. The analysis output of sierra-web-service is attached.
[analysis-reports-consensus.zip](https://github.com/PoonLab/sierra-local/files/12147232/analysis-reports-consensus.zip)
 
The siera-local, running on postalign, output json file is also attached .
[consensus_resistance.json.zip](https://github.com/PoonLab/sierra-local/files/12147275/consensus_resistance.json.zip)




@WilliamZekaiWang can you update us about this for next week?
I've looked deeper into this issue and I think the problem could be partially on our end. Post-align isn't the issue, it provides the correct data.

The issue seems to lie in the XML files for HIVDB, in our case `HIVDB_9.4.xml`, that we use to get comments about specific drug-resistant mutations. Updating this file with the updater script didn't fix the issue.

Of the incorrectly reported drug resistance mutations, they are all listed as an amino acid mutated to `X` from the nucleotides being `NNN`. I'm pretty sure we match the new amino acid and position to see if we get a hit in the `HIVDB_9.4.xml`. However, since it's ambiguous, sierra-web might ignore these cases. Making Sierra-local ignore reporting potential drug-resistant mutations if it includes `X` doesn't work.

another error I found while looking around is with how sierra-web displays the specific mutation in drug-resistant mutations. Below are the collated drug-resistant mutations for a specific gene.


```
        "PR": [
            "V82VAIMT",
```
compared to sierra-local
```
        "PR": [
            "V82A",
            "V82T"
```
The actual mutation is `V82X` with X being one of `AIMTV`. We do correctly report this in sierra-local. However, the `HIVDB_9.4.xml` file, only holds information on `V82A` and `V82T` drug resistance. Hence, we only state  `V82A` and `V82T` rather than `VAIMT`, under `partialScores` for `drugScores`, conflicting with sierra-web's output.




Fix patch:
diff --git a/sierralocal/jsonwriter.py b/sierralocal/jsonwriter.py
index 33ddae5..d5b2338 100644
--- a/sierralocal/jsonwriter.py
+++ b/sierralocal/jsonwriter.py
@@ -1,3 +1,4 @@
+from ast import Index
 import os
 import re
 import csv
@@ -126,15 +127,45 @@ def format_validation_results(self, validated):
         validation_results = [{'level': v[0], 'message': v[1]} for v in validated]
         return validation_results
 
-    def format_drug_resistance(self, scores, gene):
+    def format_drug_resistance(self, scores, sequence_name, gene, ambiguous, names):
         """
         Returns formatted drug resistance and score breakdowns,
         meant for results output.
         @param scores: dict, results of one query from score_alg.score_drugs()
         @param gene: str, gene found in the sequence
+        @param ambiguous: dict, {sequence name: position of NNN NAs}
+        @param names: list, [sequence names]
         @return drug_resistance: dict, one dictionary encoding
         scores and descriptions
         """
+        # remove all ambiguous NNN positions
+        for drug, info in scores.items():
+            new = [[] for i in info[2]]
+            scores[drug] = list(scores[drug])
+            inds = set() # hold positions for valid scores
+
+            # not fastest way, but works around not mutating while iterating
+            for index, position in enumerate(info[2]):
+                for ind2, mut in enumerate(position):
+                    if int(mut[1:-1]) in ambiguous[sequence_name][gene]:
+                        inds.add(index)
+                    else:
+                        new[index].append(mut)
+
+            new1 = []
+            for i in new:
+                if i:
+                    new1.append(i)
+
+            new2 = []
+            for index, score in enumerate(info[1]):
+                if not index in inds:
+                    new2.append(score)            
+            scores[drug][2] = new1
+            scores[drug][1] = new2
+            scores[drug][0] = sum(scores[drug][1]) 
+
+
         drug_resistance = {}
         drug_resistance['version'] = {}
         drug_resistance['version']['text'] = self.algorithm.version
@@ -181,6 +212,7 @@ def format_drug_resistance(self, scores, gene):
                 # create partial score, for each mutation, datastructure
                 drug_score['partialScores'] = []
                 for index, pscore in enumerate(scores[drug][1]):
+
                     pscore = float(pscore)
                     if not pscore == 0.0:
                         pscoredict = {}
@@ -292,7 +324,7 @@ def format_input_sequence(self, header, sequence):
 
     def write_to_json(self, filename, file_headers, file_scores,
                       file_genes, file_mutation_lists, file_sequence_lengths,
-                      file_trims, file_subtypes, na_sequence):
+                      file_trims, file_subtypes, na_sequence, ambiguous, names):
         """
         The main function to write passed result to a JSON file
         @param filename: str, the file path to write the JSON to
@@ -307,6 +339,8 @@ def write_to_json(self, filename, file_headers, file_scores,
         @param file_trims: list, list of lists of tuples of ints 
         @param file_subtypes: list, list of subtype strings
         @param na_sequence: dict, {sequence name: associated NA sequence}
+        @param ambiguous: dict, {sequence name: positions of NNN triplet NA}
+        @param names: list, [sequence names]
         """
         out = []
         for index, scores in enumerate(file_scores):
@@ -335,7 +369,7 @@ def write_to_json(self, filename, file_headers, file_scores,
                                                            nalist)
                     )
                     data['drugResistance'].append(
-                        self.format_drug_resistance(scores[idx], gene)
+                        self.format_drug_resistance(scores[idx], file_headers[index], gene, ambiguous, names)
                     )
 
             out.append(data)
diff --git a/sierralocal/main.py b/sierralocal/main.py
index ba0da3d..b0ecbc1 100644
--- a/sierralocal/main.py
+++ b/sierralocal/main.py
@@ -2,6 +2,7 @@
 import sys
 import time
 import argparse
+import json
 
 from sierralocal import score_alg
 from sierralocal.hivdb import HIVdb
@@ -22,15 +23,15 @@ def score(filename, xml_path=None, tsv_path=None, forceupdate=False, do_subtype=
     time_start = time.time()
 
     sequence_headers, sequence_scores, ordered_mutation_list, file_genes, \
-    sequence_lengths, file_trims, subtypes, na_sequence = scorefile(filename, algorithm, do_subtype)
+    sequence_lengths, file_trims, subtypes, na_sequence, ambiguous, names = scorefile(filename, algorithm, do_subtype)
 
     count = len(sequence_headers)
 
     print("{} sequences found in file {}.".format(len(sequence_headers), filename))
     output_file = os.path.splitext(filename)[0] + '-local.json'
     writer = JSONWriter(algorithm)
-    writer.write_to_json(output_file, sequence_headers, sequence_scores, file_genes,
-                         ordered_mutation_list, sequence_lengths, file_trims, subtypes, na_sequence)
+    writer.write_to_json(output_file, sequence_headers, sequence_scores, file_genes, ordered_mutation_list,
+                        sequence_lengths, file_trims, subtypes, na_sequence, ambiguous, names)
     time_end = time.time()
     print("Time elapsed: {:{prec}} seconds ({:{prec}} it/s)".format(
         time_end - time_start, count/(time_end - time_start), prec='.5'))
@@ -51,10 +52,34 @@ def scorefile(input_file, algorithm, do_subtype=False, program='post'):
     aligner = NucAminoAligner(algorithm, program=program)
     result = aligner.align_file(input_file, program=program)
 
+    # hold all NNN sequences and void them when scoring drugs
+    ambiguous = {}  # {sequence name: {gene : set(positions of NNN)}}
+    names = []
+    gene_order = {}
+
+
     print('Aligned ' + input_file)
     sequence_headers, file_genes, file_mutations, file_trims, subtypes = \
         aligner.get_mutations(result, do_subtype=do_subtype)
 
+
+    for ind, gene in enumerate(file_genes):
+        seq_n = sequence_headers[ind]
+        gene_order[seq_n] = []
+        
+        for ind2, protein in enumerate(gene):
+            gene_order[seq_n].append(protein[0])
+
+    for ind, sequence in enumerate(file_mutations):
+        seq_n = sequence_headers[ind]
+        ambiguous[seq_n] = {}
+        for ind2, muts in enumerate(sequence):
+            ambiguous[seq_n][gene_order[seq_n][ind2]] = set()
+            for position, AA in muts.items():
+                if len(AA[1]) == 21: # checks if was NNN
+                    ambiguous[seq_n][gene_order[seq_n][ind2]].add(position)
+
+
     ordered_mutation_list = []
     sequence_scores = []
     sequence_lengths = []
@@ -96,7 +121,7 @@ def scorefile(input_file, algorithm, do_subtype=False, program='post'):
         sequence_lengths.append(length_lists)
 
     return sequence_headers, sequence_scores, ordered_mutation_list, \
-           file_genes, sequence_lengths, file_trims, subtypes, na_sequence
+           file_genes, sequence_lengths, file_trims, subtypes, na_sequence, ambiguous, gene_order
 
 def sierralocal(fasta, outfile, xml=None, json=None, cleanup=False, forceupdate=False,
                 program='post', do_subtype=False): # pragma: no cover
@@ -130,7 +155,7 @@ def sierralocal(fasta, outfile, xml=None, json=None, cleanup=False, forceupdate=
 
         # process and score file
         sequence_headers, sequence_scores, ordered_mutation_list, file_genes, \
-        sequence_lengths, file_trims, subtypes, na_sequence = scorefile(input_file, algorithm,
+        sequence_lengths, file_trims, subtypes, na_sequence, ambiguous, names = scorefile(input_file, algorithm,
                                                                         program=program, do_subtype=do_subtype)
 
         count += len(sequence_headers)
@@ -144,7 +169,7 @@ def sierralocal(fasta, outfile, xml=None, json=None, cleanup=False, forceupdate=
 
         writer.write_to_json(output_file, sequence_headers, sequence_scores,
                              file_genes, ordered_mutation_list, sequence_lengths,
-                             file_trims, subtypes, na_sequence)
+                             file_trims, subtypes, na_sequence, ambiguous, names)
 
         if cleanup:
             # delete alignment file
diff --git a/sierralocal/nucaminohook.py b/sierralocal/nucaminohook.py
index 4ae0b43..f8eee7c 100644
--- a/sierralocal/nucaminohook.py
+++ b/sierralocal/nucaminohook.py
@@ -342,7 +342,6 @@ def align_file(self, filename, program='post'):
                 try:
                     sites = record['Report']['AlignedSites']
                 except:
-                    print(record)
                     raise
                 nuc = record['Report']['NucleicAcidsLine']
 


Test patch:
diff --git a/tests/ambiguous_seq.fa b/tests/ambiguous_seq.fa
new file mode 100644
index 0000000..b5f6d74
--- /dev/null
+++ b/tests/ambiguous_seq.fa
@@ -0,0 +1,10 @@
+>RT1_frontN
+NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNATCAGAAGGAACCTCCATTCCTTTGGATGGGATATGAACTCCATCCTGACAGATGGACAGTCCAGCCTATAGAACTGCCAGAAAAAGACAGCTGGACTGTCAATGATATACAGAAATTAGTGGGAAAACTAAATTGGGCAAGTCAAATTTATGCAGGGATTAAGGTAAAGCAACTGTGTAAACTCCTCAGGGGAGCTAAAGCACTAACAGACATAGTACCACTGACTGAAGAAGCAGAATTAGAGTTGGCAGAGAACAGGGAGATTCTAAAAACCCCTGTGCATGGAGTATATTATGACCCATCAAAAGACTTAGTAGCAGAAGTACAGAAACAAGGGCAGGACCAATGGACATATCAAATTTATCAAGAGCCATTTAAAAATCTAAAAACAGGAAAATATGCCAGAAGAGGGTCTGCTCACACTAATGATGTAAGACAATTAACAGAAGTGGTGCAAAAAGTAGCCACAGAAAGCATAGTAATATGGGGAAAGACCCCTAAATTTAGACTACCCATACAAAGAGAAACATGGGAAACATGGTGGATGGAGTATTGGCAGGCTACCTGGATTCCTGAATGGGAGTTTGTTAATACCCCTCCTCTAGTAAAATTATGGTACCAATTAGAAAAAGACCCCATAGTAGGAGCAGAGACTTTCTATGTAGATGGGGCAGCTAGTAGGGAGACTAAGCTAGGAAAAGCAGGGTATGTCACTGACAGAGGAAGACAAAAGGTAGTTTCCCTAACTGAGACAACAAATCAAAAGACTGAATTACATGCGATCCATTTAGCCTTGCAGGATTCAGGATCAGAAGTAAATATAGTAACAGACTCACAATATGCATTAGGAATCATTCAGGCACAACCAGACAGGAGTGAATCAGAAGTAGTCAACCAAATAATAGAGGAGCTAATAAAAAAGGAGAAAGTCTACCTGTCATGGGTACCAGCACACAAGGGGATTGGAGGAAATGAACAAGTAGATAAATTAGTCAGTTCAGGAATCAGGAAGGTGCTA
+>RT2_endN
+CCCATTAGTCCTATTGAAACTGTACCAGTAAAATTAAAGCCAGGAATGGATGGCCCAAAGGTTAAACAATGGCCATTGACAGAAGAGAAAATAAAAGCATTAACAGCAATTTGTGAAGAAATGGAGAAGGAAGGAAAAATTACAAAAATTGGGCCTGAAAATCCATATAACACTCCAATATTTGCATTAAAAAAGAAGGACAGTACTAAGTGGAGAAAATTAGTGGATTTTAGGGAACTCAATAAAAGAACTCAAGATTTTTGGGAAGTTCAATTAGGAATACCACACCCAGCAGGGTTAAAAAAGAAAAAATCAGTGACAGTACTGGATGTGGGGGATGCATATTTTTCAGTTCCTCTATATGAAGACTTCAGGAAATATACTGCATTCACCATACCTAGTAGAAACAATGAAACACCAGGGATTAGGTATCAATATAATGTGCTTCCACAGGGATGGAAAGGATCACCAGCAATATTCCAGTGTAGCATGACAAAAATCCTAGAGCCCTTTAGAGACCGAAATCCAGAACTAGTCATCTATCAATATATGGATGACTTGTATGTAGGCTCTGACTTAGAAATAGGGCAACATAGAGCAAAAATAGAGGAGTTAAGAGAACATCTGTTAAAGTGGGGATTTACCACACCAGACAAGAAACATCAGAAAGAACCTCCATTTCTTTGGATGGGGTATGAACTCCATCCTGACAAATGGACAGTACAGCCTATACAGCTGCCAGAAAAGGATAGCTGGACTGTCAATGATATACAGAAGTTAGTGGGAAAATTAAACTGGGCAAGTCAGATTTATCCAGGAATTAAAGTAAGGCAACTTTGTAAACTCCTTAGGGGGGCCAAAGCACTAACAGACATAATANNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
+>RT3_middleN
+CCCATTAGTCCTATTGAAACTGTACCAGTAAAATTGAAGCCAGGAATGGATGGCCCAAGGGTTAAACAATGGCCATTGACAGAAGAAAAAATAAAAGCATTAACAGAAATATGTACAGAAATGGAAAAAGAAGGAAAAATTTCAAAAATTGGGCCCGAAAATCCATACAATACTCCAGTATTTGCCATAAAGAAAAAAGATAGTACTAAATGGAGAAAATTAGTAGATTTCAGAGAACTTAATAAGAGAACTCAAGACTTCTGGGAAGTTCAGTTAGGGATACCACATCCCGCAGGGTTAAAGAAGAAAAAATCAGTAACAGTACTGGATGTGGGTGATGCATATTTTTCAGTTCCATTAGATAAAGACTTCAGGAAGTATACTGCATTTACCATACCTAGTACAAACAATGAAACACCAGGGCTTAGATATCAGTACAATGTGCTTCCACAGGGGTGGAAAGGATCACCAGCAATATTCCAAAGTAGCATGACAAAAATCTTAGAGCCTTTTAGAAAACAAAATCCAGACATAGTTATCTATCAATACATGGATGATTTGTATGTAGGATCTGACTTAGAAATAGGGCAGCATAGAACTAAGATAGAGGAATTGAGACAGCATTTGTTGAGGTGGGGATTTACCACACCAGACAAAAAACATCAGAAAGNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNATCAAGAGCCATATAAAAATTTGAAAACAGGAAAGTATGCAAGGATGAGGGGTGCCCACACTAATGATGTAAAACAACTAACAGAGGCAGTGCAAAAAATAACCACAGAAAGCATAGTAATATGGGGAAAGATTCCTAAATTTAAACTACCCATACAAAAAGAAACGTGGGAAGCATGGTGGATAGAGTATTGGCAAGCCACCTGGATTCCTGAGTGGGAGTTTGTCAATACCCCTCCCTTAGTGAAATTATGGTACCAGTTAGAGAAAGAACCCATAGTAGGAGCAGAAACTTTCTATGTAGATGGGGCAGCTAATAGGGAAACTAAATTAGGAAAAGCAGGATATGTGACTGACAGAGGAAGACAAAAAGTTGTCCCCCTAACGGACACAACAAATCAGAAAACTGAGTTACAAGCAATTCATCTAGCTTTGCAGGATTCGGGATTAGAAGTAAACATAGTAACAGACTCACAATATGCATTAGGAATCATTCAAGCACAACCAGATAAGAGTGAATTAGAAATAGTCAATCAAATAATAGAGCAGTTAATAAAAAAGGAAAAGATCTACCTGGCATGGGTACCAGCACACAAAGGAATTGGAGGAAATGAACAAGTAGACAAATTAGTCAGTTCTGGAATCAGGAAAGTACTA
+>RT4_normal
+ATTTGCTATAAAAAAGAAAAACAGTAATAGATGGAGAAAATTAGTAGATTTCAGAGAACTCAATAAGAGAACTCAAGACTTCTGGGAAGTTCAATTAGGAATACCACATCCCTCAGGGTTAAAAAAGAAAAATTCAGTAACAGTACTGGATGTGGGTGATGCATATTTTTCAGTCCCTTTAGATAAAGACTTCAGGAAGTATACTGCATTCACCATACCTAGTATAAACAATGAGACACCAGGGATTAGATATCAGTACAATGTGCTTCCACAGGGATGGAAAGGATCACCAGCAATATTCCAAAGTAGCATCACAAAAATTTTAGAGCCTTTTAGAAAACAAAATCCAGACATAGTTATTTATCAATACGTGGATGATTTGTATGTAGGATCTGATTTAGGAATAGGGCAGCACAGAACAAAAGTAGAGGAACTAAGACAACATCTGTTGAGCTGGGGATTTTTTACACCAGACCAAAAACATCAGAAAGAACCTCCATTCCTTTGGATGGGTTATGAACTCCATCCTGATAAATGGACAGTACAGCCTATAGTGCTGCCAGAAAAGGACAGCTGGACTGTCAATGACATACAGAAG
+>RT5_normal
+ACTGTACCAGTAAAATTAAAGCCAGGAATGGATGGCCCAAGAGTTAAACAATGGCCATTGACAGAAGAAAAAATAADRGNATTAGTAGAAATTTGTACAGAAATGGAAAAGGAAGGGAAAATTTCAAAAATTGGGCCTGAAAATCCATACAATACTCCAGTATTTGCCATAAAGAAAAARGATAGTACTAAATGGAGAAAATTAGTAGATTTCAGAGAACTTAATAAGAGAACTCAAGACTTCTGGGAAGTTCAATTAGGAATACCACATCCCGCAGGGTTAAAAAAGAAAAAATCAGTAACAGTAYTGGATGTGGGTGATGCATATTTTTCAGTTCCCTTAGATAAAGACTTTAGGAAGTATACTGCATTTACCATACCTAGTACAAACAATGAGTCACCAGGGATTAGATATCAGTACAATGTGCTTCCACAGGGATGGAAAGGATCACCAGCAATATTCCAACATAGCATGACAAAAATCTTAGAGCCTTTTAGAAAACAAAATCCAGACATAGTTATCTATCAATACATGGATGATTTGTATGTAGGATCTGACTTAGAAATAGGGCAGCATAGAACAAAAATAGAGGAACTGAGACAACATCTGTTGAGGTGGGGATTTACCACACCAGACAAAAAACATCAG
diff --git a/tests/compare_drug_muts.py b/tests/compare_drug_muts.py
new file mode 100644
index 0000000..0e80986
--- /dev/null
+++ b/tests/compare_drug_muts.py
@@ -0,0 +1,54 @@
+import argparse
+import json
+
+def parse_arguments():
+    parser = argparse.ArgumentParser(description='Process JSON files and extract mutations.')
+
+    parser.add_argument('--input1', required=True, help='Path to the first input JSON file')
+    parser.add_argument('--input2', required=True, help='Path to the second input JSON file')
+    parser.add_argument('--output1', required=True, help='Path to the first output JSON file')
+    parser.add_argument('--output2', required=True, help='Path to the second output JSON file')
+
+    return parser.parse_args()
+
+def process_json(input_path):
+    with open(input_path, 'r') as file:
+        data = json.load(file)
+
+    result_dict = {}
+    for item in data:
+        name = item['inputSequence']['header']
+        result_dict[name] = {}
+
+        for genes in item['drugResistance']:
+            gene = genes['gene']['name']
+            result_dict[name][gene] = []
+
+            for drugs in genes['drugScores']:
+                for scores in drugs['partialScores']:
+                    if isinstance(scores, dict):
+                        for mutation in scores['mutations']:
+                            if mutation['text'] not in result_dict[name][gene]:
+                                result_dict[name][gene].append(mutation['text'])
+
+    return result_dict
+
+def main():
+    args = parse_arguments()
+
+    # Process the first input file
+    dic_py = process_json(args.input1)
+
+    # Process the second input file
+    dic_local = process_json(args.input2)
+
+    # Write results to the first output file
+    with open(args.output1, 'w') as file:
+        json.dump(dic_py, file, indent=4)
+
+    # Write results to the second output file
+    with open(args.output2, 'w') as file:
+        json.dump(dic_local, file, indent=4)
+
+if __name__ == "__main__":
+    main()
\ No newline at end of file
diff --git a/tests/compare_muts.py b/tests/compare_muts.py
new file mode 100644
index 0000000..dfcc26b
--- /dev/null
+++ b/tests/compare_muts.py
@@ -0,0 +1,51 @@
+import argparse
+import json
+
+def parse_arguments():
+    parser = argparse.ArgumentParser(description='Process JSON files and generate drug resistance scores.')
+
+    parser.add_argument('--input1', required=True, help='Path to the first input JSON file')
+    parser.add_argument('--input2', required=True, help='Path to the second input JSON file')
+    parser.add_argument('--output1', required=True, help='Path to the first output JSON file')
+    parser.add_argument('--output2', required=True, help='Path to the second output JSON file')
+
+    return parser.parse_args()
+
+def process_json(input_path):
+    with open(input_path, 'r') as file:
+        data = json.load(file)
+
+    result_dict = {}
+    for item in data:
+        name = item['inputSequence']['header']
+        result_dict[name] = {}
+
+        for genes in item['drugResistance']:
+            gene = genes['gene']['name']
+            result_dict[name][gene] = {}
+
+            for drugs in genes['drugScores']:
+                drug = drugs['drug']['name']
+                result_dict[name][gene][drug] = float(drugs['score'])
+
+    return result_dict
+
+def main():
+    args = parse_arguments()
+
+    # Process the first input file
+    dic_py = process_json(args.input1)
+
+    # Process the second input file
+    dic_local = process_json(args.input2)
+
+    # Write results to the first output file
+    with open(args.output1, 'w') as file:
+        json.dump(dic_py, file, indent=4)
+
+    # Write results to the second output file
+    with open(args.output2, 'w') as file:
+        json.dump(dic_local, file, indent=4)
+
+if __name__ == "__main__":
+    main()
\ No newline at end of file