Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Blaise LI
libhts
Commits
2f357ca8
Commit
2f357ca8
authored
Jan 05, 2021
by
Blaise Li
Browse files
Script to extract reads from bam from bed regions.
parent
56cfa04d
Changes
4
Hide whitespace changes
Inline
Side-by-side
libhts/__init__.py
View file @
2f357ca8
__copyright__
=
"Copyright (C) 2020 Blaise Li"
__licence__
=
"GNU GPLv3"
__version__
=
0.
3
__version__
=
0.
4
from
.libhts
import
(
aligner2min_mapq
,
gtf_2_genes_exon_lengths
,
...
...
requirements.txt
View file @
2f357ca8
Cython
libbamutils
@
git+https://gitlab.pasteur.fr/bli/libbamutils.git@66879fb7e917dfa00e13da230310bb3b257766db
libworkflows
@
git+https://gitlab.pasteur.fr/bli/libworkflows.git@b29b854ff1db6c87386007808286207b8af11b9d
matplotlib
networkx
...
...
scripts/bed_bam2fq.py
0 → 100755
View file @
2f357ca8
#!/usr/bin/env python3
# Copyright (C) 2020 Blaise Li
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
"""Extracts the fastq reads from a bam file
corresponding to the annotations provided in a bed file.
"""
from
argparse
import
(
ArgumentParser
,
ArgumentDefaultsHelpFormatter
)
import
sys
from
libbamutils
import
BamFile
def
main
():
"""Run the command-line script."""
parser
=
ArgumentParser
(
description
=
__doc__
,
formatter_class
=
ArgumentDefaultsHelpFormatter
)
parser
.
add_argument
(
"-b"
,
"--bedfile"
,
required
=
True
,
help
=
"Input bed file."
)
parser
.
add_argument
(
"-a"
,
"--bamfile"
,
required
=
True
,
help
=
"Input bam file."
)
args
=
parser
.
parse_args
()
bamfile
=
BamFile
(
args
.
bamfile
)
for
fastq
in
bamfile
.
bed_to_fastq
(
args
.
bedfile
):
print
(
fastq
,
end
=
""
)
return
0
if
__name__
==
"__main__"
:
sys
.
exit
(
main
())
setup.py
View file @
2f357ca8
...
...
@@ -34,9 +34,11 @@ setup(
packages
=
find_packages
(),
scripts
=
[
"scripts/bam2bigwig.sh"
,
"scripts/sam2indexedbam.sh"
,
"scripts/bed_bam2fq.py"
,
"scripts/copypaste_bigwig_regions.py"
,
"scripts/extract_annot_start.py"
],
install_requires
=
[
"libbamutils @ git+https://gitlab.pasteur.fr/bli/libbamutils.git@66879fb7e917dfa00e13da230310bb3b257766db"
,
#"libworkflows @ git+https://gitlab+deploy-token-31:isEzpsgbNf2sJMdUDy2g@gitlab.pasteur.fr/bli/libworkflows.git@744dd79b579577cb6e131653260d7990946be3ad#egg=libworkflows-0.1",
#"libworkflows @ git+https://gitlab+deploy-token-31:isEzpsgbNf2sJMdUDy2g@gitlab.pasteur.fr/bli/libworkflows.git#egg=libworkflows-0.1",
#"libworkflows @ git+https://gitlab+deploy-token-31:isEzpsgbNf2sJMdUDy2g@gitlab.pasteur.fr/bli/libworkflows.git",
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment