kinmatch

kinmatch.__init__

exception kinmatch.AlreadyExistException(*args, **kwargs)[소스]
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception kinmatch.DBConnectionException(*args, **kwargs)[소스]
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception kinmatch.FileTypeException(*args, **kwargs)[소스]
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception kinmatch.KinmatchException(message)[소스]
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception kinmatch.NoValueException(*args, **kwargs)[소스]
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception kinmatch.ParameterException(*args, **kwargs)[소스]
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception kinmatch.ParsingException(*args, **kwargs)[소스]
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

kinmatch.db

class kinmatch.db.AlleleFrequenciesManager(dbname='kinmatch')[소스]
add(infile, informat, name, type_, overwrite=False, initial=False, description=None)[소스]
create(infile, informat, name, type_, description=None)[소스]
current_allele_frequency = {'astr_23': {'markers': ['D8S1179', 'D21S11', 'D7S820', 'CSF1PO', 'D3S1358', 'TH01', 'D13S317', 'D16S539', 'D2S1338', 'D19S433', 'vWA', 'TPOX', 'D18S51', 'D5S818', 'FGA', 'Penta_E', 'Penta_D', 'D10S1248', 'D12S391', 'D1S1656', 'D22S1045', 'D2S441', 'SE33'], 'type_': 'A-STR'}, 'ystr_16': {'markers': ['DYS385', 'DYS389II', 'DYS392'], 'type_': 'Y-STR'}, 'ystr_23': {'markers': ['DYS385', 'DYS389II', 'DYS392', 'DYS635', 'GATAH4__1'], 'type_': 'Y-STR'}, 'astr_15': {'markers': ['D8S1179', 'D21S11', 'D7S820', 'CSF1PO', 'D3S1358', 'TH01', 'D13S317', 'D16S539', 'D2S1338', 'D19S433', 'vWA', 'TPOX', 'D18S51', 'D5S818', 'FGA'], 'type_': 'A-STR'}}
delete(name)[소스]
delete_allele_frequencies(name)[소스]
export_allele_frequency()[소스]
get(name, type_)[소스]
get_from_read(name, type_)[소스]
get_names_info()[소스]
list()[소스]
make_current_db()[소스]
read(name, type_)[소스]
show(name, type_, outfile, seperator='tab', excelfile='')[소스]
update(infile, informat, name, type_, description=None)[소스]
class kinmatch.db.GenotypeManager(dbname='kinmatch')[소스]
add_file(infile, type_, format='GeneMark', overwrite=False, initial=False, group=None)[소스]
add_group(identifiers, group)[소스]
create(infile, informat='GeneMark', type_='A-STR', group=None)[소스]
delete(identifier, genotype='all')[소스]
delete_genotype(identifier)[소스]
genmark_txt_to_df(txtfile_or_path, type_)[소스]
get_genotype(identifier)[소스]
get_genotype_with_none(identifier)[소스]
get_genotypes(type_)[소스]
get_genotypes_by_group(type_, group)[소스]
list(type_=None, identifier=None, page=None, paginate_by=10, sort=None, desc=False, filter_astr=False, filter_ystr=False, filter_mtdna=False)[소스]
mtdna_genmark_txt_to_df(txtfile_or_path)[소스]
read(identifier, type_=None, kit='All', null='-')[소스]
remove_genotype(identifier, genotype='all')[소스]
set_genotype(identifier, type_, genotype)[소스]
set_genotype_merge_with_overwrite(identifier, type_, genotype)[소스]
set_genotype_merge_without_overwrite(identifier, type_, genotype)[소스]
set_identifier(identifier)[소스]
set_initial()[소스]
update(file_or_individual, *args, **kwargs)[소스]
update_by_file(infile, informat='GeneMark', type_='A-STR', save_by='replacement', group=None)[소스]
update_by_genotype(type_, identifier, genotype, save_by='merge-with-overwrite')[소스]
class kinmatch.db.GroupManager(dbname='kinmatch')[소스]
create(identifier)[소스]
delete(identifier)[소스]
ids_belong_group(group)[소스]

return list of ids which belong to certain group

list()[소스]

return group list

