From 7353a3615ae3669318d9269a6e804f6fb3a8d3d0 Mon Sep 17 00:00:00 2001 From: Joko Triono Date: Fri, 18 Oct 2024 02:13:25 +0700 Subject: [PATCH] Add spec for deduplicate query identifier --- spec/features/search_and_results_spec.rb | 14 ++++++++++++++ spec/sequences/duplicated_query.fa | 22 ++++++++++++++++++++++ spec/sequences/sequenceserver-1_hit.fa | 11 +++++++++++ 3 files changed, 47 insertions(+) create mode 100644 spec/sequences/duplicated_query.fa create mode 100644 spec/sequences/sequenceserver-1_hit.fa diff --git a/spec/features/search_and_results_spec.rb b/spec/features/search_and_results_spec.rb index 7110c4995..992ca412a 100644 --- a/spec/features/search_and_results_spec.rb +++ b/spec/features/search_and_results_spec.rb @@ -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 @@ -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. diff --git a/spec/sequences/duplicated_query.fa b/spec/sequences/duplicated_query.fa new file mode 100644 index 000000000..e294e8030 --- /dev/null +++ b/spec/sequences/duplicated_query.fa @@ -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 diff --git a/spec/sequences/sequenceserver-1_hit.fa b/spec/sequences/sequenceserver-1_hit.fa new file mode 100644 index 000000000..74fd0a503 --- /dev/null +++ b/spec/sequences/sequenceserver-1_hit.fa @@ -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