+void Sequence::load_fasta(fs::path file_path, int seq_num,
+ int start_index, int end_index)
+{
+ fs::fstream data_file;
+ data_file.open(file_path, std::ios::in);
+
+ if (!data_file.good())
+ {
+ throw mussa_load_error("Sequence File: "+file_path.string()+" not found");
+ } else {
+ try {
+ load_fasta(data_file, seq_num, start_index, end_index);
+ } catch(sequence_empty_error e) {
+ // there doesn't appear to be any sequence
+ // catch and rethrow to include the filename
+ std::stringstream msg;
+ msg << "The selected sequence in "
+ << file_path.native_file_string()
+ << " appears to be empty";
+ throw sequence_empty_error(msg.str());
+ } catch(sequence_empty_file_error e) {
+ std::stringstream errormsg;
+ errormsg << file_path.native_file_string()
+ << " did not have any fasta sequences" << std::endl;
+ throw sequence_empty_file_error(errormsg.str());
+ }
+ }
+}
+