read(identifier)[소스]
update(identifier)[소스]
class kinmatch.db.ResourceManager(dbname='kinmatch')[소스]
create(*args, **kwargs)[소스]
delete(*args, **kwargs)[소스]
list(*args, **kwargs)[소스]
read(*args, **kwargs)[소스]
update(*args, **kwargs)[소스]
class kinmatch.db.TaskManager(dbname='kinmatch')[소스]
create(identifier, query_group, query_type, query_count, query_first, query_second, target_group, target_type, target_count, target_first, target_second, relationship_type, description, partial, astr_option, ystr_option, mtdna_option, dbname)[소스]
delete(identifier)[소스]
get(identifier)[소스]
get_alltasks(field=None, query=None, sort='registered_time', desc=True)[소스]
list(identifier=None, query_group=None, query_type=None, target_group=None, target_type=None, description=None, status=None, sort='registered_time', desc=True, paginate_by=20, page=None)[소스]
read(identifier)[소스]
update(identifier, field, value)[소스]
kinmatch.db.get_mongodb(dbname='kinmatch', user='kinmatch_admin', password='kinmatch4321')[소스]

kinmatch.search

class kinmatch.search.BaseSearcher(query=None, df_genotypes=None)[소스]
search_identities()[소스]
set_params(query, df_genotypes)[소스]
class kinmatch.search.CheckerBetween(query_a, query_b, type_, af_table=None)[소스]
arrange_result(result, true_string)[소스]
check_identities()[소스]
check_kinships()[소스]
check_paternities(add_shared_allele=False)[소스]
check_paternities_add_shared_allele(result)[소스]
class kinmatch.search.IdentityIndexCalculator(af_table)[소스]
find_formula(query_alleles, target_alleles)
formula = {}
get_af(marker, allele)
get_cumulative_index(markers, query, target)[소스]
get_index(marker, a1, a2, b1, b2)
class kinmatch.search.IndexCalculator(af_table)[소스]
find_formula(query_alleles, target_alleles)[소스]
formula = {}
get_af(marker, allele)[소스]
get_cumulative_index(markers, query, target)[소스]
get_index(marker, a1, a2, b1, b2)[소스]
class kinmatch.search.KinshipIndexCalculator(af_table)[소스]
coefficients = {'full-sib': (0.25, 0.5, 0.25), 'first cousin': (0.75, 0.25, 0), 'parent-child': (0, 1, 0), 'half-sib': (0.5, 0.5, 0), 'unrelated': (1, 0, 0), '6 chon': (0.9375, 0.0625, 0), '5 chon': (0.875, 0.125, 0), '7 chon': (0.96875, 0.03125, 0), '8 chon': (0.984375, 0.015625, 0)}
find_formula(query_alleles, target_alleles)[소스]
formula = {}
formulas = {1: <function KinshipIndexCalculator.<lambda> at 0x10b662f28>, 2: <function KinshipIndexCalculator.<lambda> at 0x10b676048>, 3: <function KinshipIndexCalculator.<lambda> at 0x10b6760d0>, 4: <function KinshipIndexCalculator.<lambda> at 0x10b676158>, 5: <function KinshipIndexCalculator.<lambda> at 0x10b6761e0>, 6: <function KinshipIndexCalculator.<lambda> at 0x10b676268>, 7: <function KinshipIndexCalculator.<lambda> at 0x10b6762f0>, 8: <function KinshipIndexCalculator.<lambda> at 0x10b676378>}
get_af(marker, allele)
get_cumulative_index(query, target, relationship)[소스]
get_index(marker, relationship, query_alleles, target_alleles)[소스]
relationships = ['5 chon', '6 chon', '7 chon', '8 chon', 'first cousin', 'full-sib', 'half-sib', 'parent-child', 'unrelated']
relationships_explanation = {'full-sib': '형제관계 (부모가 모두 같을 경우)', 'first cousin': '4촌 형제관계', 'parent-child': '부모-자식관계', 'half-sib': '이복/이부 형제, 삼촌-조카, 조부-손자', 'unrelated': '무관한 관계', '6 chon': '6촌 형제', '5 chon': '5촌', '7 chon': '7촌', '8 chon': '8촌 형제'}
class kinmatch.search.ManageCheckBetween(relationship_type, identifier_a, identifier_b, partial=True, check_astr=True, astr_partial=True, astr_permit_mismatches=2, af_table=None, min_kinship_index=1, check_ystr=False, ystr_partial=True, ystr_permit_mismatches=2, check_mtdna=False, mtdna_partial=True, mtdna_permit_mismatches=2, mtdna_exclude_cstretches=False, dbname='kinmatch')[소스]
check()[소스]
get_astr_report(df)[소스]
get_mtdna_report(df)[소스]
get_ystr_report(df)[소스]
make_report(data)[소스]
run_check_between(relationship_type, type_, shared_allele=False, partial=False, format=None)[소스]
total_row(result, is_kinship=False, is_paternity=False)[소스]
class kinmatch.search.ManageMultipleSearch(query_group='soldier', query_type='all', query_first=None, query_second=None, target_group='customer', target_type='all', target_first=None, target_second=None, relationship_type='kinship', partial=True, check_astr=True, astr_partial=True, astr_permit_mismatches=2, af_table=None, min_kinship_index=1, check_ystr=False, ystr_partial=True, ystr_permit_mismatches=2, check_mtdna=False, mtdna_partial=True, mtdna_permit_mismatches=2, mtdna_exclude_cstretches=False, dbname='kinmatch', description=None)[소스]
get_filtered_identifiers(group, query_type, queries)[소스]
search()[소스]
search_multiple_async(task_id, queries, astr_option=None, ystr_option=None, mtdna_option=None, targets=None)[소스]
class kinmatch.search.ManageSearcher(relationship_type, identifier, target_group, partial=True, check_astr=True, astr_partial=True, astr_permit_mismatches=2, af_table=None, min_kinship_index=1, check_ystr=False, ystr_partial=True, ystr_permit_mismatches=2, check_mtdna=False, mtdna_partial=True, mtdna_permit_mismatches=2, mtdna_exclude_cstretches=False, dbname='kinmatch')[소스]
get_target_group_info(row, group=None)[소스]
search()[소스]
class kinmatch.search.MtdnaSearcher(query=None, df_genotypes=None)[소스]
exclude_markers_in_cstretch(columns)[소스]
search_identities(permit_mismatches=2, exclude_cstretches=False, partial=False, is_multiprocess=True)[소스]
search_identities_by_query_index(permit_mismatches=2, exclude_cstretches=False)[소스]
search_identities_intersection(permit_mismatches=2, exclude_cstretches=False)[소스]
set_params(query, df_genotypes)
class kinmatch.search.PaternityIndexCalculator(af_table)[소스]
find_formula(query_alleles, target_alleles)[소스]
formula = {1: <function PaternityIndexCalculator.<lambda> at 0x10b662ae8>, 2: <function PaternityIndexCalculator.<lambda> at 0x10b662b70>, 3: <function PaternityIndexCalculator.<lambda> at 0x10b662bf8>, 4: <function PaternityIndexCalculator.<lambda> at 0x10b662c80>, 5: <function PaternityIndexCalculator.<lambda> at 0x10b662d08>}
get_af(marker, allele)
get_cumulative_index(markers, query, target)[소스]
get_index(marker, a1, a2, b1, b2)[소스]
class kinmatch.search.SearchIntegrator(query)[소스]
search_kinships(astrs=None, ystrs=None, astr_kwargs={}, ystr_kwargs={})[소스]

Mutable dict was used in keyword argument. Be careful for this mutation.

search_relationship(relationship_type, astrs=None, ystrs=None, mtdnas=None, astr_kwargs={}, ystr_kwargs={}, mtdna_kwargs={}, partial=False, is_multiprocess=True)[소스]

Mutable dict was used in keyword argument. Be careful for this mutation.

class kinmatch.search.StrSearcher(query, df_genotypes)[소스]
search_identities(permit_mismatches=2, af_table=None, partial=False, is_multiprocess=True)[소스]
search_kinships(af_table, min_kinship_index=1, is_multiprocess=True)[소스]
search_paternities(permit_mismatches=2, af_table=None, partial=False, is_multiprocess=True)[소스]
set_params(query, df_genotypes)
kinmatch.search.identities_match_sum(row, query=None, active_markers=None)[소스]
kinmatch.search.identities_match_sum_partial(row, query=None, active_markers=None)[소스]
kinmatch.search.kinship_index(row, query=None, calculator=None, active_markers=None)[소스]
kinmatch.search.paternities_match_sum(row, query=None, active_markers=None)[소스]
kinmatch.search.paternities_match_sum_partial(row, query=None, active_markers=None)[소스]
kinmatch.search.run_check_hml(customer_identifier, goldstar_identifier)[소스]

kinmatch.report

