Changeset 5928


Ignore:
Timestamp:
Apr 29, 2020, 1:44:13 PM (5 weeks ago)
Author:
Nicklas Nordborg
Message:

Fixes #1240: Release exporter changes due to SSP

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

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/plugins/release/StringTieWriter.java

    r5875 r5928  
    11package net.sf.basedb.reggie.plugins.release;
    22
     3import java.util.ArrayList;
    34import java.util.Arrays;
    45import java.util.HashSet;
     
    89import org.json.simple.JSONObject;
    910
     11import net.sf.basedb.core.AnnotationType;
    1012import net.sf.basedb.core.DbControl;
    1113import net.sf.basedb.core.DerivedBioAssay;
     
    1315import net.sf.basedb.core.File;
    1416import net.sf.basedb.core.Item;
     17import net.sf.basedb.core.ItemQuery;
    1518import net.sf.basedb.core.Location;
    1619import net.sf.basedb.core.Quantity;
     
    1821import net.sf.basedb.core.RawDataType;
    1922import net.sf.basedb.core.Type;
     23import net.sf.basedb.core.query.Expressions;
     24import net.sf.basedb.core.query.Hql;
     25import net.sf.basedb.core.query.Orders;
     26import net.sf.basedb.core.query.Restrictions;
     27import net.sf.basedb.reggie.Reggie;
    2028import net.sf.basedb.reggie.dao.Annotationtype;
    2129import net.sf.basedb.reggie.dao.Datafiletype;
     
    3745  private final ScriptWriter scriptWriter;
    3846  private final Filter<File> fileFilterStringTie;
     47  private final List<Annotationtype> releaseTypes;
    3948 
    4049  public StringTieWriter(DbControl dc, ReleaseWriterOptions options, ScriptWriter scriptWriter)
     
    4655      "t_data.ctab", "transcript_covered.gtf"
    4756        )), true, new FileLocationFilter(Location.EXTERNAL, true));
     57   
     58    // Load all "STRINGTIE_Release" annotation types
     59    ItemQuery<AnnotationType> query = AnnotationType.getQuery(Item.RAWBIOASSAY);
     60    query.setIncludes(Reggie.INCLUDE_IN_CURRENT_PROJECT);
     61    query.join(Hql.innerJoin("categories", "cat"));
     62    query.restrict(Restrictions.eq(Hql.property("cat", "name"), Expressions.string("STRINGTIE_Release")));
     63    query.order(Orders.asc(Hql.property("name")));
     64    List<AnnotationType> tmp = query.list(dc);
     65   
     66    releaseTypes = new ArrayList<>(tmp.size());
     67    for (AnnotationType at : tmp)
     68    {
     69      releaseTypes.add(Annotationtype.get(at));
     70    }
    4871  }
    4972 
     
    80103      // From the rawbioassay item
    81104      addCommonRawBioAssayAnnotations(item, rba, jsonAnnotations);
     105      for (Annotationtype at : releaseTypes)
     106      {
     107        jsonAnnotations.add(item.getAnnotationJSON(at, rba, null));
     108      }
    82109
    83110      // From the AlignedSequences item
     
    136163    rawFactory.createAnnotationType(Annotationtype.DATA_FILES_FOLDER).setProjectSpecificValues(true);
    137164    rawFactory.createFileType(Datafiletype.GENERIC_RAWDATA, Rawdatatype.STRINGTIE.getPlatformId(), Rawdatatype.STRINGTIE.getVariantId());
    138    
     165
     166    for (Annotationtype at : releaseTypes)
     167    {
     168      CohortAnnotationType cat = rawFactory.createAnnotationType(at);
     169    }
     170
    139171    return rawFactory.allCreated();
    140172  }
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/InstallServlet.java

    r5922 r5928  
    10791079        jsonChecks.add(checkAnnotationTypeCategory(dc, "GEX_Release", "This category is for Cufflinks annotations that should be included in data releases.", createIfMissing));
    10801080        jsonChecks.add(checkAnnotationTypeCategory(dc, "VCALL_Release", "This category is for VariantCall annotations that should be included in data releases.", createIfMissing));
     1081        jsonChecks.add(checkAnnotationTypeCategory(dc, "STRINGTIE_Release", "This category is for StringTie annotations that should be included in data releases.", createIfMissing));
    10811082       
    10821083        // File servers
Note: See TracChangeset for help on using the changeset viewer.