Skip to content

Commit

Permalink
Add spec for deduplicate query identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
joko3ono authored and tadast committed Oct 17, 2024
1 parent be089f9 commit 7353a36
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spec/features/search_and_results_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ def nucleotide_query
File.read File.join(__dir__, '..', 'sequences', 'protein_query.fa')
end

let(:duplicated_query) do
File.read File.join(__dir__, '..', 'sequences', 'duplicated_query.fa')
end

let(:funkyid_query) do
'GATGAACGCTGGCGGCGTGCCTAATACATGCAAGTCGAG'
end
Expand Down Expand Up @@ -193,6 +197,16 @@ def nucleotide_query
expect(File.read(downloaded_file)).to eq(File.read('spec/sequences/funky_ids_download.fa'))
end

it 'on download deduplicates by identifiers' do
perform_search(query: duplicated_query, databases: nucleotide_databases.values_at(1))

page.click_link('FASTA of all hits')
wait_for_download

expect(File.basename(downloaded_file)).to eq('sequenceserver-SI2.2.0_13722.fa')
expect(File.read(downloaded_file)).to eq(File.read('spec/sequences/sequenceserver-1_hit.fa'))
end

it 'can download alignment for each hit' do
# Do a BLASTP search. protein_query refers to the first two sequence in
# protein_databases[0], so the top hits are the query sequences themselves.
Expand Down
22 changes: 22 additions & 0 deletions spec/sequences/duplicated_query.fa
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
>SI2.2.0_13722 Si_gnF.scaffold06207[1925625..1928536].pep_1
ATGTCCGCGAATCGATTGAACGTGCTGGTGACCCTGATGCTCGCCGTCGCGCTTCTTGTG
ACGGAATCAGGAAATGCACAGGTGGATGGCTATCTCCAATTCAACCCAAAGCGATCCGCC
GTGAGCTCGCCGCAGAAGTATTGCGGCAAAAAGCTTTCTAATGCTCTACAGATAATCTGT
GATGGCGTGTACAATTCCATGTTTAAGAAGAGTGGTCAAGATTTTCCCCCGCAAAATAAG
AGACACATAGCACACAGAATAAATGGGAATGAGGAAGAGAGCTTTACTACGTTAAAGTCG
AATTTTTTAAACTGGTGTGTTGAAGTTTATCATCGTCACTACAGATTCGTTTTTGTTTCA
GAGATGGAAATGGCCGATTACCCGCTCGCCTATGATATTTCCCCGTATCTTCCGCCGTTC
CTGTCGCGAGCGAGGGCACGGGGAATGTTAGACGGTCGCTTCGCCGGCAGACGCTACCGA
AGGGAGTCGCGGGGCATTCACGAGGAGTGTTGCATCAACGGATGTACGATAAACGAATTG
ACCAGCTACTGCGGCCCC
>SI2.2.0_13722 Si_gnF.scaffold06207[1925625..1928536].pep_1
ATGTCCGCGAATCGATTGAACGTGCTGGTGACCCTGATGCTCGCCGTCGCGCTTCTTGTG
ACGGAATCAGGAAATGCACAGGTGGATGGCTATCTCCAATTCAACCCAAAGCGATCCGCC
GTGAGCTCGCCGCAGAAGTATTGCGGCAAAAAGCTTTCTAATGCTCTACAGATAATCTGT
GATGGCGTGTACAATTCCATGTTTAAGAAGAGTGGTCAAGATTTTCCCCCGCAAAATAAG
AGACACATAGCACACAGAATAAATGGGAATGAGGAAGAGAGCTTTACTACGTTAAAGTCG
AATTTTTTAAACTGGTGTGTTGAAGTTTATCATCGTCACTACAGATTCGTTTTTGTTTCA
GAGATGGAAATGGCCGATTACCCGCTCGCCTATGATATTTCCCCGTATCTTCCGCCGTTC
CTGTCGCGAGCGAGGGCACGGGGAATGTTAGACGGTCGCTTCGCCGGCAGACGCTACCGA
AGGGAGTCGCGGGGCATTCACGAGGAGTGTTGCATCAACGGATGTACGATAAACGAATTG
ACCAGCTACTGCGGCCCC
11 changes: 11 additions & 0 deletions spec/sequences/sequenceserver-1_hit.fa
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
>SI2.2.0_13722 Si_gnF.scaffold06207[1925625..1928536].pep_1
ATGTCCGCGAATCGATTGAACGTGCTGGTGACCCTGATGCTCGCCGTCGCGCTTCTTGTG
ACGGAATCAGGAAATGCACAGGTGGATGGCTATCTCCAATTCAACCCAAAGCGATCCGCC
GTGAGCTCGCCGCAGAAGTATTGCGGCAAAAAGCTTTCTAATGCTCTACAGATAATCTGT
GATGGCGTGTACAATTCCATGTTTAAGAAGAGTGGTCAAGATTTTCCCCCGCAAAATAAG
AGACACATAGCACACAGAATAAATGGGAATGAGGAAGAGAGCTTTACTACGTTAAAGTCG
AATTTTTTAAACTGGTGTGTTGAAGTTTATCATCGTCACTACAGATTCGTTTTTGTTTCA
GAGATGGAAATGGCCGATTACCCGCTCGCCTATGATATTTCCCCGTATCTTCCGCCGTTC
CTGTCGCGAGCGAGGGCACGGGGAATGTTAGACGGTCGCTTCGCCGGCAGACGCTACCGA
AGGGAGTCGCGGGGCATTCACGAGGAGTGTTGCATCAACGGATGTACGATAAACGAATTG
ACCAGCTACTGCGGCCCC

0 comments on commit 7353a36

Please # to comment.