Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/tinypeel/Peeling/PeelingIO.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import numpy as np
from numba import jit
from ..tinyhouse import InputOutput
import warnings


def readInSeg(pedigree, fileName, start=None, stop=None):
Expand Down Expand Up @@ -58,7 +59,9 @@ def readInSeg(pedigree, fileName, start=None, stop=None):
)

if idx not in pedigree.individuals:
print(f"Individual {idx} is not found in pedigree. Individual ignored.")
warnings.warn(
f"Individual {idx} is not found in pedigree. Individual ignored."
)
else:
ind = pedigree.individuals[idx]
if e == 0:
Expand All @@ -74,7 +77,9 @@ def readInSeg(pedigree, fileName, start=None, stop=None):
indHit[ind.idn] += 1
for ind in pedigree:
if indHit[ind.idn] != 4:
print(f"No segregation information found for individual {ind.idx}")
warnings.warn(
f"No segregation information found for individual {ind.idx}"
)

return seg

Expand Down
11 changes: 7 additions & 4 deletions src/tinypeel/Peeling/PeelingInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from numba.experimental import jitclass
import numpy as np
from collections import OrderedDict
import warnings

from ..tinyhouse import ProbMath
from ..tinyhouse import HaplotypeOperations
Expand Down Expand Up @@ -149,18 +150,18 @@ def createPeelingInfo(pedigree, args, createSeg=True, phaseFounder=False):

if args.penetrance is not None:
if peelingInfo.isXChr:
print(
warnings.warn(
"Using an external penetrance file and the x_chr option is highly discouraged. Please do not use."
)

if args.est_geno_error_prob:
print(
warnings.warn(
"External penetrance file included, but est_geno_error_prob flag used. The two options are incompatible. est_geno_error_prob set to false."
)
args.est_geno_error_prob = False

if args.est_seq_error_prob:
print(
warnings.warn(
"External penetrance file included, but est_seq_error_prob flag used. The two options are incompatible. est_seq_error_prob set to false."
)
args.est_seq_error_prob = False
Expand Down Expand Up @@ -265,7 +266,9 @@ def addPenetranceFromExternalFile(pedigree, peelingInfo, fileName, args):
penetranceLine = np.array([float(val) for val in parts], dtype=np.float32)

if idx not in pedigree.individuals:
print("Individual", idx, "not found in pedigree. Individual ignored.")
warnings.warn(
"Individual", idx, "not found in pedigree. Individual ignored."
)
else:
ind = pedigree.individuals[idx]
peelingInfo.penetrance[ind.idn, e, :] *= penetranceLine
Expand Down
6 changes: 4 additions & 2 deletions src/tinypeel/Peeling/PeelingUpdates.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

from . import PeelingInfo

import warnings

#########################################################################################
# In this module we will update 3 things: #
# 1) Our estimate for the MAF (both prior to peeling and after each peeling cycle) . #
Expand All @@ -30,7 +32,7 @@ def updateMaf(pedigree, peelingInfo):
:return: None. The function updates the pedigree.AAP attribute with the new alternative allele frequencies.
"""
if peelingInfo.isXChr:
print(
warnings.warn(
"Updating error rates and alternative allele frequencies for X chromosomes are not well test and will break in interesting ways. Recommend running without that option."
)
MF = list(pedigree.AAP.keys())
Expand Down Expand Up @@ -256,7 +258,7 @@ def updatePenetrance(pedigree, peelingInfo, args):
peelingInfo.seqError = updateSeqError(pedigree, peelingInfo)

if peelingInfo.isXChr:
print(
warnings.warn(
"Updating error rates and minor allele frequencies for X chromosomes are not well test and will break in interesting ways. Recommend running without that option."
)
phaseFounder = not args.no_phase_founder
Expand Down
2 changes: 1 addition & 1 deletion src/tinypeel/tinypeel.py
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ def main():

singleLocusMode = args.method == "single"
if args.method == "multi" and args.segfile:
print("Running in multi-locus mode, external segfile ignored")
warnings.warn("Running in multi-locus mode, external segfile ignored")

# For now, only support a single phenotype (will remove in future)
if args.phenotype is not None and pedigree.nPheno > 1:
Expand Down
Loading