fhcrc / seqmagick

An imagemagick-like frontend to Biopython SeqIO
http://seqmagick.readthedocs.org
GNU General Public License v3.0
113 stars 22 forks source link

issue with Biopython 1.67 #59

Closed bowmanjeffs closed 6 years ago

bowmanjeffs commented 8 years ago

It looks like seqmagick has an issue with Biopython 1.67 (1.66 works fine). I get the following error with seqmagick quality-filter:

seqmagick quality-filter summer.fastq summer.fasta --min-mean-quality 30 --min-length 100 --max-ambiguous 0 Traceback (most recent call last): File "/home/jeff/anaconda/bin/seqmagick", line 11, in load_entry_point('seqmagick==0.6.1', 'console_scripts', 'seqmagick')() File "/home/jeff/anaconda/lib/python2.7/site-packages/seqmagick-0.6.1-py2.7.egg/seqmagick/scripts/cli.py", line 29, in main return action(arguments) File "/home/jeff/anaconda/lib/python2.7/site-packages/seqmagick-0.6.1-py2.7.egg/seqmagick/subcommands/quality_filter.py", line 657, in action SeqIO.write(sequences, arguments.output_file, output_type) File "/home/jeff/anaconda/lib/python2.7/site-packages/Bio/SeqIO/init.py", line 478, in write count = writer_class(fp).write_file(sequences) File "/home/jeff/anaconda/lib/python2.7/site-packages/Bio/SeqIO/Interfaces.py", line 209, in write_file count = self.write_records(records) File "/home/jeff/anaconda/lib/python2.7/site-packages/Bio/SeqIO/Interfaces.py", line 193, in write_records for record in records: File "/home/jeff/anaconda/lib/python2.7/site-packages/seqmagick-0.6.1-py2.7.egg/seqmagick/subcommands/quality_filter.py", line 194, in iterable_hook for record in iterable: File "/home/jeff/anaconda/lib/python2.7/site-packages/seqmagick-0.6.1-py2.7.egg/seqmagick/subcommands/quality_filter.py", line 301, in filter_records for record in records: File "/home/jeff/anaconda/lib/python2.7/site-packages/seqmagick-0.6.1-py2.7.egg/seqmagick/subcommands/quality_filter.py", line 301, in filter_records for record in records: File "/home/jeff/anaconda/lib/python2.7/site-packages/seqmagick-0.6.1-py2.7.egg/seqmagick/subcommands/quality_filter.py", line 301, in filter_records for record in records: File "/home/jeff/anaconda/lib/python2.7/site-packages/seqmagick-0.6.1-py2.7.egg/seqmagick/subcommands/quality_filter.py", line 306, in filter_records if filtered == record: File "/home/jeff/anaconda/lib/python2.7/site-packages/Bio/SeqRecord.py", line 720, in eq raise NotImplementedError(_NO_SEQRECORD_COMPARISON) NotImplementedError: SeqRecord comparison is deliberately not implemented. Explicitly compare the attributes of interest.

wwood commented 8 years ago

I note also that the test suite is complaining of an issue similar to this, as well as perhaps some others. I'm using biopython-1.68 here. The test suite was working with 1.66. Thanks.

.................................EE..FF.......................................E.E..EEEEEEE.EE.E...............................................E...............
======================================================================
ERROR: Should fail if reverse primer occurs before forward primer
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/test/test_primer_trim.py", line 114, in test_bad_order
    forward, reverse, False, 1)
  File "/gnu/store/vcx1n5nj4gr52xx5m6gvi7zrwngy06s3-python-2.7.11/lib/python2.7/unittest/case.py", line 473, in assertRaises
    callableObj(*args, **kwargs)
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/subcommands/primer_trim.py", line 245, in locate_primers
    raise PrimerNotFound(forward_primer)
PrimerNotFound: TTC
-------------------- >> begin captured logging << --------------------
root: INFO: Reverse in sequence 1: indexes 7 to 9
root: DEBUG: Sequence 1: 1/2 primers found
--------------------- >> end captured logging << ---------------------

======================================================================
ERROR: test_basic (seqmagick.test.test_primer_trim.LocatePrimersTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/test/test_primer_trim.py", line 86, in test_basic
    forward, reverse, False, 1)
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/subcommands/primer_trim.py", line 247, in locate_primers
    raise PrimerNotFound(reverse_primer)
PrimerNotFound: TTC
-------------------- >> begin captured logging << --------------------
root: INFO: Forward in sequence 1: indexes 7 to 9
root: DEBUG: Sequence 1: 1/2 primers found
--------------------- >> end captured logging << ---------------------

======================================================================
ERROR: Test that the first record (with no Ns) does not get filtered
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/test/test_subcommands_quality_filter.py", line 69, in test_drop
    actual = list(instance.filter_records(self.records))
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/subcommands/quality_filter.py", line 303, in filter_records
    if filtered == record:
  File "/gnu/store/cpc68z4fvc49mm429zcd8r40vg2i2w8y-python2-biopython-1.68/lib/python2.7/site-packages/Bio/SeqRecord.py", line 736, in __eq__
    raise NotImplementedError(_NO_SEQRECORD_COMPARISON)
