Updated `obi lcs
` for the LCS alignment of two columns
This commit is contained in:
@ -4,7 +4,8 @@ from obitools3.apps.progress cimport ProgressBar # @UnresolvedImport
|
|||||||
from obitools3.obidms._obidms cimport OBIDMS # TODO cimport doesn't work
|
from obitools3.obidms._obidms cimport OBIDMS # TODO cimport doesn't work
|
||||||
from obitools3.utils cimport str2bytes
|
from obitools3.utils cimport str2bytes
|
||||||
|
|
||||||
from obitools3.obidms.capi.obialign cimport obi_lcs_align_one_column
|
from obitools3.obidms.capi.obialign cimport obi_lcs_align_one_column, \
|
||||||
|
obi_lcs_align_two_columns
|
||||||
|
|
||||||
|
|
||||||
import time
|
import time
|
||||||
@ -161,18 +162,34 @@ cpdef align(str dms_n,
|
|||||||
cdef OBIDMS d
|
cdef OBIDMS d
|
||||||
d = OBIDMS(dms_n)
|
d = OBIDMS(dms_n)
|
||||||
|
|
||||||
# Align 1 column (2 columns not implemented yet)
|
if input_view_2_n == "" and input_column_2_n == "" :
|
||||||
if obi_lcs_align_one_column(d._pointer, \
|
if obi_lcs_align_one_column(d._pointer, \
|
||||||
str2bytes(input_view_1_n), \
|
str2bytes(input_view_1_n), \
|
||||||
str2bytes(input_column_1_n), \
|
str2bytes(input_column_1_n), \
|
||||||
str2bytes(input_elt_1_n), \
|
str2bytes(input_elt_1_n), \
|
||||||
str2bytes(id_column_1_n), \
|
str2bytes(id_column_1_n), \
|
||||||
str2bytes(output_view_n), \
|
str2bytes(output_view_n), \
|
||||||
str2bytes(comments), \
|
str2bytes(comments), \
|
||||||
print_seq, \
|
print_seq, \
|
||||||
print_count, \
|
print_count, \
|
||||||
threshold, normalize, reference, similarity_mode) < 0 :
|
threshold, normalize, reference, similarity_mode) < 0 :
|
||||||
raise Exception("Error aligning sequences")
|
raise Exception("Error aligning sequences")
|
||||||
|
else :
|
||||||
|
if obi_lcs_align_two_columns(d._pointer, \
|
||||||
|
str2bytes(input_view_1_n), \
|
||||||
|
str2bytes(input_view_2_n), \
|
||||||
|
str2bytes(input_column_1_n), \
|
||||||
|
str2bytes(input_column_2_n), \
|
||||||
|
str2bytes(input_elt_1_n), \
|
||||||
|
str2bytes(input_elt_2_n), \
|
||||||
|
str2bytes(id_column_1_n), \
|
||||||
|
str2bytes(id_column_2_n), \
|
||||||
|
str2bytes(output_view_n), \
|
||||||
|
str2bytes(comments), \
|
||||||
|
print_seq, \
|
||||||
|
print_count, \
|
||||||
|
threshold, normalize, reference, similarity_mode) < 0 :
|
||||||
|
raise Exception("Error aligning sequences")
|
||||||
|
|
||||||
d.close()
|
d.close()
|
||||||
|
|
||||||
|
@ -20,3 +20,21 @@ cdef extern from "obi_align.h" nogil:
|
|||||||
int reference,
|
int reference,
|
||||||
bint similarity_mode)
|
bint similarity_mode)
|
||||||
|
|
||||||
|
|
||||||
|
int obi_lcs_align_two_columns(OBIDMS_p dms,
|
||||||
|
const_char_p seq1_view_name,
|
||||||
|
const_char_p seq2_view_name,
|
||||||
|
const_char_p seq1_column_name,
|
||||||
|
const_char_p seq2_column_name,
|
||||||
|
const_char_p seq1_elt_name,
|
||||||
|
const_char_p seq2_elt_name,
|
||||||
|
const_char_p id1_column_name,
|
||||||
|
const_char_p id2_column_name,
|
||||||
|
const_char_p output_view_name,
|
||||||
|
const_char_p output_view_comments,
|
||||||
|
bint print_seq,
|
||||||
|
bint print_count,
|
||||||
|
double threshold,
|
||||||
|
bint normalize,
|
||||||
|
int reference,
|
||||||
|
bint similarity_mode);
|
||||||
|
Reference in New Issue
Block a user