Commit 1843ade5 authored by Blaise Li's avatar Blaise Li
Browse files

Fix empty BedTool: need to pass file name, not fh.

parent 519923a0
......@@ -189,12 +189,11 @@ def id_list_gtf2bed(identifiers, gtf_filename, feature_type="transcript", id_kwd
in the feature annotations in the gtf_file. These feature IDs will be
matched against the elements in *identifiers*.
with open(gtf_filename, "r") as gtf_file:
gtf = BedTool(gtf_file)
if identifiers:
ids = set(identifiers)
def feature_filter(feature):
return feature[2] == feature_type and feature[id_kwd] in ids
gtf = BedTool(gtf_filename)
return gtf.filter(feature_filter)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment