| 1 |
#ifndef __PLINK2_SET_H__ |
| 2 |
#define __PLINK2_SET_H__ |
| 3 |
|
| 4 |
// This file is part of PLINK 2.0, copyright (C) 2005-2025 Shaun Purcell, |
| 5 |
// Christopher Chang. |
| 6 |
// |
| 7 |
// This program is free software: you can redistribute it and/or modify it |
| 8 |
// under the terms of the GNU General Public License as published by the Free |
| 9 |
// Software Foundation, either version 3 of the License, or (at your option) |
| 10 |
// any later version. |
| 11 |
// |
| 12 |
// This program is distributed in the hope that it will be useful, but WITHOUT |
| 13 |
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 14 |
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 15 |
// more details. |
| 16 |
// |
| 17 |
// You should have received a copy of the GNU General Public License |
| 18 |
// along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 |
|
| 20 |
|
| 21 |
#include "plink2_common.h" |
| 22 |
|
| 23 |
#ifdef __cplusplus |
| 24 |
namespace plink2 { |
| 25 |
#endif |
| 26 |
|
| 27 |
PglErr ExtractExcludeRange(const char* fnames, const ChrInfo* cip, const uint32_t* variant_bps, uint32_t raw_variant_ct, VfilterType vft, uint32_t zero_based, uint32_t bed_border_bp, uint32_t max_thread_ct, uintptr_t* variant_include, uint32_t* variant_ct_ptr); |
| 28 |
|
| 29 |
// setdef is guaranteed to be 16-byte aligned. |
| 30 |
// Encoding (same as plink 1.9): |
| 31 |
// [0]: either number of ranges in set, or UINT32_MAX |
| 32 |
// If [0] is not UINT32_MAX: |
| 33 |
// [2k+1], [2k+2]: start and end of 0-based range #k (half-open); sorted |
| 34 |
// If [0] is UINT32_MAX: |
| 35 |
// [1]: offset of first bit (always divisible by 128) |
| 36 |
// [2]: number of bits (divisible by 128 unless a variant in the last block |
| 37 |
// is included) |
| 38 |
// [3]: 1 if all out-of-bounds bits are set, 0 otherwise (other flags may be |
| 39 |
// added later) |
| 40 |
// Empty sets are always stored in the first format, with [0] == 0. |
| 41 |
|
| 42 |
uint32_t IntervalInSetdef(const uint32_t* setdef, uint32_t variant_uidx_start, uint32_t variant_uidx_end); |
| 43 |
|
| 44 |
PglErr LoadAndSortIntervalBed(const char* fname, const ChrInfo* cip, const char* sorted_subset_ids, uint32_t zero_based, uint32_t border_extend, uintptr_t subset_ct, uintptr_t max_subset_id_blen, uint32_t max_thread_ct, uintptr_t* gene_ct_ptr, char** gene_names_ptr, uintptr_t* max_gene_id_blen_ptr, uintptr_t** chr_bounds_ptr, uint32_t*** genedefs_ptr, uintptr_t* chr_max_gene_ct_ptr); |
| 45 |
|
| 46 |
#ifdef __cplusplus |
| 47 |
} |
| 48 |
#endif |
| 49 |
|
| 50 |
#endif // __PLINK2_SET_H__ |