Skip to content

Commit

Permalink
Create BLAST tabular adapter (#4627)
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettjstevens authored Nov 8, 2024
1 parent 17d7415 commit c5554a8
Show file tree
Hide file tree
Showing 11 changed files with 547 additions and 6 deletions.
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default tseslint.config(
markers: ['/'],
},
],

'one-var': ['error', 'never'],
'react-refresh/only-export-components': 'warn',
'react/no-unescaped-entities': 'off',
'react/no-is-mounted': 'off',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { toArray } from 'rxjs/operators'
import { firstValueFrom } from 'rxjs'
import Adapter from './BlastTabularAdapter'
import MyConfigSchema from './configSchema'

test('adapter can fetch features from peach_grape.paf', async () => {
const adapter = new Adapter(
MyConfigSchema.create({
blastTableLocation: {
localPath: require.resolve('./test_data/peach_vs_grape.tsv.gz'),
locationType: 'LocalPathLocation',
},
assemblyNames: ['peach', 'grape'],
}),
)

const features1 = adapter.getFeatures({
refName: 'Pp05',
start: 0,
end: 200000,
assemblyName: 'peach',
})

const features2 = adapter.getFeatures({
refName: 'chr18',
start: 0,
end: 200000,
assemblyName: 'grape',
})

const fa1 = await firstValueFrom(features1.pipe(toArray()))
const fa2 = await firstValueFrom(features2.pipe(toArray()))
expect(fa1.length).toBe(204)
expect(fa2.length).toBe(263)
expect(fa1[0]!.get('refName')).toBe('Pp05')
expect(fa2[0]!.get('refName')).toBe('chr18')
})
Loading

0 comments on commit c5554a8

Please sign in to comment.