Skip to content
onursumer edited this page May 5, 2016 · 5 revisions

Initializing the Mutation Mapper

To initialize mutation mapper with the minimal settings, you will need to provide list of genes, and a list of samples:

var options = {
    el: '#my_mutation_mapper_div_id', // target element where the components will be rendered
    data: {
        geneList: ['TP53', 'KRAS']
    }
};

var mutationMapper = new MutationMapper(options);
mutationMapper.init();

This will initialize the MutationMapper instance and render the contents within the provided target element.

This minimal configuration requires a server side component and will only work if Mutation Mapper can access to the default data services defined for the proxies. For a more advanced initialization, see the section Customizing Data Proxies.

Customizing Data Proxies

By default, each data proxy instance requires a web service to get the data. You can customize data proxies by setting the corresponding configuration options. For example, the code below initializes a Mutation Mapper instance where the data is collected from cBioPortal web services.

var options = {
    el: '#my_mutation_mapper_div_id', // target element where the components will be rendered
    data: {
        geneList: ['TP53', 'KRAS']
    },
    proxy: {
        mutationProxy: {
            options: {
                servletName: 'http://www.cbioportal.org/getMutationData.json',
                params: {
                    geneticProfiles: 'ov_tcga_pub_mutations',
                    caseSetId: 'ov_tcga_pub_3way_complete'
                }
            }
        },
        pfamProxy: {
            options: {
                servletName: 'http://www.cbioportal.org/getPfamSequence.json'
            }
        }
    }
};

var mutationMapper = new MutationMapper(options);
mutationMapper.init();

Although this will initialize the basic view components, you need more than that to have a fully functioning mutation mapper which gets all its data from cBioPortal web services:

var options = {
    el: '#my_mutation_mapper_div_id', // target element where the components will be rendered
    data: {
        geneList: ['TP53', 'KRAS']
    },
    proxy: {
        mutationProxy: {
            options: {
                servletName: 'http://www.cbioportal.org/getMutationData.json',
                params: {
                    geneticProfiles: 'ov_tcga_pub_mutations',
                    caseSetId: 'ov_tcga_pub_3way_complete'
                }
            }
        },
        pfamProxy: {
            options: {
                servletName: 'http://www.cbioportal.org/getPfamSequence.json'
            }
        },
        mutationAlignerProxy: {
            options: {
                servletName: 'http://www.cbioportal.org/getMutationAligner.json'
            }
        },
        pdbProxy: {
            options: {
                servletName: 'http://www.cbioportal.org/get3dPdb.json',
                subService: false,
                listJoiner: ' ',
            }
        }
    }
};

var mutationMapper = new MutationMapper(options);
mutationMapper.init();

Clone this wiki locally