Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libhts
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Blaise LI
libhts
Commits
7e25a230
Commit
7e25a230
authored
6 years ago
by
Blaise Li
Browse files
Options
Downloads
Patches
Plain Diff
Context-manage gff file opening.
parent
fcfaae6c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libhts/libhts.py
+13
-13
13 additions, 13 deletions
libhts/libhts.py
with
13 additions
and
13 deletions
libhts/libhts.py
+
13
−
13
View file @
7e25a230
...
...
@@ -188,19 +188,19 @@ 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*.
"""
gtf_file
=
open
(
gtf_filename
,
"
r
"
)
gtf
=
BedTool
(
gtf_file
)
if
identifiers
:
ids
=
set
(
identifiers
)
def
feature_filter
(
feature
):
return
feature
[
2
]
==
feature_type
and
feature
[
id_kwd
]
in
ids
return
gtf
.
filter
(
feature_filter
)
else
:
# https://stackoverflow.com/a/13243870/1878788
def
empty_bed_generator
():
return
yield
return
empty_bed_generator
()
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
return
gtf
.
filter
(
feature_filter
)
else
:
# https://stackoverflow.com/a/13243870/1878788
def
empty_bed_generator
():
return
yield
return
empty_bed_generator
()
def
make_empty_bigwig
(
filename
,
chrom_sizes
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment