diff --git a/APARENT/site_probabilities/dataloader.py b/APARENT/site_probabilities/dataloader.py index 2c5aef347..e6f18640a 100644 --- a/APARENT/site_probabilities/dataloader.py +++ b/APARENT/site_probabilities/dataloader.py @@ -21,7 +21,9 @@ def __init__( self.reference_sequence = reference_sequence self.interval_attrs = interval_attrs - self.variant_seq_extractor = VariantSeqExtractor(reference_sequence=reference_sequence) + if not self.reference_sequence.use_strand: + raise ValueError( + "Reference sequence fetcher does not use strand but this is needed to obtain correct sequences!") self.one_hot = OneHot() @@ -134,5 +136,5 @@ def __init__( super().__init__( regions_of_interest=roi, - reference_sequence=FastaStringExtractor(fasta_file), + reference_sequence=FastaStringExtractor(fasta_file, use_strand=True), ) diff --git a/APARENT/veff/dataloader.py b/APARENT/veff/dataloader.py index 2580f71de..af76eb762 100644 --- a/APARENT/veff/dataloader.py +++ b/APARENT/veff/dataloader.py @@ -23,6 +23,9 @@ def __init__( self.variants = variants self.interval_attrs = interval_attrs + if not self.reference_sequence.use_strand: + raise ValueError( + "Reference sequence fetcher does not use strand but this is needed to obtain correct sequences!") self.variant_seq_extractor = VariantSeqExtractor(reference_sequence=reference_sequence) self.matcher = SingleVariantMatcher( @@ -155,6 +158,6 @@ def __init__( from kipoiseq.extractors import MultiSampleVCF super().__init__( regions_of_interest=roi, - reference_sequence=FastaStringExtractor(fasta_file), + reference_sequence=FastaStringExtractor(fasta_file, use_strand=True), variants=MultiSampleVCF(vcf_file, lazy=vcf_lazy) )