HTML File Looking for Patient's Risk Factor of Gaucher's Disease



Download



Running the file

Do the following before running the file:Register an account SMART Genomics' reference serverand import data or login with following account:




Javascript that Calls the API

$.ajax({
    //use the api to search for genotypes
    type : "GET",
    dataType : "jsonp",
    contentType : "application/json",
    url : "http://genomics-advisor.smartplatforms.org:7000/api/sequence?coordinate=" + coord + "&patient=patient/" + pt,
    success : function(seq_feed){
 
        if(!seq_feed.entry||seq_feed.entry.length == 0){
 
            //not genotyped
            $('genotype').text("Sorry, but the patient hasn't been genotyped at the location we are interested in");
 
        }
 
        var feed = seq_feed.feed.entry[0]
        var read = feed.content.Sequence.read.value;
        var separatorIndex = read.indexOf('|');
        if(separatorIndex == -1||read.indexOf('_') != -1){
 
            //not genotyped
            $("#genotype").text("Sorry, but the patient hasn't been genotyped at the location we are interested in");
        }else{
 
            //genotyped
            var firstGenotype = read.substring(0, separatorIndex);
            var secondGenotype = read.substring(separatorIndex + 1);
 
            //T is the risk factor
            if(firstGenotype == 'T'||secondGenotype == 'T'){
 
                $("#genotype").text(":( Risk factor found! -- Genotype of rs421016 is " + read);
 
            }else{
 
                $("#genotype").text(":) No risk factor found! -- Genotype of rs421016 is " + read);
 
            }
 
        }
    }
});