Skip to content

Commit

Permalink
Fix an issue related to pybedtool/bedtool version (naming of sequence…
Browse files Browse the repository at this point in the history
…s that differs due to name/name+/nameOnly arguments) #2
  • Loading branch information
dputhier committed Apr 3, 2020
1 parent b272f49 commit 7e187e4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pygtftk/plugins/get_feat_seq.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
Get feature sequences (i.e. column 3) in a flexible fasta format from a GTF file.
"""
import argparse
import gc
import os
import re
import sys

import gc

from pybedtools.helpers import BEDToolsError

from pygtftk import arg_formatter
Expand Down Expand Up @@ -157,15 +156,16 @@ def get_feat_seq(inputfile=None,
try:
# The nameOnly argument is not supported
# through all Bedtools versions

feat_seq = gtf.select_by_key("feature",
feature_type
).to_bed(name=label.split(","),
sep=separator
).sequence(fi=genome.name,
name=True,
nameOnly=True,
s=force_strandedness)
except BEDToolsError:

feat_seq = gtf.select_by_key("feature",
feature_type
).to_bed(name=label.split(","),
Expand All @@ -174,13 +174,12 @@ def get_feat_seq(inputfile=None,
name=True,
s=force_strandedness)


id_printed = set()

to_print = True

for _, line in enumerate(open(feat_seq.seqfn)):
print("LINE=" + line)

if line.startswith(">"):

# This (+/-) may be added by pybedtool
Expand Down

0 comments on commit 7e187e4

Please sign in to comment.