kinmatch.report.create_astr_kinship_rows(kinship_result, goldstar_identifier, customer_identifier, start_row_num=2)[소스]
kinmatch.report.create_astr_rows(astr_result, goldstar_identifier, customer_identifier, start_row_num=1)[소스]
kinmatch.report.create_mtdna_rows(mtdna_result, goldstar_identifier, customer_identifier, start_row_num=1)[소스]
kinmatch.report.create_row(result_row, args)[소스]
kinmatch.report.create_ystr_rows(ystr_result, goldstar_identifier, customer_identifier, start_row_num=1)[소스]
kinmatch.report.make_hml(query_a, query_b, outfile, customer_goldstar_name, customer_name, customer_relationship, hml_template='data/kinship_result.hml')[소스]
kinmatch.report.relative(value)[소스]
kinmatch.report.render_django_style(template_file, key_value, outfile)[소스]

only {% if %} and {{ }} statements is considered. key_value argument should be like this => {‘key’: ‘value’}

kinmatch.report.temp_main(identifier_a, identifier_b, customer_goldstar_name='', customer_name='', customer_relationship='', af_table_name='Korean')[소스]

kinmatch.config

kinmatch.utils

class kinmatch.utils.ASTRGenotypeCleaner(genotype, is_encoded=False)[소스]
decode(null='-', markers=None)
decode_allele(allele, marker='')
decode_alleles(alleles, marker='', null='-')
static decode_marker(marker)[소스]
encode(null=None, markers=None)[소스]
encode_allele(allele, marker='')
encode_alleles(alleles, marker='', null=None)
encode_marker(marker)
class kinmatch.utils.DataContainer(status='', message='', items=None, itemCount=0, totalCount=0, totalPageCount=0, format_='json', trans=False, zeroization=False)[소스]
convert(format_='')[소스]
convert_df2dsv(df, format_='')[소스]
convert_df2json(df)[소스]
get_items()[소스]
items
raw_print(sep=', ')[소스]
set_items(items)[소스]
to_dsv(format_)[소스]
to_json()[소스]
to_json_by_dict()[소스]
to_json_by_list()[소스]
to_plain()[소스]
class kinmatch.utils.GenotypeCleaner(genotype, is_encoded=False)[소스]
decode(null='-', markers=None)[소스]
decode_allele(allele, marker='')[소스]
decode_alleles(alleles, marker='', null='')[소스]
static decode_marker(marker)[소스]
encode(null=None, markers=None)[소스]
encode_allele(allele, marker='')[소스]
encode_alleles(alleles, marker='', null=None)[소스]
static encode_marker(marker)[소스]
class kinmatch.utils.MtdnaGenotypeCleaner(genotype, is_encoded=False)[소스]
decode(null='-', markers=None)
decode_allele(allele, marker='')
decode_alleles(alleles, marker='', null='')
static decode_marker(marker)[소스]
encode(null=None, markers=None)[소스]
encode_allele(allele, marker='')
encode_alleles(alleles, marker='', null=None)
encode_marker(marker)
class kinmatch.utils.STRGenotypeCleaner(genotype, is_encoded=False)[소스]
decode(null='-', markers=None)
decode_allele(allele, marker='')[소스]
decode_alleles(alleles, marker='', null='-')[소스]
decode_marker(marker)
encode(null=None, markers=None)
encode_allele(allele, marker='')[소스]
encode_alleles(alleles, marker='', null=None)[소스]
encode_marker(marker)
class kinmatch.utils.YSTRGenotypeCleaner(genotype, is_encoded=False)[소스]
decode(null='-', markers=None)
decode_allele(allele, marker='')
decode_alleles(alleles, marker='', null='-')[소스]
decode_marker(marker)
encode(null=None, markers=None)[소스]
encode_allele(allele, marker='')
encode_alleles(alleles, marker='', null=None)
static encode_marker(marker)[소스]
kinmatch.utils.apply_by_multiprocessing(df, func, **kwargs)[소스]
kinmatch.utils.decode_allele(allele, type_, marker='')[소스]
kinmatch.utils.decode_alleles(alleles, type_, marker='', null='')[소스]
kinmatch.utils.decode_genotype(genotype, type_, null='-')[소스]
kinmatch.utils.decode_marker(marker, type_)[소스]
kinmatch.utils.encode_alleles(alleles, type_, marker='')[소스]
kinmatch.utils.encode_genotype(genotype, type_, null=None)[소스]
kinmatch.utils.encode_marker(marker, type_)[소스]