Skip to content

Commit cf4c42e

Browse files
authored
make pyranges optional again (#77)
1 parent 4635665 commit cf4c42e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kipoiseq/extractors/protein.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from kipoiseq.extractors.vcf_seq import VariantSeqExtractor
88
from kipoiseq.extractors.vcf_matching import SingleVariantMatcher
99
from typing import List
10-
import pyranges
1110
import pandas as pd
1211

1312
# TODO: convert print to logs
@@ -74,6 +73,7 @@ def _read_cds(gtf_file, duplicate_attr=False):
7473
Read, extract and filter valid cds from the given gtf_file
7574
:param gtf_file:
7675
"""
76+
import pyranges
7777
df = pyranges.read_gtf(gtf_file, as_df=True,
7878
duplicate_attr=duplicate_attr)
7979
cds = CDSFetcher._get_cds_from_gtf(df)
@@ -229,6 +229,7 @@ def __init__(self, gtf_file, fasta_file, vcf_file):
229229
self.vcf_file = str(vcf_file)
230230
self.cds_fetcher = CDSFetcher(self.gtf_file)
231231
# dataframe to pyranges
232+
import pyranges
232233
pr_cds = pyranges.PyRanges(self.cds_fetcher.cds.reset_index())
233234
# match variant with transcript_id
234235
self.single_variant_matcher = SingleVariantMatcher(

0 commit comments

Comments
 (0)