Skip to content

Commit

Permalink
extend nmax domains
Browse files Browse the repository at this point in the history
from 32 to 64
  • Loading branch information
joellembatchou committed Jul 31, 2023
1 parent 782ae8c commit ce11794
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/Geno.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3298,7 +3298,7 @@ void check_in_map_from_files_sets(bool const& keep, map <string, vector<int>>& m

}

void get_masks_info(const struct in_files* files, struct param* params, struct filter* filters, map<std::string, anno_name>& anno_map, std::map <std::string, std::map <std::string, uint32_t>>& regions, vector<maskinfo>& mask_map, std::vector <std::vector<string>>& mask_out, uint64& all_masks, vector<snp>& snpinfo, mstream& sout) {
void get_masks_info(const struct in_files* files, struct param* params, struct filter* filters, map<std::string, anno_name>& anno_map, std::map <std::string, std::map <std::string, uint64>>& regions, vector<maskinfo>& mask_map, std::vector <std::vector<string>>& mask_out, uint64& all_masks, vector<snp>& snpinfo, mstream& sout) {

// read annotation categories if specified
if(params->w_anno_lab) read_anno_cat(files, params, anno_map, sout);
Expand Down Expand Up @@ -3370,12 +3370,12 @@ void read_anno_cat(const struct in_files* files, struct param* params, map<strin
sout << "n_categories = " << lineread << endl;
}

void read_anno(struct param* params, const struct in_files* files, struct filter* filters, map<string, anno_name>& anno_map, std::map <std::string, std::map <std::string, uint32_t>>& regions, vector<snp>& snpinfo, mstream& sout) {
void read_anno(struct param* params, const struct in_files* files, struct filter* filters, map<string, anno_name>& anno_map, std::map <std::string, std::map <std::string, uint64>>& regions, vector<snp>& snpinfo, mstream& sout) {

int lineread = 0, col_cat = 2, nregions = 0;
uint32_t snp_pos, ncat = 0, n_anno_read = 0;
uint64 null_id = 0ULL;
uint32_t null_region = 0ULL;
uint64 null_region = 0ULL;
double set_weight = 0;
anno_name new_anno;
annoinfo ainfo;
Expand Down Expand Up @@ -3447,7 +3447,7 @@ void read_anno(struct param* params, const struct in_files* files, struct filter
// check if new set
if (!in_map(gname, regions)){ // create new map with region for set
BIT_SET(ainfo.regionid, 0); // set first bit
std::map <std::string, uint32_t> gene_region_map;
std::map <std::string, decltype(null_region)> gene_region_map;
gene_region_map[tmp_str_vec[col_cat-1]] = ainfo.regionid;
regions[gname] = gene_region_map;
nregions++;
Expand Down
8 changes: 4 additions & 4 deletions src/Geno.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include "pgenlibr.h"

struct annoinfo {
uint32_t regionid = 0ULL;
uint64 regionid = 0ULL;
uint64 id = 0ULL;
};

Expand Down Expand Up @@ -234,16 +234,16 @@ struct anno_name {
struct maskinfo {
std::string name, region_name = "";
uint64 id = 0ULL;
uint32_t region = 0ULL;
uint64 region = 0ULL;
};

void read_setlist(const struct in_files*,struct param*,struct filter*,std::vector<std::vector<vset>>&,std::vector<snp>&,const uint64,const double,mstream&);
void check_sets_include_exclude(bool const&,const struct in_files*,struct param*,struct filter*,std::vector<std::vector<vset>>&,mstream&);
void check_in_map_from_files_sets(bool const&,std::map<std::string,std::vector<int>>&,std::vector<std::string> const&,bool const&,mstream&);

void get_masks_info(const struct in_files*,struct param*,struct filter*,std::map<std::string,anno_name>&,std::map <std::string, std::map <std::string,uint32_t>>&,std::vector<maskinfo>&,std::vector<std::vector<std::string>>&,uint64&,std::vector<snp>&,mstream& sout);
void get_masks_info(const struct in_files*,struct param*,struct filter*,std::map<std::string,anno_name>&,std::map <std::string, std::map <std::string,uint64>>&,std::vector<maskinfo>&,std::vector<std::vector<std::string>>&,uint64&,std::vector<snp>&,mstream& sout);
void read_anno_cat(const struct in_files*,struct param*,std::map<std::string,anno_name>&,mstream& sout);
void read_anno(struct param*,const struct in_files*,struct filter*,std::map<std::string,anno_name>&,std::map <std::string, std::map <std::string,uint32_t>>&,std::vector<snp>&,mstream& sout);
void read_anno(struct param*,const struct in_files*,struct filter*,std::map<std::string,anno_name>&,std::map <std::string, std::map <std::string,uint64>>&,std::vector<snp>&,mstream& sout);
void read_aafs(const double,const struct in_files*,struct filter*,std::vector<snp>&,bool const&,mstream& sout);
bool check_singleton_column(std::string const&);
void read_masks(const struct in_files*,struct param*,std::map<std::string,anno_name>&,std::vector<maskinfo>&,std::vector<std::vector<std::string>>&,uint64&,mstream& sout);
Expand Down
2 changes: 1 addition & 1 deletion src/Masks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void GenoMask::setBins(struct param* params, mstream& sout){
void GenoMask::prepMasks(int const& ntotal, const string& setID) {

maskinfo tmp_region_mask;
std::map <std::string, uint32_t>::iterator itr;
std::map <std::string, decltype(tmp_region_mask.region)>::iterator itr;

// make new set of masks if using set regions
if(w_regions){
Expand Down
2 changes: 1 addition & 1 deletion src/Masks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class GenoMask {

public:
std::map <std::string, anno_name> annotations; // store identifier as 1 byte vector
std::map <std::string, std::map <std::string, uint32_t>> regions; // store identifier as 1 byte vector
std::map <std::string, std::map <std::string, uint64>> regions; // store identifier as 1 byte vector
std::vector <maskinfo> masks, base_masks;
std::vector <std::vector <std::string>> mask_out, list_masks;//contains mask info
Eigen::VectorXd aafs;
Expand Down
2 changes: 1 addition & 1 deletion src/Regenie.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ struct param {
bool set_select_list = false; // comma separated list of sets given
bool keep_sets = false, rm_sets = false; // user specify to filter sets in analysis
bool w_regions = false; // categorize by set regions
uint max_cat = 64, nmax_regions = 32; // maximum number of annotations (to fit in uint64)
uint max_cat = 64, nmax_regions = 64; // maximum number of annotations (to fit in uint64)
std::vector<std::string> mbins; // temporary object to store aaf bins
bool mask_rule_max = true, mask_rule_comphet = false; // default use max to combine mask
std::string mask_rule = "max";
Expand Down

0 comments on commit ce11794

Please sign in to comment.