Changeset 5764


Ignore:
Timestamp:
Nov 29, 2019, 1:49:06 PM (3 years ago)
Author:
Nicklas Nordborg
Message:

References #1208: Implement wizard for building database of variant frequencies in SCAN-B samples

Added a quick check that the selected item list seems to contain alignements with a 'variants-raw.vcf.gz' file.

Location:
extensions/net.sf.basedb.reggie/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/resources/analysis/vcall_build.js

    r5763 r5764  
    7979      return;
    8080    }
    81    
    82     // TODO -- implement a pre-validation check on the alignments in the list   
    83     selectionIsValid = true;
    84     Wizard.setInputStatus('itemList', 'valid');
    85   }
    86 
     81
     82    // Make some minor and quick checks on the selected list
     83    Wizard.setInputStatus('itemList', 'checking', 'Checking...');
     84    var url = '../VariantCalling.servlet?ID='+App.getSessionId();
     85    url += '&cmd=PreValidateItemListForStatistics';
     86    url += '&listId='+frm.itemList.value;
     87    Wizard.asyncJsonRequest(url, vcall.itemListValidated);
     88  }
     89
     90  vcall.itemListValidated = function(response)
     91  {
     92    if (response.message)
     93    {
     94      selectionIsValid = false;
     95      Wizard.setInputStatus('itemList', 'invalid', response.message);
     96    }
     97    else
     98    {
     99      selectionIsValid = true;
     100      Wizard.setInputStatus('itemList', 'valid');
     101    }
     102   
     103  }
    87104
    88105  // --- Step 2 -----------------------------------
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/VariantCallingServlet.java

    r5735 r5764  
    2323import net.sf.basedb.core.Extract;
    2424import net.sf.basedb.core.File;
     25import net.sf.basedb.core.Include;
    2526import net.sf.basedb.core.Item;
    2627import net.sf.basedb.core.ItemQuery;
     
    5556import net.sf.basedb.reggie.grid.ScriptUtil;
    5657import net.sf.basedb.reggie.grid.VariantCallingJobCreator;
     58import net.sf.basedb.reggie.query.AnyToAnyRestriction;
    5759import net.sf.basedb.reggie.vcf.SnpData;
    5860import net.sf.basedb.reggie.vcf.VariantCallingInfoFactory;
     
    234236        {
    235237          FileUtil.close(vcfIn);
     238        }
     239      }
     240      else if ("PreValidateItemListForStatistics".equals(cmd))
     241      {
     242        int listId = Values.getInt(req.getParameter("listId"));
     243        dc = sc.newDbControl();
     244       
     245        ItemList list = ItemList.getById(dc, listId);
     246        if (list.getMemberType() != Item.DERIVEDBIOASSAY)
     247        {
     248          json.put("message", "A list with DERIVEDBIOASSAY items is required");
     249        }
     250        else if (list.getSize() == 0)
     251        {
     252          json.put("message", "The list is empty");
     253        }
     254        else
     255        {
     256          ItemQuery<DerivedBioAssay> query = (ItemQuery<DerivedBioAssay>)list.getMembers();
     257          query.include(Include.ALL);
     258          query.restrict(AnyToAnyRestriction.exists("variants-raw.vcf.gz", Item.FILE));
     259         
     260          long count = query.count(dc);
     261          if (count != list.getSize())
     262          {
     263            json.put("message", "Only " + count + " of " + list.getSize() +
     264              " members in the list have a 'variants-raw.vcf.gz' file");
     265          }
    236266        }
    237267      }
Note: See TracChangeset for help on using the changeset viewer.