pluto.tools.load_mutations¶
- pluto.tools.load_mutations(filename)[source]¶
Load the mutations from a tabular .maf file
- Parameters
filename (str) – path to input file
- Returns
list – a list of comment lines from the file
list – a list of dicts containing the records from the file
Examples
Example usage:
>>> row1 = {'Hugo_Symbol': 'SOX9', 'Chromosome': '1'} >>> row2 = {'Hugo_Symbol': 'BRCA', 'Chromosome': '7'} >>> comments = [ ['# version 2.4'] ] >>> lines = dicts2lines([row1, row2], comments) >>> output_path = write_table('.', 'output.maf', lines) >>> comments, mutations = load_mutations(output_path) >>> comments ['# version 2.4'] >>> mutations [OrderedDict([('Hugo_Symbol', 'SOX9'), ('Chromosome', '1')]), OrderedDict([('Hugo_Symbol', 'BRCA'), ('Chromosome', '7')])]