viola.MultiVcf

class MultiVcf(ls_vcf: Optional[List[Vcf]] = None, ls_patient_names: Optional[List[str]] = None, direct_tables: Optional[List[DataFrame]] = None)

A database-like object that contains information of multiple Vcf files. In this class, main keys in most tables are “global id” instead of using “SV id” from SV callers. “global id” is unique ID of all the SV record across all the samples.

__init__(ls_vcf: Optional[List[Vcf]] = None, ls_patient_names: Optional[List[str]] = None, direct_tables: Optional[List[DataFrame]] = None)

Methods

__init__([ls_vcf, ls_patient_names, ...])

add_info_table(table_name, df)

Add a new INFO table to self.

annotate_bed(bed, annotation[, suffix])

Annotate SV breakpoints using Bed class object.

append_filters(base_df[, left_on])

Append filters to the right of the base_df, based on the SV id columns.

append_formats(base_df[, left_on])

Append formats to the right of the base_df, based on the SV id columns.

append_infos(base_df, ls_tablenames[, ...])

Append INFO tables to the right of the base_df, based on the SV id columns.

as_bedpe()

The same as as_bedpe_multi()

as_bedpe_multi()

Convert MultiVcf object into MultiBedpe object.

breakend2breakpoint()

Converts a Vcf object into a breakpoint-based Vcf object by integrating the paired breakends (BND) and infering their SVTYPE.

calculate_info(operation, name)

Calculate values of INFO tables according to the 'operation' argument and add a new INFO table as the result.

change_repr_config(key, value)

classify_manual_svtype(definitions, ...[, ...])

Classify SV records by user-defined criteria.

copy()

Return copy of the instance.

drop_by_id(svid)

Remove SV records specified in "svid" argument.

filter(ls_query, query_logic)

Filter Vcf object by the list of queries.

filter_by_id(arrlike_id)

Filter MultiBedpe object according to the list of SV ids.

get_feature_count_as_data_frame([feature, ...])

get_feature_count_as_series(feature, ls_order)

Return counts of unique values as a pd.Series for the INFO specified in the "feature" argument.

get_ids()

Return all SV ids as the set type.

get_info(info_name)

Return a info specified in the argument as pandas DataFrame object.

get_microhomology(fasta[, max_homlen])

Infer microhomology length and sequence in each breakpoint.

get_table(table_name)

Return a table specified in the argument as pandas DataFrame object.

integrate(merged_vcf, priority)

Return an integrated Vcf object

is_reciprocal()

merge(ls_vcf, ls_caller_names, threshold[, ...])

Return a merged or integrated vcf object from mulitple caller's bedpe objects in ls_bedpe

remove_info_table(table_name)

Remove an INFO table from self.

replace_svid(to_replace, value)

Renamed specified SV ID.

replace_table(table_name, table)

Replace existing table into new table.

set_value_for_info_by_id(table_name, sv_id, ...)

Set value to the specified info table by sv_id.

to_bedpe(file_or_buf[, custom_infonames, ...])

to_bedpe_like(file_or_buf, custom_infonames=[], add_filters, add_formats, confidence_intervals: bool=False) Return a BEDPE file.

to_bedpe_like([custom_infonames])

Return a DataFrame in bedpe-like format.

to_vcf(path_or_buf)

Return a vcf-formatted String.

to_vcf_like()

Return a vcf-formatted DataFrame.

view(custom_infonames, return_as_dataframe)

Quick view function of the Vcf object.

Attributes

contigs

Return a list of contigs (chromosomes) listed in the header of the VCF file.

ids

Return all SV ids as list.

idx

patient_name

Return the name of the patient.

repr_config

Return current configuration of __repr__() function.

sv_count

Return number of SV records.

table_list

Return a list of names of all tables in the object.