18#ifndef _MS_SPECIFICITY_VISIBILITY_H
19#define _MS_SPECIFICITY_VISIBILITY_H
25namespace matrix_science {
27 class ms_umod_specificity;
28 class ms_umod_configfile;
48 class MS_MASCOTRESFILE_API ms_spec_visibility
55 ms_spec_visibility(std::string site);
57 ms_spec_visibility(std::string site, std::string position);
59 ~ms_spec_visibility();
62 std::string getSite();
64 void setSite(std::string s);
66 std::string getPosition();
68 void setPosition(std::string s);
73 void setHidden(
bool bHide);
76 bool inShortList()
const;
78 void showInShortList(
bool b);
80 bool inLongList()
const;
82 void showInLongList(
bool b);
84 bool inErrorTolerant()
const;
86 void useInErrorTolerant(
bool b);
91 void setOveridden(
bool b);
97 std::string m_position;
98 bool m_show_in_short_list;
99 bool m_show_in_long_list;
100 bool m_use_in_error_tolerant;
117 class MS_MASCOTRESFILE_API ms_mod_visibility
124 ~ms_mod_visibility();
127 std::string getName();
129 void setName(std::string s);
132 void setNumberOfSpecs(
int spec_count);
134 int getNumberOfSpecs();
136 void getDefaults(
int spec_number,
const ms_umod_specificity *spec);
138 void setDefaults(
int spec_number,
const char site,
bool hidden);
140 void setDefaults(
int spec_number,
const char site, std::string position,
bool hidden);
144 void applyVisibilities( ms_umod_specificity *spec);
146 bool updateVisibilities(
const ms_umod_specificity *spec);
148 bool updateIsPrivate(
bool is_private);
151 bool isPrivate()
const;
153 void setPrivate(
bool b);
156 bool isPrivacyEnabled()
const;
158 void setPrivacyEnabled(
bool b);
165 void setOveridden(
bool b);
170 void setDeleted(
bool b);
173 ms_spec_visibility &getSpecVisibility(
int index);
175 ms_spec_visibility &getSpecVisibility(std::string site,
bool bCreate);
177 ms_spec_visibility &getSpecVisibility(std::string site, std::string position,
bool bCreate);
181 typedef std::vector< ms_spec_visibility> spec_vis_vector;
182 spec_vis_vector m_specs;
185 ms_spec_visibility m_default_spec;
187 bool m_isPrivacyEnabled;
203 class MS_MASCOTRESFILE_API ms_mod_visibility_helper :
public ms_errors
207 ms_mod_visibility_helper();
210 ms_mod_visibility_helper(
const matrix_science::ms_session *session,
const std::string &visibility_filename, ms_umod_configfile *config);
212 ms_mod_visibility_helper(
const std::vector<int> & groupIds,
const std::string &visibility_filename, ms_umod_configfile *config);
214 ms_mod_visibility_helper(
const matrix_science::ms_session *session,
const std::string &visibility_filename, ms_modfile *modfile);
216 ms_mod_visibility_helper(
const std::string &visibility_full_filename);
218 ~ms_mod_visibility_helper();
224 bool saveToGroupFiles(
const matrix_science::ms_session *session,
const std::string &visibility_filename,
const bool saveAllForCrosslinking =
false);
226 bool saveToFile(
const std::string &filename,
const bool saveAllForCrosslinking =
false);
229 ms_mod_visibility *getModVisibility(
int index);
231 ms_mod_visibility *getModVisibility(
const std::string &mod_title,
bool bCreate);
233 void removeModVisibilty(
const std::string &mod_title);
241 static void getUserGroupVisibilty(
243 std::vector<std::string> &excluded_usergroups, std::vector<std::string> &included_usergroups);
245 static void setUserGroupVisibilty(
247 std::vector<std::string> &excluded_usergroups, std::vector<std::string> &included_usergroups);
250 static void getDefaultUserGroups(
252 std::vector<std::string> &excluded_usergroups, std::vector<std::string> &included_usergroups);
256 ms_mod_visibility_helper(
const ms_mod_visibility_helper & src);
257 ms_mod_visibility_helper& operator=(
const ms_mod_visibility_helper & right);
260 void getDefaults(ms_umod_configfile *config);
261 void getDefaults(ms_modfile *modfile);
262 bool getUserGroupFileNames(
const matrix_science::ms_session *session,
const std::string &visibility_filename,
bool bAllGroups,
const std::vector<int> * groupIds = NULL);
264 bool loadFromFile(
const std::string &filename);
265 void loadVisibility(
const matrix_science::ms_session *session,
const std::string &visibility_filename,
const std::vector<int> * groupIds = NULL);
267 void clearOverrideFlags();
269 bool getSpecSitesFromModString(std::string modfile_spec_name, std::string &sites, std::string &position);
271 typedef std::vector< ms_mod_visibility> mod_vis_vector;
272 mod_vis_vector m_mods;
274 ms_mod_visibility m_default_mod;
276 std::vector<std::string> m_userGroupVisibilityFiles;
Use this class in order to read in the amino acid modification file.
Definition: ms_modfile.hpp:407
Use this class to determine if a user is logged in and if they have 'permission' to perform tasks.
Definition: ms_security_session.hpp:123
This class represents the file unimod.xml.
Definition: ms_umod_configfile.hpp:54