Skip to content

Commit

Permalink
test: add algorithm comparision test
Browse files Browse the repository at this point in the history
  • Loading branch information
pdmnyberg committed Apr 4, 2024
1 parent 4cdda84 commit f800151
Show file tree
Hide file tree
Showing 4 changed files with 4,970 additions and 6 deletions.
14 changes: 9 additions & 5 deletions search/oligo_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
})


def get_gene_list(input_gene):
def get_sequence(input_gene):
gene_gRNA = gRNA_EuPaGDT_top[gRNA_EuPaGDT_top['GENE ID'] == input_gene]
if gene_gRNA.empty:
raise SearchError(f'No gRNA found for: {input_gene}')
Expand Down Expand Up @@ -90,13 +90,17 @@ def get_gene_list(input_gene):
return PbHOT_KO_Vector_List


def search_to_file(gene_ids, output_format="csv"):
full_result = pd.concat(
def get_sequence_list(gene_ids):
return pd.concat(
[
get_gene_list(gene_id)
get_sequence(gene_id)
for gene_id in gene_ids
]
)


def search_to_file(gene_ids, output_format="csv"):
full_result = get_sequence_list(gene_ids)
output_data = pd.DataFrame(
{
'GENE ID': full_result['GENE ID'],
Expand All @@ -116,7 +120,7 @@ def search(gene_ids):
return list(chain(
*[
SearchResult.from_df(
get_gene_list(gene_id),
get_sequence(gene_id),
anno.OLIGO_SEQUENCE_ORDER
)
for gene_id in gene_ids
Expand Down
2 changes: 1 addition & 1 deletion search/tests/PbHiT_KO_Vector_Oligo_Search_NBIS.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def make_rc_record(record):
#Convert to batch search
#gene_list=['PBANKA_1034300,PBANKA_1231600,PBANKA_1437500,PBANKA_1015500,PBANKA_1319700']
#rows=len(gene_list)
def get_sequence(gene_list):
def get_sequence_list(gene_list):
dftest=pd.DataFrame()

for x in gene_list:
Expand Down
Loading

0 comments on commit f800151

Please sign in to comment.