Skip to content

Commit

Permalink
make pyranges optional again (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoeze authored Jun 4, 2020
1 parent 4635665 commit cf4c42e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kipoiseq/extractors/protein.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from kipoiseq.extractors.vcf_seq import VariantSeqExtractor
from kipoiseq.extractors.vcf_matching import SingleVariantMatcher
from typing import List
import pyranges
import pandas as pd

# TODO: convert print to logs
Expand Down Expand Up @@ -74,6 +73,7 @@ def _read_cds(gtf_file, duplicate_attr=False):
Read, extract and filter valid cds from the given gtf_file
:param gtf_file:
"""
import pyranges
df = pyranges.read_gtf(gtf_file, as_df=True,
duplicate_attr=duplicate_attr)
cds = CDSFetcher._get_cds_from_gtf(df)
Expand Down Expand Up @@ -229,6 +229,7 @@ def __init__(self, gtf_file, fasta_file, vcf_file):
self.vcf_file = str(vcf_file)
self.cds_fetcher = CDSFetcher(self.gtf_file)
# dataframe to pyranges
import pyranges
pr_cds = pyranges.PyRanges(self.cds_fetcher.cds.reset_index())
# match variant with transcript_id
self.single_variant_matcher = SingleVariantMatcher(
Expand Down

0 comments on commit cf4c42e

Please sign in to comment.