Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Barcodes to Existing Kits #590

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
719a8f2
init create barcodes for existing kits
ayobi Mar 8, 2024
5846301
indent issues
ayobi Mar 8, 2024
16f2721
added validate admin access
ayobi Mar 18, 2024
846f978
update insert barcode test
ayobi Mar 18, 2024
f9db8b4
test
ayobi Mar 18, 2024
5d458d1
added user barcode field for create kits
ayobi Mar 25, 2024
ba0e51e
remove admin validate for generate barcodes
ayobi Mar 26, 2024
c8fef4b
added admin validate
ayobi Mar 26, 2024
3207886
lint
ayobi Mar 26, 2024
4fdc890
remove admin validate
ayobi Mar 26, 2024
1ceb9b9
add admin val again
ayobi Mar 26, 2024
43dc44f
test admin validate
ayobi Mar 26, 2024
87b1188
Merge branch 'biocore:master' into creates_barcodes_for_existing_kits
ayobi May 2, 2024
261d466
added admin validate
ayobi May 2, 2024
b8466d3
improvements per suggestions
ayobi Jun 21, 2024
190b99f
update tests
ayobi Jun 21, 2024
461b98d
test
ayobi Jun 22, 2024
0cef118
testv2
ayobi Jun 22, 2024
1f9ac09
testv3
ayobi Jun 22, 2024
686b335
testv4
ayobi Jun 22, 2024
d1f52a5
fixed test, flake
ayobi Jun 22, 2024
82493c3
Merge branch 'master' of https://github.com/biocore/microsetta-privat…
ayobi Jul 30, 2024
f5cfdd2
changes per suggestions
ayobi Aug 6, 2024
783abec
lint
ayobi Aug 6, 2024
224e5fe
removed debug statements
ayobi Aug 6, 2024
eacb78c
remove generate_barcodes
ayobi Aug 8, 2024
8dcf268
fixes and improvements
ayobi Aug 15, 2024
4c256bf
fixes
ayobi Aug 20, 2024
7dbe160
fix create kits for sample slots
ayobi Aug 23, 2024
373a24e
remove arg for create_kits
ayobi Aug 23, 2024
07fb798
changes based on latest feedback
ayobi Aug 30, 2024
0d3764a
missed 2 comments
ayobi Aug 30, 2024
47986b3
Merge branch 'biocore:master' into creates_barcodes_for_existing_kits
ayobi Oct 2, 2024
4a52bdc
Merge pull request #586 from ayobi/creates_barcodes_for_existing_kits
cassidysymons Oct 15, 2024
46346b3
Add barcodes to kits
cassidysymons Dec 16, 2024
34523d1
Merge branch 'master' into csymons_add_barcodes
cassidysymons Dec 16, 2024
c30b63f
Lint
cassidysymons Dec 16, 2024
4331479
Adjustments based on feedback
cassidysymons Jan 3, 2025
0e4a008
Merge pull request #592 from biocore/master
cassidysymons Jan 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update tests
ayobi committed Jun 21, 2024
commit 190b99f522fc759df47483bfa6871bed970fc50f
12 changes: 6 additions & 6 deletions microsetta_private_api/admin/tests/test_admin_repo.py
Original file line number Diff line number Diff line change
@@ -1392,8 +1392,8 @@ def test_generate_novel_barcodes_admin_success(self):

with Transaction() as t:
admin_repo = AdminRepo(t)
new_barcodes = admin_repo._generate_novel_barcodes_admin(
number_of_kits, number_of_samples)
new_barcodes = admin_repo._generate_novel_barcodes(
number_of_kits, number_of_samples, kit_names=None)
self.assertEqual(len(new_barcodes),
number_of_kits * number_of_samples)
self.assertTrue(all(barcode.startswith('X')
@@ -1405,8 +1405,8 @@ def test_generate_novel_barcodes_admin_failure(self):

with Transaction() as t:
admin_repo = AdminRepo(t)
new_barcodes = admin_repo._generate_novel_barcodes_admin(
number_of_kits, number_of_samples)
new_barcodes = admin_repo._generate_novel_barcodes(
number_of_kits, number_of_samples, kit_names=None)
self.assertTrue(new_barcodes == [])

def test_insert_barcodes_admin_success(self):
@@ -1415,8 +1415,8 @@ def test_insert_barcodes_admin_success(self):

with Transaction() as t:
admin_repo = AdminRepo(t)
new_barcode = admin_repo._generate_novel_barcodes_admin(
number_of_kits, number_of_samples)
new_barcode = admin_repo._generate_novel_barcodes(
number_of_kits, number_of_samples, kit_names=None)

kit_barcode = [['test', new_barcode[0]]]
project_ids = '1'
18 changes: 0 additions & 18 deletions microsetta_private_api/repo/admin_repo.py
Original file line number Diff line number Diff line change
@@ -863,24 +863,6 @@ def _generate_novel_barcodes(self, number_of_kits, number_of_samples,
else:
return new_barcodes

def _generate_novel_barcodes_admin(self,
number_of_kits,
number_of_samples):
"""Generate specified number of random barcodes for admin"""

total_barcodes = number_of_kits * number_of_samples

with self._transaction.cursor() as cur:
cur.execute(
"SELECT max(right(barcode,8)::integer) "
"FROM barcodes.barcode "
"WHERE barcode LIKE 'X%' OR barcode LIKE '0%'"
)
start_bc = cur.fetchone()[0] + 1
new_barcodes = ['X%0.8d' % (start_bc + i)
for i in range(total_barcodes)]
return new_barcodes

def _insert_barcodes_to_existing_kit(self,
kit_name_and_barcode_tuples_list,
project_ids):