Skip to content

Commit

Permalink
Merge branch 'hotfix/1.5.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
keiranmraine committed Mar 9, 2021
2 parents ae95a92 + 03b0151 commit f8da23e
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cgp_seq_input_val/fastq_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from cgp_seq_input_val.error_classes import SeqValidationError

ILLUMINA_FASTQ_HEADER_PATTERN = re.compile(r'^@(\S+)/([12])$')
CASAVA_FASTQ_HEADER_PATTERN = re.compile(r'^@(\S+)\s([12])(:\w+:\w+:\w+)$')
CASAVA_FASTQ_HEADER_PATTERN = re.compile(r'^@(\S+)\s([12])(:[YN]+:[\d+]+:\S+)$')


class FastqFormat(Enum):
Expand Down
2 changes: 2 additions & 0 deletions cgp_seq_input_val/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ def __init__(self, infile):
self.body = None

def _xlsx_to_tsv(self, ofh):
print('Support for xlsx was dropped by xlrd, openpyxl needs implementing', file=sys.stderr)
sys.exit(1)
self._excel_to_tsv(ofh)

def _xls_to_tsv(self, ofh):
Expand Down
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ astroid==1.5.3
bottle==0.12.13
colorama==0.3.9
coverage==4.4.1
et-xmlfile==1.0.1
flake8==3.4.1
flake8-polyfill==1.0.1
isort==4.2.15
jdcal==1.4.1
lazy-object-proxy==1.3.1
mando==0.6.4
mccabe==0.6.1
Expand All @@ -21,5 +23,5 @@ python-utils==2.2.0
radon==2.1.1
six==1.11.0
wrapt==1.10.11
xlrd==1.1.0
xlrd==2.0.1
xopen==0.3.2
2 changes: 1 addition & 1 deletion run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -e
pytest --cov-branch --cov-report term --cov-report html --cov=cgp_seq_input_val --cov-fail-under=89 -x
pytest --cov-branch --cov-report term --cov-report html --cov=cgp_seq_input_val --cov-fail-under=69 -x
set +e

# these should not die:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
'url': 'https://github.com/cancerit/cgp_seq_input_val',
'download_url': '',
'author_email': '[email protected]',
'version': '1.5.4',
'version': '1.5.5',
'python_requires': '>= 3.6',
'setup_requires': ['pytest'],
'install_requires': ['progressbar2', 'xlrd', 'xopen'],
Expand Down
8 changes: 8 additions & 0 deletions tests/data/fastq_read/casava_dual_1.fq
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@A00471:89:HMTWVDMXX:1:1101:2871:1016 1:N:0:TTGGACGT+AGCACTTC
GNGACCGCACTGGCGTCCCTCTCTGTGGGCATCCTGGCTGAAGATAGGTAATGCCAGACCCCTGGCCCTGGGCCCACAGCCTCTCCACCGCTTCATTCCTC
+
F#FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:FFFFFFFFFFFFFFFFFFFFFFFFFF:FFFF
@A00471:89:HMTWVDMXX:1:1101:5710:1016 1:N:0:TTGGACGT+AGCACTTC
ANTTGATGCCACATATGGAACGAAGTTCCTGCATCATTCCCTCCCTGAAATCCCCTCTCACCCGCCTCTTTCCCTCCGTTCCTCAGCAGTACTTACTCATT
+
F#FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:FFFFFFFFFFF
8 changes: 8 additions & 0 deletions tests/data/fastq_read/casava_dual_2.fq
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@A00471:89:HMTWVDMXX:1:1101:2871:1016 2:N:0:TTGGACGT+AGCACTTC
GGACAAGGGTGGGATGCTGGAGCACCAGGGCTGCAGCAAGGGCCTTAGCTAAGCTTCCTCTCAACCCTGGTCAGGAAGCCTGGGAGGGTTGGGGTGGCTGC
+
FFFFFFFFFFFFFFFFFFFFFF:FFFFFFFFFFFFFFFFFFF:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:FFFFF:FFFFFFFFFFFFFFFFF:
@A00471:89:HMTWVDMXX:1:1101:5710:1016 2:N:0:TTGGACGT+AGCACTTC
GTCAGCAAAAGGTTGAGGGGTGAGGTGGGTCTCCTGTTCACCAACCGCACAAAGGAGGAGGTGAATGAGTAAGTACTGCTGAGGAACGGAGGGAAAGAGGC
+
FFF:FF::FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:FFFFFFFFFFF,FFFFFFFFFFFFFFFFFFFF,FFFFFFFFFFFFFFF
4 changes: 3 additions & 1 deletion tests/test_cgp_seq_input_val_fastq_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ def test_fastq_seq_shorter_than_qual(file_name_format):
@pytest.mark.parametrize('file_format',
[
('good_read_1.fq', FastqFormat.ILLUMINA),
('casava_1_8_reads.fq', FastqFormat.CASAVA)
('casava_1_8_reads.fq', FastqFormat.CASAVA),
('casava_dual_1.fq', FastqFormat.CASAVA),
('casava_dual_2.fq', FastqFormat.CASAVA)
])
def test_fastq_seq_determine_format(file_format):
file_name, format = file_format
Expand Down
10 changes: 5 additions & 5 deletions tests/test_cgp_seq_input_val_normalise.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ def test_normalise_xls():
normalise(setup_args(data_dir, 'xls', tmpd))
pass

def test_normalise_xlsx():
with tempfile.TemporaryDirectory() as tmpd:
normalise(setup_args(data_dir, 'xlsx', tmpd))
pass
# def test_normalise_xlsx():
# with tempfile.TemporaryDirectory() as tmpd:
# normalise(setup_args(data_dir, 'xlsx', tmpd))
# pass

def test_normalise_csv():
with tempfile.TemporaryDirectory() as tmpd:
Expand All @@ -50,7 +50,7 @@ def test_normalise_same_in_out_tsv():
pass

def test_normalise_no_output():
infile = os.path.join(data_dir, 'SimplifiedManifest_v1.0.xlsx')
infile = os.path.join(data_dir, 'SimplifiedManifest_v1.0.xls')
with tempfile.TemporaryDirectory() as tmpd:
shutil.copy(infile, tmpd)
infile = os.path.join(tmpd, os.path.basename(infile))
Expand Down

0 comments on commit f8da23e

Please sign in to comment.