michaelgruenstaeudl / PlastomeBurstAndAlign

Extracting and aligning genes, introns, and intergenic spacers across plastid genomes using associative arrays
BSD 3-Clause "New" or "Revised" License
0 stars 5 forks source link

Preemptive handling of known raised exceptions & compound location handling for intergenic features #20

Closed alephnull7 closed 1 week ago

alephnull7 commented 1 week ago

Changes directly addressing listed issues:

Other notable changes:

michaelgruenstaeudl commented 1 week ago

When performing back-translation, back-translated sequences are only added to the aligned list if the process was successful (not None). Within the translation of individual sequences, the assertions have been replaced with None returns, and None is returned if the nucleotide evaluation was unsuccessful (None was returned). This allows all successful back-translations to be saved to file, instead of an issue with any individual sequence raising an exception and preventing the saving of a MultipleSeqAlignment object to file. Now, the No such file or directory error should only occur if no translations were successful.

Yes, good catch! That is an important improvement indeed.

michaelgruenstaeudl commented 1 week ago

Instead, I believe the intention was to add new entries to each key's list, which is what is now occurring. Edit: I reexamined this, and the dictionaries would not share any keys, so the previous implementation would work as expected. Instead, the new approach is just more streamlined.

Good catch too! While it would be highly unlikely that an CDS key would have the same name as an intron key (and, thus, override it) or vice versa, using dict.add() is a safer approach in any event.

michaelgruenstaeudl commented 1 week ago

Thank you for moving the code regarding the feature extraction of genes, introns, and intergenic spacers into their own classes (i.e., GeneFeature, IntronFeature, IntergenicFeature). The code is much cleaner because of it.