NotImplementedError: SeqRecord comparison is deliberately not implemented. Explicitly compare the attributes of interest.

======================================================================
ERROR: test_truncate (seqmagick.test.test_subcommands_quality_filter.AmbiguousBaseFilterTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/test/test_subcommands_quality_filter.py", line 77, in test_truncate
    actual = list(instance.filter_records(self.records))
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/subcommands/quality_filter.py", line 303, in filter_records
    if filtered == record:
  File "/gnu/store/cpc68z4fvc49mm429zcd8r40vg2i2w8y-python2-biopython-1.68/lib/python2.7/site-packages/Bio/SeqRecord.py", line 736, in __eq__
    raise NotImplementedError(_NO_SEQRECORD_COMPARISON)
NotImplementedError: SeqRecord comparison is deliberately not implemented. Explicitly compare the attributes of interest.

======================================================================
ERROR: test_1 (seqmagick.test.test_subcommands_quality_filter.MaxAmbiguousFilterTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/test/test_subcommands_quality_filter.py", line 112, in test_1
    filtered = list(instance.filter_records(self.records))
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/subcommands/quality_filter.py", line 303, in filter_records
    if filtered == record:
  File "/gnu/store/cpc68z4fvc49mm429zcd8r40vg2i2w8y-python2-biopython-1.68/lib/python2.7/site-packages/Bio/SeqRecord.py", line 736, in __eq__
    raise NotImplementedError(_NO_SEQRECORD_COMPARISON)
NotImplementedError: SeqRecord comparison is deliberately not implemented. Explicitly compare the attributes of interest.

======================================================================
ERROR: test_10 (seqmagick.test.test_subcommands_quality_filter.MaxAmbiguousFilterTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/test/test_subcommands_quality_filter.py", line 107, in test_10
    filtered = list(instance.filter_records(self.records))
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/subcommands/quality_filter.py", line 303, in filter_records
    if filtered == record:
  File "/gnu/store/cpc68z4fvc49mm429zcd8r40vg2i2w8y-python2-biopython-1.68/lib/python2.7/site-packages/Bio/SeqRecord.py", line 736, in __eq__
    raise NotImplementedError(_NO_SEQRECORD_COMPARISON)
NotImplementedError: SeqRecord comparison is deliberately not implemented. Explicitly compare the attributes of interest.

======================================================================
ERROR: test_none (seqmagick.test.test_subcommands_quality_filter.MaxAmbiguousFilterTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/test/test_subcommands_quality_filter.py", line 101, in test_none
    filtered = list(instance.filter_records(self.records))
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/subcommands/quality_filter.py", line 303, in filter_records
    if filtered == record:
  File "/gnu/store/cpc68z4fvc49mm429zcd8r40vg2i2w8y-python2-biopython-1.68/lib/python2.7/site-packages/Bio/SeqRecord.py", line 736, in __eq__
    raise NotImplementedError(_NO_SEQRECORD_COMPARISON)
NotImplementedError: SeqRecord comparison is deliberately not implemented. Explicitly compare the attributes of interest.

======================================================================
ERROR: test_all_truncated (seqmagick.test.test_subcommands_quality_filter.MaxLengthFilterTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/test/test_subcommands_quality_filter.py", line 154, in test_all_truncated
    actual = list(instance.filter_records(self.sequences))
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/subcommands/quality_filter.py", line 303, in filter_records
    if filtered == record:
  File "/gnu/store/cpc68z4fvc49mm429zcd8r40vg2i2w8y-python2-biopython-1.68/lib/python2.7/site-packages/Bio/SeqRecord.py", line 736, in __eq__
    raise NotImplementedError(_NO_SEQRECORD_COMPARISON)
NotImplementedError: SeqRecord comparison is deliberately not implemented. Explicitly compare the attributes of interest.

======================================================================
ERROR: test_none_truncated (seqmagick.test.test_subcommands_quality_filter.MaxLengthFilterTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/test/test_subcommands_quality_filter.py", line 144, in test_none_truncated
    actual = list(instance.filter_records(self.sequences))
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/subcommands/quality_filter.py", line 303, in filter_records
    if filtered == record:
  File "/gnu/store/cpc68z4fvc49mm429zcd8r40vg2i2w8y-python2-biopython-1.68/lib/python2.7/site-packages/Bio/SeqRecord.py", line 736, in __eq__
    raise NotImplementedError(_NO_SEQRECORD_COMPARISON)
NotImplementedError: SeqRecord comparison is deliberately not implemented. Explicitly compare the attributes of interest.

======================================================================
ERROR: test_some_truncated (seqmagick.test.test_subcommands_quality_filter.MaxLengthFilterTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/test/test_subcommands_quality_filter.py", line 149, in test_some_truncated
    actual = list(instance.filter_records(self.sequences))
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/subcommands/quality_filter.py", line 303, in filter_records
    if filtered == record:
  File "/gnu/store/cpc68z4fvc49mm429zcd8r40vg2i2w8y-python2-biopython-1.68/lib/python2.7/site-packages/Bio/SeqRecord.py", line 736, in __eq__
    raise NotImplementedError(_NO_SEQRECORD_COMPARISON)
NotImplementedError: SeqRecord comparison is deliberately not implemented. Explicitly compare the attributes of interest.

======================================================================
ERROR: test_all_pass (seqmagick.test.test_subcommands_quality_filter.MinLengthFilterTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/test/test_subcommands_quality_filter.py", line 129, in test_all_pass
    actual = list(instance.filter_records(self.sequences))
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/subcommands/quality_filter.py", line 303, in filter_records
    if filtered == record:
  File "/gnu/store/cpc68z4fvc49mm429zcd8r40vg2i2w8y-python2-biopython-1.68/lib/python2.7/site-packages/Bio/SeqRecord.py", line 736, in __eq__
    raise NotImplementedError(_NO_SEQRECORD_COMPARISON)
NotImplementedError: SeqRecord comparison is deliberately not implemented. Explicitly compare the attributes of interest.

======================================================================
ERROR: test_some_pass (seqmagick.test.test_subcommands_quality_filter.MinLengthFilterTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/test/test_subcommands_quality_filter.py", line 134, in test_some_pass
    actual = list(instance.filter_records(self.sequences))
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/subcommands/quality_filter.py", line 303, in filter_records
    if filtered == record:
  File "/gnu/store/cpc68z4fvc49mm429zcd8r40vg2i2w8y-python2-biopython-1.68/lib/python2.7/site-packages/Bio/SeqRecord.py", line 736, in __eq__
    raise NotImplementedError(_NO_SEQRECORD_COMPARISON)
NotImplementedError: SeqRecord comparison is deliberately not implemented. Explicitly compare the attributes of interest.

======================================================================
ERROR: test_filter_trim (seqmagick.test.test_subcommands_quality_filter.PrimerBarcodeFilterTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/test/test_subcommands_quality_filter.py", line 174, in test_filter_trim
    actual = list(self.instance.filter_records(self.sequences))
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/subcommands/quality_filter.py", line 303, in filter_records
    if filtered == record:
  File "/gnu/store/cpc68z4fvc49mm429zcd8r40vg2i2w8y-python2-biopython-1.68/lib/python2.7/site-packages/Bio/SeqRecord.py", line 736, in __eq__
    raise NotImplementedError(_NO_SEQRECORD_COMPARISON)
NotImplementedError: SeqRecord comparison is deliberately not implemented. Explicitly compare the attributes of interest.
-------------------- >> begin captured logging << --------------------
root: INFO: ACCGTTA->Sample1
root: INFO: ACTGTTA->Sample2
--------------------- >> end captured logging << ---------------------

======================================================================
ERROR: test_nowindow_pass (seqmagick.test.test_subcommands_quality_filter.QualityFilterTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/test/test_subcommands_quality_filter.py", line 29, in test_nowindow_pass
    self.assertEqual(self.sequence, result)
  File "/gnu/store/vcx1n5nj4gr52xx5m6gvi7zrwngy06s3-python-2.7.11/lib/python2.7/unittest/case.py", line 513, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/gnu/store/vcx1n5nj4gr52xx5m6gvi7zrwngy06s3-python-2.7.11/lib/python2.7/unittest/case.py", line 503, in _baseAssertEqual
    if not first == second:
  File "/gnu/store/cpc68z4fvc49mm429zcd8r40vg2i2w8y-python2-biopython-1.68/lib/python2.7/site-packages/Bio/SeqRecord.py", line 736, in __eq__
    raise NotImplementedError(_NO_SEQRECORD_COMPARISON)
NotImplementedError: SeqRecord comparison is deliberately not implemented. Explicitly compare the attributes of interest.

======================================================================
ERROR: test_exclude (seqmagick.test.test_transform.SeqPatternTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/test/test_transform.py", line 223, in test_exclude
    expected = [i for i in self.sequences if i not in expected_include]
  File "/gnu/store/cpc68z4fvc49mm429zcd8r40vg2i2w8y-python2-biopython-1.68/lib/python2.7/site-packages/Bio/SeqRecord.py", line 736, in __eq__
    raise NotImplementedError(_NO_SEQRECORD_COMPARISON)
NotImplementedError: SeqRecord comparison is deliberately not implemented. Explicitly compare the attributes of interest.

======================================================================
FAIL: test_align_exact (seqmagick.test.test_primer_trim.PrimerAlignerTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/test/test_primer_trim.py", line 26, in test_align_exact
    self.assertEqual(0, hamming_distance)
AssertionError: 0 != 33

======================================================================
FAIL: test_align_gap (seqmagick.test.test_primer_trim.PrimerAlignerTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/guix-build-seqmagick-0.6.1.drv-0/seqmagick-0.6.1/seqmagick/test/test_primer_trim.py", line 35, in test_align_gap
    self.assertEqual(expected_distance, hamming_distance)
AssertionError: 1 != 34

----------------------------------------------------------------------
Ran 158 tests in 1.950s

FAILED (errors=15, failures=2)
nhoffman commented 6 years ago

Addressed in version 0.6.2 (forces biopython <= 1.66). The next release will require 1.70+