Skip to content

Commit f68c338

Browse files
committed
Start on calc_Bprime_per_chunk wrapper function
1 parent eeaf4f0 commit f68c338

3 files changed

Lines changed: 26 additions & 3 deletions

File tree

Bvalcalc/core/chromBcalc.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,11 @@ def chromBcalc(args, blockstart, blockend, chromosome, unlinked_B, prior_pos = N
141141
chrom_col = np.full(binned_positions.shape, chromosome, dtype="<U20")
142142

143143
output_data = np.core.records.fromarrays(
144-
[chrom_col,binned_positions.astype(int),binned_b_values.astype(float)],
145-
names='Chromosome,Position,B',formats='U20,i8,f8')
144+
[chrom_col,binned_positions.astype(int),binned_b_values.astype(float)],
145+
names='Chromosome,Position,B',formats='U20,i8,f8')
146+
147+
from Bvalcalc.core.helpers import calc_Bprime_per_chunk
148+
calc_Bprime_per_chunk()
146149

147150
if args.out is not None: # Write to CSV
148151
print(f"Writing B output to file...")
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from Bvalcalc.core.calculateB import calculateB_linear, calculateB_hri
2+
import numpy as np
3+
4+
def calc_Bprime_per_chunk():
5+
6+
print("gotcha")
7+
8+
9+
return
10+
#chunk_idx, chunk_size, chr_start, chr_size, num_chunks,
11+
# precise_chunks, lperchunk, rec_rate_per_chunk, gc_rate_per_chunk):

Bvalcalc/core/siteBcalc.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,20 @@ def siteBcalc(args):
1616

1717
## r = 1e-8
1818
## chunk_size = 20000
19-
## First we need to identify our linkage block of interest, which will be the area within a cM recombint length region, with a minimum U
2019

2120
## 0. Make a normal B-map.
2221

2322
## 1. Find consecutive chunks with local rec_rate below 0.1 * r with int_L > 0 to have interference calculation applied within them.
23+
import numpy as np
24+
r = 1e-8
25+
r_hri_threshold = 0.1 # only run HRI B when chunk r is less than: r * r_hri_threshold
26+
27+
chunk_rec_rate = np.array([0.001 * r, 0.5 * r])
28+
print(chunk_rec_rate[chunk_rec_rate > r_hri_threshold * r], 'Hi')
29+
30+
import sys
31+
sys.exit()
32+
2433
##
2534
## 2. Re-calculate B from everything EXCEPT within the region (distant B)
2635
##

0 commit comments

Comments
 (0)