Skip to content

Commit

Permalink
Merge pull request #336 from Hoeze/aparent_v3
Browse files Browse the repository at this point in the history
fix missing reverse-complement in reference sequence fetching for APARENT
  • Loading branch information
Hoeze authored Jul 4, 2022
2 parents 77fa3d8 + 61f1f93 commit ae8cf12
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions APARENT/site_probabilities/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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),
)
5 changes: 4 additions & 1 deletion APARENT/veff/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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)
)

0 comments on commit ae8cf12

Please sign in to comment.