X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=mussa.git;a=blobdiff_plain;f=alg%2Fsequence.cpp;h=452f5f98f204d37bf0f85f173eb1f42fc2a07313;hp=147fdce3b7e2c015eb20741964327954f70a924a;hb=516c775c2bc35f526a223e3f6968cbd1f8fa3402;hpb=652e5d9a94792b974d79a35e83de0f77d49ea2c7 diff --git a/alg/sequence.cpp b/alg/sequence.cpp index 147fdce..452f5f9 100644 --- a/alg/sequence.cpp +++ b/alg/sequence.cpp @@ -22,6 +22,7 @@ // ---------- sequence.cc ----------- // ---------------------------------------- #include +#include namespace fs = boost::filesystem; #include @@ -313,10 +314,18 @@ void Sequence::set_filtered_sequence(const std::string &in_seq, void Sequence::load_annot(fs::path file_path, int start_index, int end_index) { + if (not fs::exists(file_path)) { + throw mussa_load_error("Annotation File " + file_path.string() + " was not found"); + } + if (fs::is_directory(file_path)) { + throw mussa_load_error(file_path.string() + + " is a directory, please provide a file for annotations." + ); + } fs::fstream data_stream(file_path, std::ios::in); if (!data_stream) { - throw mussa_load_error("Sequence File: " + file_path.string() + " not found"); + throw mussa_load_error("Error loading annotation file " + file_path.string()); } // so i should probably be passing the parse function some iterators