<commit_before>$(function() {

  $('button[name=get_pdb]').click(function() {
                                  
    if ($('input[name=pdb]').val()) {
      $.ajax({
        url: 'http://www.rcsb.org/pdb/rest/customReport?pdbids='+$('input[name=pdb]').val()+'&customReportColumns=structureId,structureTitle,unitCellAngleAlpha,unitCellAngleBeta,unitCellAngleGamma,lengthOfUnitCellLatticeA,lengthOfUnitCellLatticeB,lengthOfUnitCellLatticeC,structureAuthor,citationAuthor,firstPage,lastPage,journalName,title,volumeId,publicationYear,diffractionSource,resolution,spaceGroup,releaseDate',
        type: 'GET',
        dataType: 'xml',
        timeout: 5000,
        success: function(xml){
            $(xml).find('record').each(function(i,r) {
                $.each({ a: 'lengthOfUnitCellLatticeA',
                        b: 'lengthOfUnitCellLatticeB',
                        c: 'lengthOfUnitCellLatticeC',
                        al: 'unitCellAngleAlpha',
                        be: 'unitCellAngleBeta',
                        ga: 'unitCellAngleGamma',
                       }, function(k,v) {
                    $('input[name='+k+']').val($(r).find('dimStructure\\.'+v).text())
                })
                        
                $('.pdb_details .title').html($('input[name=pdb]').val()+': '+$(r).find('dimStructure\\.structureTitle').text())
                                       
                var res = $(r).find('dimStructure\\.resolution').text()
                $('.pdb_details .res').html(res)
                $('input[name=res]').val(res)
                                       
                $('input[name=sg]').val($(r).find('dimStructure\\.spaceGroup').text())
                                       
                if ($(r).find('dimStructure\\.diffractionSource').text() != 'null') $('.pdb_details .beamline').html($(r).find('dimStructure\\.diffractionSource').text())
                $('.pdb_details .author').html($(r).find('dimStructure\\.structureAuthor').text())
                                       
                var cit = $(r).find('dimStructure\\.title').text()
                if (cit) {
                    $.each(['citationAuthor', 'firstPage', 'volumeId', 'journalName', 'publicationYear'], function(i,f) {
                        if ($(r).find('dimStructure\\.'+f).text() != 'null') cit += ', '+$(r).find('dimStructure\\.'+f).text()
                    })
                } else cit = 'N/A'
                                       
                $('.pdb_details .citation').html(cit)
                $('.pdb_details .date').html($(r).find('dimStructure\\.releaseDate').text())
                $('.pdb_details').slideDown()
                                       
                $('button[name=lookup]').trigger('click')
                    
            })
        }
           
      })
    }
  })
  
  
  // Get data collections for a particular cell
  $('button[name=lookup]').click(function() {
    var uc = {}
    $.each(['a', 'b', 'c', 'al', 'be', 'ga'], function(i,e) {
        uc[e] = $('input[name='+e+']').val()
    })
                                 
    // 25% tolerance on resolution
    if ($('input[name=res]').val()) uc['res'] = $('input[name=res]').val()*1.25
    if ($('input[name=sg]').val()) uc['sg'] = $('input[name=sg]').val()
                                 
    uc['tol'] = $('input[name=tol]').val()
                  
    if ($('.pdb_details .date').html()) uc['year'] = $('.pdb_details .date').html()
                                 
    $.ajax({<commit_msg>Add loading message to cell search<commit_after>$(function() {

  $('button[name=get_pdb]').click(function() {
                                  
    if ($('input[name=pdb]').val()) {
      $.ajax({
        url: 'http://www.rcsb.org/pdb/rest/customReport?pdbids='+$('input[name=pdb]').val()+'&customReportColumns=structureId,structureTitle,unitCellAngleAlpha,unitCellAngleBeta,unitCellAngleGamma,lengthOfUnitCellLatticeA,lengthOfUnitCellLatticeB,lengthOfUnitCellLatticeC,structureAuthor,citationAuthor,firstPage,lastPage,journalName,title,volumeId,publicationYear,diffractionSource,resolution,spaceGroup,releaseDate',
        type: 'GET',
        dataType: 'xml',
        timeout: 5000,
        success: function(xml){
            $(xml).find('record').each(function(i,r) {
                $.each({ a: 'lengthOfUnitCellLatticeA',
                        b: 'lengthOfUnitCellLatticeB',
                        c: 'lengthOfUnitCellLatticeC',
                        al: 'unitCellAngleAlpha',
                        be: 'unitCellAngleBeta',
                        ga: 'unitCellAngleGamma',
                       }, function(k,v) {
                    $('input[name='+k+']').val($(r).find('dimStructure\\.'+v).text())
                })
                        
                $('.pdb_details .title').html($('input[name=pdb]').val()+': '+$(r).find('dimStructure\\.structureTitle').text())
                                       
                var res = $(r).find('dimStructure\\.resolution').text()
                $('.pdb_details .res').html(res)
                $('input[name=res]').val(res)
                                       
                $('input[name=sg]').val($(r).find('dimStructure\\.spaceGroup').text())
                                       
                if ($(r).find('dimStructure\\.diffractionSource').text() != 'null') $('.pdb_details .beamline').html($(r).find('dimStructure\\.diffractionSource').text())
                $('.pdb_details .author').html($(r).find('dimStructure\\.structureAuthor').text())
                                       
                var cit = $(r).find('dimStructure\\.title').text()
                if (cit) {
                    $.each(['citationAuthor', 'firstPage', 'volumeId', 'journalName', 'publicationYear'], function(i,f) {
                        if ($(r).find('dimStructure\\.'+f).text() != 'null') cit += ', '+$(r).find('dimStructure\\.'+f).text()
                    })
                } else cit = 'N/A'
                                       
                $('.pdb_details .citation').html(cit)
                $('.pdb_details .date').html($(r).find('dimStructure\\.releaseDate').text())
                $('.pdb_details').slideDown()
                                       
                $('button[name=lookup]').trigger('click')
                    
            })
        }
           
      })
    }
  })
  
  
  // Get data collections for a particular cell
  $('button[name=lookup]').click(function() {
    var uc = {}
    $.each(['a', 'b', 'c', 'al', 'be', 'ga'], function(i,e) {
        uc[e] = $('input[name='+e+']').val()
    })
                                 
    // 25% tolerance on resolution
    if ($('input[name=res]').val()) uc['res'] = $('input[name=res]').val()*1.25
    if ($('input[name=sg]').val()) uc['sg'] = $('input[name=sg]').val()
                                 
    uc['tol'] = $('input[name=tol]').val()
                  
    if ($('.pdb_details .date').html()) uc['year'] = $('.pdb_details .date').html()
                     
    $('.count').html('Searching...')
                                 
    $.ajax({
{'fraction_non_alphanumeric': 0.19245810055865922, 'fraction_numerical': 0.0025139664804469273, 'mean_word_length': 1.6135036496350366, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6688899', 'n_tokens_mistral': 2103, 'n_tokens_neox': 1963, 'n_words': 231}