diff --git a/diploshic/makeFeatureVecsForChrArmFromVcfDiploid.py b/diploshic/makeFeatureVecsForChrArmFromVcfDiploid.py index de53aaa..b4f2bd2 100644 --- a/diploshic/makeFeatureVecsForChrArmFromVcfDiploid.py +++ b/diploshic/makeFeatureVecsForChrArmFromVcfDiploid.py @@ -141,6 +141,10 @@ def readSampleToPopFile(sampleToPopFileName): for i in range(len(positions)) if segmentStart <= positions[i] <= segmentEnd ] + if len(snpIndicesToKeep) == 0: + sys.exit( + "Error: no SNPs in the given segment of the chr arm; exiting\n" + ) positions = [positions[i] for i in snpIndicesToKeep] genos = allel.GenotypeArray(genos.subset(sel0=snpIndicesToKeep)) diff --git a/diploshic/makeFeatureVecsForChrArmFromVcf_ogSHIC.py b/diploshic/makeFeatureVecsForChrArmFromVcf_ogSHIC.py index 31b4b8f..4ab6d60 100644 --- a/diploshic/makeFeatureVecsForChrArmFromVcf_ogSHIC.py +++ b/diploshic/makeFeatureVecsForChrArmFromVcf_ogSHIC.py @@ -123,6 +123,10 @@ def getSnpIndicesInSubWins(subWinSize, lastSubWinEnd, snpLocs): for i in range(len(positions)) if segmentStart <= positions[i] <= segmentEnd ] + if len(snpIndicesToKeep) == 0: + sys.exit( + "Error: no SNPs in the given segment of the chr arm; exiting\n" + ) positions = [positions[i] for i in snpIndicesToKeep] refAlleles = [refAlleles[i] for i in snpIndicesToKeep] altAlleles = [altAlleles[i] for i in snpIndicesToKeep] diff --git a/meta.yaml b/meta.yaml index 86d32d7..4f2385f 100644 --- a/meta.yaml +++ b/meta.yaml @@ -1,6 +1,6 @@ package: name: diploshic - version: "0.34" + version: "0.4" source: git_url: https://github.com/kr-colab/diploshic