Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add acidbio/bed tests #188

Merged
merged 5 commits into from
May 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,13 @@ jobs:
- name: Run tests
run: pytest --cov=./ --cov-report=xml

- name: Run acidbio BED tests
run: |
git clone https://github.com/mdshw5/acidbio.git
cd acidbio/bed
python3 -m pip install -r requirements.txt
cp config_template.yaml config.yaml
python3 bedrunall.py --tool pyfaidx BED03 ./

- name: Codecov
uses: codecov/[email protected]
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ pysam
requests
coverage
pyfasta
pyvcf
pyvcf3
numpy
biopython
4 changes: 3 additions & 1 deletion pyfaidx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,7 @@ def __init__(self,
try:
import vcf
except ImportError:
raise ImportError("PyVCF must be installed for FastaVariant.")
raise ImportError("PyVCF3 must be installed for FastaVariant.")
if call_filter is not None:
try:
key, expr, value = call_filter.split() # 'GQ > 30'
Expand Down Expand Up @@ -1245,6 +1245,8 @@ def map_to_function(rname):


def bed_split(bed_entry):
if bed_entry[0] == "#":
return (None, None, None)
try:
rname, start, end = bed_entry.rstrip().split()[:3]
except (IndexError, ValueError):
Expand Down
3 changes: 3 additions & 0 deletions pyfaidx/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ def write_sequence(args):
header = False
for region in regions_to_fetch:
name, start, end = split_function(region)
# allow the split_funtion to return None to signify input we should skip
if name == None:
continue
if args.size_range:
if start is not None and end is not None:
sequence_len = end - start
Expand Down