Skip to content
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
4 changes: 2 additions & 2 deletions .github/workflows/qiita-plugin-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.5", "3.6", "3.9", "3.10", "3.11", "3.12"]
python-version: ["2.7", "3.5", "3.6", "3.9", "3.10", "3.11", "3.12"]
steps:
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
Expand All @@ -35,7 +35,7 @@ jobs:
shell: bash -l {0}
run: |
conda activate qiita-files
pytest --doctest-modules --cov=qiita_files `if (( $(echo "${{ matrix.python-version }} > 3.6" | bc -l) )); then echo "--cov-report=lcov"; else echo ""; fi`
pytest --doctest-modules `if (( $(echo "${{ matrix.python-version }} > 3.6" | bc -l) )); then echo "--cov-report=lcov --cov=qiita_files"; else echo ""; fi`

lint:
runs-on: ubuntu-latest
Expand Down
5 changes: 4 additions & 1 deletion qiita_files/parse/fastq.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@

import numpy as np
from qiita_files.util import open_file
from itertools import zip_longest
try:
from itertools import zip_longest
except ImportError:
from itertools import izip_longest as zip_longest


def _ascii_to_phred(s, offset):
Expand Down
12 changes: 6 additions & 6 deletions qiita_files/parse/tests/test_fastq.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class ParseFastqTestsInputIsFileNames(FileData, ParseFastqTests, TestCase):
}


FASTQ_EXAMPLE = rb"""@GAPC_0015:6:1:1259:10413#0/1
FASTQ_EXAMPLE = r"""@GAPC_0015:6:1:1259:10413#0/1
AACACCAAACTTCTCCACCACGTGAGCTACAAAAG
+GAPC_0015:6:1:1259:10413#0/1
````Y^T]`]c^cabcacc`^Lb^ccYT\T\Y\WF
Expand Down Expand Up @@ -194,26 +194,26 @@ class ParseFastqTestsInputIsFileNames(FileData, ParseFastqTests, TestCase):
@GAPC_0015:6:1:1317:3403#0/1
TTGTTTCCACTTGGTTGATTTCACCCCTGAGTTTG
+GAPC_0015:6:1:1317:3403#0/1
\\\ZTYTSaLbb``\_UZ_bbcc`cc^[ac\a\Tc"""
\\\ZTYTSaLbb``\_UZ_bbcc`cc^[ac\a\Tc""".encode("utf-8")


FASTQ_EXAMPLE_2 = rb"""@GAPC_0017:6:1:1259:10413#0/1
FASTQ_EXAMPLE_2 = r"""@GAPC_0017:6:1:1259:10413#0/1
AACACCAAACTTCTCCACCACGTGAGCTACAAAAG
+GAPC_0015:6:1:1259:10413#0/1
````Y^T]`]c^cabcacc`^Lb^ccYT\T\Y\WF
@GAPC_0015:6:1:1283:11957#0/1
TATGTATATATAACATATACATATATACATACATA
+GAPC_0015:6:1:1283:11957#0/1
]KZ[PY]_[YY^```ac^\\`bT``c`\aT``bbb
"""
""".encode("utf-8")


FASTQ_EXAMPLE_3 = rb"""@GAPC_0017:6:1:1259:10413#0/1
FASTQ_EXAMPLE_3 = r"""@GAPC_0017:6:1:1259:10413#0/1
AACACCAAACTTCTCCACCACGTGAGCTACAAAAG
+GAPC_0015:6:1:1259:10413#0/1
````Y^T]`]c^cabcacc`^Lb^ccYT\T\Y\WF
@GAPC_0015:6:1:1283:11957#0/1
"""
""".encode("utf-8")


if __name__ == "__main__":
Expand Down
40 changes: 20 additions & 20 deletions qiita_files/parse/tests/test_iterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,61 +276,61 @@ def test_fastq_gen(self):
self.assertEqual(obs3, exp3)


fasta1 = rb""">1
fasta1 = r""">1
aattggcc
>2
aattaatt
"""
""".encode("utf-8")

fasta2 = rb""">3
fasta2 = r""">3
atat
"""
""".encode("utf-8")

fasta3 = rb""">4
fasta3 = r""">4
attatt
>5
ggccc
"""
""".encode("utf-8")

qual1 = rb""">1
qual1 = r""">1
1 2 3 4 5 6 7 8
>2
8 7 6 5 4 3 2 1
"""
""".encode("utf-8")

qual2 = rb""">3
qual2 = r""">3
1 2 3 4
"""
""".encode("utf-8")

qual3 = rb""">4
qual3 = r""">4
1 2 3 4 5 6
>5
1 2 3 4 5
"""
""".encode("utf-8")

qual_bad_val = rb""">3
qual_bad_val = r""">3
1 2
"""
""".encode("utf-8")

qual_bad_id = rb""">asdasd
qual_bad_id = r""">asdasd
1 2 3 4
"""
""".encode("utf-8")

fastq1 = rb"""@1
fastq1 = r"""@1
atat
+
ABCD
@2
atgc
+
BCDE
"""
""".encode("utf-8")

fastq2 = rb"""@3
fastq2 = r"""@3
taa
+
EFG
"""
""".encode("utf-8")


if __name__ == '__main__':
Expand Down
9 changes: 7 additions & 2 deletions qiita_files/tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@
# -----------------------------------------------------------------------------

import os
import sys
from unittest import TestCase, main
import tempfile

import h5py
from io import StringIO, BytesIO
if sys.version_info[0] == 2:
from StringIO import StringIO
else:
from io import StringIO
from io import BytesIO

from qiita_files.util import (open_file, _is_string_or_bytes)

Expand All @@ -25,7 +30,7 @@ class TestFilePathOpening(TestCase):
"""Tests adapted from scikit-bio's skbio.io.util tests"""
def test_is_string_or_bytes(self):
self.assertTrue(_is_string_or_bytes('foo'))
self.assertTrue(_is_string_or_bytes(u'foo'))
self.assertTrue(_is_string_or_bytes(u'foo'.encode("utf-8")))
self.assertTrue(_is_string_or_bytes(b'foo'))
self.assertFalse(_is_string_or_bytes(StringIO('bar')))
self.assertFalse(_is_string_or_bytes([1]))
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
Topic :: Software Development :: Libraries :: Application Frameworks
Topic :: Software Development :: Libraries :: Python Modules
Programming Language :: Python
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.9
Expand Down
Loading