def test_difference_when_diffs_i_vs_h(self): irods_metadata = IrodsSeqFileMetadata('/seq/123.bam', samples={ 'name': set(['S1']), 'accession_number': set(['EGA1']), 'internal_id': set(['1']) }, libraries={ 'name': set(['123']), 'internal_id': set(['123']) }, studies={ 'name': set(["Crohns disease"]), 'accession_number': set(['EGAS4']), 'internal_id': set(['4']) }) header_metadata = SAMFileHeaderMetadata( '/seq/123.bam', samples={ 'name': set(['S100']), 'accession_number': set(), 'internal_id': set() }, libraries={'internal_id': set(['123'])}, studies={}) result = irods_metadata.difference(header_metadata) self.assertDictEqual(result, {'samples': {'name': set(['S1'])}})
def test_difference_when_no_diffs_i_vs_h(self): irods_metadata = IrodsSeqFileMetadata('/seq/123.bam', samples={'name': set(['S1']), 'accession_number': set(), 'internal_id': set()}, libraries={}, studies={}) header_metadata = SAMFileHeaderMetadata('/seq/123.bam', samples={'name': set(['S1']), 'accession_number' : set(), 'internal_id': set()}, libraries={}, studies={}) result = irods_metadata.difference(header_metadata) self.assertDictEqual(result, {})
def test_difference_when_diffs_i_vs_h(self): irods_metadata = IrodsSeqFileMetadata('/seq/123.bam', samples={'name': set(['S1']), 'accession_number': set(['EGA1']), 'internal_id': set(['1'])}, libraries={'name': set(['123']), 'internal_id': set(['123'])}, studies={'name': set(["Crohns disease"]), 'accession_number': set(['EGAS4']), 'internal_id': set(['4'])}) header_metadata = SAMFileHeaderMetadata('/seq/123.bam', samples={'name': set(['S100']), 'accession_number' : set(), 'internal_id': set()}, libraries={'internal_id': set(['123'])}, studies={}) result = irods_metadata.difference(header_metadata) self.assertDictEqual(result, {'samples': {'name': set(['S1'])}})
def test_difference_when_no_diffs_i_vs_h(self): irods_metadata = IrodsSeqFileMetadata('/seq/123.bam', samples={ 'name': set(['S1']), 'accession_number': set(), 'internal_id': set() }, libraries={}, studies={}) header_metadata = SAMFileHeaderMetadata('/seq/123.bam', samples={ 'name': set(['S1']), 'accession_number': set(), 'internal_id': set() }, libraries={}, studies={}) result = irods_metadata.difference(header_metadata) self.assertDictEqual(result, {})