sanger-pathogens / Bio-Tradis

A set of tools to analyse the output from TraDIS analyses
https://sanger-pathogens.github.io/Bio-Tradis/
Other
22 stars 29 forks source link

Ticket 463867: What if a tag isn't found? #58

Closed bewt85 closed 8 years ago

bewt85 commented 8 years ago

During one step of the analysis, Tradis filters out all of the reads from a fastq which don't contain a specified tag. This was causing errors if none of the reads have that tag.

I've changed the behaviour so that if one of the input files doesn't have the tag it raises a warning and skips that input file out of the rest of the analysis.

If none of the input files have a read with the tag in them, it raises a warning for each input file and then fails noisily.

I've added tests for the happy case (all inputs have the tag), the mixed case and the unhappy case and everything seems happy.

There might have been better ways of doing this. I'm in two minds about the way I've raised / caught exceptions and I'm not sure if there was a better way to have caught / counted the warnings. Any suggestions or feedback would be warmly received.