void
Mussa::save(fs::path save_path)
{
- fs::path flp_filepath;
fs::fstream save_file;
ostringstream append_info;
int dir_create_status;
if (not fs::exists(save_path)) {
fs::create_directory(save_path);
}
+
+ std::string basename = save_path.leaf();
+ fs::path museq(basename + ".museq", fs::native);
+
// save sequence and annots to a special mussa file
- save_file.open(save_path / (save_path.leaf()+".museq"), ios::out);
+ save_file.open(save_path / museq, ios::out);
save_file << "<Mussa_Sequence>" << endl;
for(vector<Sequence>::size_type i = 0; i < the_seqs.size(); i++)
// if we have any motifs, save them.
if (motif_sequences.size()) {
- save_motifs(save_path/(save_path.leaf()+".mtl"));
+ fs::path mtl(basename + ".mtl", fs::native);
+ save_motifs(save_path / mtl);
}
// save nway paths to its mussa save file
- the_paths.save(save_path / (save_path.leaf()+ ".muway"));
+ fs::path muway(basename + ".muway", fs::native);
+ the_paths.save(save_path / muway);
for(vector<Sequence>::size_type i = 0; i < the_seqs.size(); i++) {
for(vector<Sequence>::size_type i2 = i+1; i2 < the_seqs.size(); i2++)
{
append_info.str("");
append_info << "_sp_" << i << "v" << i2;
- all_comps[i][i2].save(save_path/(save_path.leaf()+append_info.str()+".flp"));
+ fs::path flp(basename+append_info.str()+".flp", fs::native);
+ all_comps[i][i2].save(save_path / flp);
}
}