Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into refactor-configs-f…
Browse files Browse the repository at this point in the history
…or-mq-vol-tracking
  • Loading branch information
dasunpubudumal committed Oct 22, 2024
2 parents 05e57d1 + ae7f96c commit b8dfddc
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 21 deletions.
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ GEM
sanitize (< 7)
globalid (1.2.1)
activesupport (>= 6.1)
hashdiff (1.1.0)
hashdiff (1.1.1)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
io-console (0.7.2)
Expand Down Expand Up @@ -186,7 +186,7 @@ GEM
pry (>= 0.13.0)
psych (5.1.2)
stringio
public_suffix (6.0.0)
public_suffix (6.0.1)
puma (6.4.3)
nio4r (~> 2.0)
racc (1.8.1)
Expand Down Expand Up @@ -247,7 +247,7 @@ GEM
regexp_parser (2.9.2)
reline (0.5.10)
io-console (~> 0.5)
rexml (3.3.7)
rexml (3.3.8)
rspec-core (3.13.1)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.3)
Expand Down Expand Up @@ -284,7 +284,7 @@ GEM
rack (>= 1.1)
rubocop (>= 1.52.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rspec (3.0.5)
rubocop-rspec (3.1.0)
rubocop (~> 1.61)
ruby-graphviz (1.2.5)
rexml
Expand Down Expand Up @@ -317,7 +317,7 @@ GEM
concurrent-ruby (~> 1.0)
unicode-display_width (2.6.0)
useragent (0.16.10)
webmock (3.23.1)
webmock (3.24.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
Expand Down
22 changes: 12 additions & 10 deletions lib/tasks/create_enzymes.rake
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@

namespace :enzymes do
task create: :environment do
Saphyr::Enzyme.create!(
[
{ name: 'Nb.BbvCI' },
{ name: 'Nb.BsmI' },
{ name: 'Nb.BsrDI' },
{ name: 'Nt.BspQI' },
{ name: 'Nb.BssSI' },
{ name: 'DLE-1' }
]
)
enzymes = [
{ name: 'Nb.BbvCI' },
{ name: 'Nb.BsmI' },
{ name: 'Nb.BsrDI' },
{ name: 'Nt.BspQI' },
{ name: 'Nb.BssSI' },
{ name: 'DLE-1' }
]

enzymes.each do |enzyme|
Saphyr::Enzyme.find_or_create_by!(enzyme)
end
puts '-> Enzymes succesfully created'
end

Expand Down
37 changes: 37 additions & 0 deletions lib/tasks/create_tags.rake
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ namespace :tags do
task ont_all: :environment do
Rake::Task['tags:create:SQK-NBD114.96'].invoke
Rake::Task['tags:create:SQK-RBK114.96'].invoke
Rake::Task['tags:create:SQK-PCB114.24'].invoke
end

desc 'Create pacbio sequel tags'
Expand Down Expand Up @@ -786,6 +787,42 @@ namespace :tags do
end
puts '-> SQK-RBK114.96 tags successfully created'
end

task 'SQK-PCB114.24': :environment do
puts '-> Creating SQK-PCB114.24 tag set and tags'
set = TagSet.ont_pipeline
.find_or_create_by!(name: 'SQK-PCB114.24')
puts '-> Tag Set successfully created'
[
{ group_id: 'BP01', oligo: 'AAGAAAGTTGTCGGTGTCTTTGTG' },
{ group_id: 'BP02', oligo: 'TCGATTCCGTTTGTAGTCGTCTGT' },
{ group_id: 'BP03', oligo: 'GAGTCTTGTGTCCCAGTTACCAGG' },
{ group_id: 'BP04', oligo: 'TTCGGATTCTATCGTGTTTCCCTA' },
{ group_id: 'BP05', oligo: 'CTTGTCCAGGGTTTGTGTAACCTT' },
{ group_id: 'BP06', oligo: 'TTCTCGCAAAGGCAGAAAGTAGTC' },
{ group_id: 'BP07', oligo: 'GTGTTACCGTGGGAATGAATCCTT' },
{ group_id: 'BP08', oligo: 'TTCAGGGAACAAACCAAGTTACGT' },
{ group_id: 'BP09', oligo: 'AACTAGGCACAGCGAGTCTTGGTT' },
{ group_id: 'BP10', oligo: 'AAGCGTTGAAACCTTTGTCCTCTC' },
{ group_id: 'BP11', oligo: 'GTTTCATCTATCGGAGGGAATGGA' },
{ group_id: 'BP12', oligo: 'CAGGTAGAAAGAAGCAGAATCGGA' },
{ group_id: 'BP13', oligo: 'AGAACGACTTCCATACTCGTGTGA' },
{ group_id: 'BP14', oligo: 'AACGAGTCTCTTGGGACCCATAGA' },
{ group_id: 'BP15', oligo: 'AGGTCTACCTCGCTAACACCACTG' },
{ group_id: 'BP16', oligo: 'CGTCAACTGACAGTGGTTCGTACT' },
{ group_id: 'BP17', oligo: 'ACCCTCCAGGAAAGTACCTCTGAT' },
{ group_id: 'BP18', oligo: 'CCAAACCCAACAACCTAGATAGGC' },
{ group_id: 'BP19', oligo: 'GTTCCTCGTGCAGTGTCAAGAGAT' },
{ group_id: 'BP20', oligo: 'TTGCGTCCTGTTACGAGAACTCAT' },
{ group_id: 'BP21', oligo: 'GAGCCTCTCATTGTCCGTTCTCTA' },
{ group_id: 'BP22', oligo: 'ACCACTGCCATGTATCAAAGTACG' },
{ group_id: 'BP23', oligo: 'CTTACTACCCAGTGAACCTCCTCG' },
{ group_id: 'BP24', oligo: 'GCATAGTTCTGCATGATGGGTTAG' }
].each do |tag_attributes|
set.tags.find_or_create_by!(tag_attributes)
end
puts '-> SQK-PCB114.24 tags successfully created'
end
end

task destroy: :environment do
Expand Down
17 changes: 13 additions & 4 deletions lib/tasks/saphyr_runs.rake
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,19 @@ namespace :saphyr_runs do
{ sample: { name: "SaphyrSample#{i}", external_id: SecureRandom.uuid, species: "Species#{i}" }, request: { external_study_id: } }
end

factory = Saphyr::RequestFactory.new(attributes)
factory.save

# binding.pry
Sample.transaction do
attributes.each do |attr|
sample = Sample.create!(attr[:sample])
req = Saphyr.request_factory(
sample:,
container: nil,
request_attributes: attr[:request],
resource_factory: nil,
reception: nil
)
req.save!
end
end

Saphyr::Request.find_each do |request|
library = Saphyr::Library.create!(request:, saphyr_enzyme_id: 1)
Expand Down
10 changes: 8 additions & 2 deletions spec/lib/tasks/create_tags.rake_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@
-> Creating SQK-RBK114.96 tag set and tags
-> Tag Set successfully created
-> SQK-RBK114.96 tags successfully created
-> Creating SQK-PCB114.24 tag set and tags
-> Tag Set successfully created
-> SQK-PCB114.24 tags successfully created
HEREDOC
).to_stdout
expect(TagSet.count).to eq(2)
expect(TagSet.count).to eq(3)
end

it 'creates all of the tag sets' do
Expand Down Expand Up @@ -95,9 +98,12 @@
-> Creating SQK-RBK114.96 tag set and tags
-> Tag Set successfully created
-> SQK-RBK114.96 tags successfully created
-> Creating SQK-PCB114.24 tag set and tags
-> Tag Set successfully created
-> SQK-PCB114.24 tags successfully created
HEREDOC
).to_stdout
expect(TagSet.count).to eq(11)
expect(TagSet.count).to eq(12)
end
end
end
3 changes: 3 additions & 0 deletions spec/lib/tasks/ont_data.rake_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
"-> Creating SQK-RBK114.96 tag set and tags\n" \
"-> Tag Set successfully created\n" \
"-> SQK-RBK114.96 tags successfully created\n" \
"-> Creating SQK-PCB114.24 tag set and tags\n" \
"-> Tag Set successfully created\n" \
"-> SQK-PCB114.24 tags successfully created\n" \
"-> Created #{expected_single_plexed_pools} single plexed pools\n" \
"-> Created #{expected_multi_plexed_pools} multiplexed pools\n" \
"-> ONT Instruments successfully created\n" \
Expand Down

0 comments on commit b8dfddc

Please sign in to comment.