-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create BLAST tabular adapter (#4627)
- Loading branch information
1 parent
17d7415
commit c5554a8
Showing
11 changed files
with
547 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
plugins/comparative-adapters/src/BlastTabularAdapter/BlastTabularAdapter.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') | ||
}) |
Oops, something went wrong.