def export_mt_variants(variants, sample_id):
document_lines = []<EOL>for variant in variants:<EOL><INDENT>line = []<EOL>position = variant.get('<STR_LIT>')<EOL>change = '<STR_LIT:>>'.join([variant.get('<STR_LIT>'),variant.get('<STR_LIT>')])<EOL>line.append(position)<EOL>line.append(change)<EOL>line.append(str(position)+change)<EOL>genes = []<EOL>prot_effect = []<EOL>for gene in variant.get('<STR_LIT>'):<EOL><INDENT>genes.append(gene.get('<STR_LIT>','<STR_LIT>'))<EOL>for transcript in gene.get('<STR_LIT>'):<EOL><INDENT>if transcript.get('<STR_LIT>') and transcript.get('<STR_LIT>'):<EOL><INDENT>prot_effect.append(urllib.parse.unquote(transcript.get('<STR_LIT>')))<EOL><DEDENT><DEDENT><DEDENT>line.append('<STR_LIT:U+002C>'.join(prot_effect))<EOL>line.append('<STR_LIT:U+002C>'.join(genes))<EOL>ref_ad = '<STR_LIT>'<EOL>alt_ad = '<STR_LIT>'<EOL>for sample in variant['<STR_LIT>']:<EOL><INDENT>if sample.get('<STR_LIT>') == sample_id:<EOL><INDENT>ref_ad = sample['<STR_LIT>'][<NUM_LIT:0>]<EOL>alt_ad = sample['<STR_LIT>'][<NUM_LIT:1>]<EOL><DEDENT><DEDENT>line.append(ref_ad)<EOL>line.append(alt_ad)<EOL>document_lines.append(line)<EOL><DEDENT>return document_lines<EOL>
Export mitochondrial variants for a case to create a MT excel report

    Args:
        variants(list): all MT variants for a case, sorted by position
        sample_id(str) : the id of a sample within the case

    Returns:
        document_lines(list): list of lines to include in the document