/** * Query to obtain annotated objects by searching for an Annotation with the cvTopic label provided */ public static <T extends AnnotatedObjectImpl> List<T> getContainingAnnotation( Class<T> annObject, String cvshortLabel, String shortLabelLike ) { return getSession().createCriteria( annObject.getClass() ) .add( Restrictions.like( "shortLabel", shortLabelLike ) ) .createCriteria( "annotations" ) .createCriteria( "cvTopic" ) .add( Restrictions.eq( "shortLabel", cvshortLabel ) ).list(); }
/** * Query to obtain annotated objects by searching for an Annotation with the cvTopic label provided */ public static <T extends AnnotatedObjectImpl> List<T> getContainingAnnotation( Class<T> annObject, String cvshortLabel, String shortLabelLike ) { return getSession().createCriteria( annObject.getClass() ) .add( Restrictions.like( "shortLabel", shortLabelLike ) ) .createCriteria( "annotations" ) .createCriteria( "cvTopic" ) .add( Restrictions.eq( "shortLabel", cvshortLabel ) ).list(); }
/** * Query to obtain annotated objects by searching for an Annotation with the cvTopic label provided */ public static <T extends AnnotatedObjectImpl> List<T> getContainingAnnotation( Class<T> annObject, String cvshortLabel, String shortLabelLike ) { return getSession().createCriteria( annObject.getClass() ) .add( Restrictions.like( "shortLabel", shortLabelLike ) ) .createCriteria( "annotations" ) .createCriteria( "cvTopic" ) .add( Restrictions.eq( "shortLabel", cvshortLabel ) ).list(); }
/** * Query to get at the Experiment ACs containing negative interaction annotations */ public static List<Experiment> getExpWithInteractionsContainingAnnotation( String cvshortLabel, String shortLabelLike ) { return getSession().createCriteria( Experiment.class ) .add( Restrictions.like( "shortLabel", shortLabelLike ) ) .createCriteria( "interactions" ) .createCriteria( "annotations" ) .createCriteria( "cvTopic" ) .add( Restrictions.eq( "shortLabel", cvshortLabel ) ).list(); }
/** * Query to get at the Experiment ACs containing negative interaction annotations */ public static List<Experiment> getExpWithInteractionsContainingAnnotation( String cvshortLabel, String shortLabelLike ) { return getSession().createCriteria( Experiment.class ) .add( Restrictions.like( "shortLabel", shortLabelLike ) ) .createCriteria( "interactions" ) .createCriteria( "annotations" ) .createCriteria( "cvTopic" ) .add( Restrictions.eq( "shortLabel", cvshortLabel ) ).list(); }
/** * Query to get at the Experiment ACs containing negative interaction annotations */ public static List<Experiment> getExpWithInteractionsContainingAnnotation( String cvshortLabel, String shortLabelLike ) { return getSession().createCriteria( Experiment.class ) .add( Restrictions.like( "shortLabel", shortLabelLike ) ) .createCriteria( "interactions" ) .createCriteria( "annotations" ) .createCriteria( "cvTopic" ) .add( Restrictions.eq( "shortLabel", cvshortLabel ) ).list(); }
public static Map<String, List<String>> getExperimentAcAndTaxids( String shortLabelLike ) { List<Object[]> expsAndTaxidResults = getSession().createCriteria( Experiment.class ) .add( Restrictions.like( "shortLabel", shortLabelLike ) ) .createAlias( "xrefs", "xref" ) .createAlias( "xref.cvXrefQualifier", "cvXrefQual" ) .add( Restrictions.eq( "cvXrefQual.shortLabel", CvXrefQualifier.TARGET_SPECIES ) ) .setProjection( Projections.projectionList() .add( Projections.distinct( Projections.property( "ac" ) ) ) .add( Projections.property( "xref.primaryId" ) ) ).list(); Map<String, List<String>> expAndTaxid = new HashMap<String, List<String>>(); for ( Object[] expAndTaxidResult : expsAndTaxidResults ) { String expAc = (String) expAndTaxidResult[ 0 ]; String taxId = (String) expAndTaxidResult[ 1 ]; if ( expAndTaxid.containsKey( expAc ) ) { expAndTaxid.get( expAc ).add( taxId ); } else { List<String> taxIds = new ArrayList<String>(); taxIds.add( taxId ); expAndTaxid.put( expAc, taxIds ); } } return expAndTaxid; }
public static Map<String, List<String>> getExperimentAcAndTaxids( String shortLabelLike ) { List<Object[]> expsAndTaxidResults = getSession().createCriteria( Experiment.class ) .add( Restrictions.like( "shortLabel", shortLabelLike ) ) .createAlias( "xrefs", "xref" ) .createAlias( "xref.cvXrefQualifier", "cvXrefQual" ) .add( Restrictions.eq( "cvXrefQual.shortLabel", CvXrefQualifier.TARGET_SPECIES ) ) .setProjection( Projections.projectionList() .add( Projections.distinct( Projections.property( "ac" ) ) ) .add( Projections.property( "xref.primaryId" ) ) ).list(); Map<String, List<String>> expAndTaxid = new HashMap<String, List<String>>(); for ( Object[] expAndTaxidResult : expsAndTaxidResults ) { String expAc = (String) expAndTaxidResult[ 0 ]; String taxId = (String) expAndTaxidResult[ 1 ]; if ( expAndTaxid.containsKey( expAc ) ) { expAndTaxid.get( expAc ).add( taxId ); } else { List<String> taxIds = new ArrayList<String>(); taxIds.add( taxId ); expAndTaxid.put( expAc, taxIds ); } } return expAndTaxid; }
public static Map<String, List<String>> getExperimentAcAndTaxids( String shortLabelLike ) { List<Object[]> expsAndTaxidResults = getSession().createCriteria( Experiment.class ) .add( Restrictions.like( "shortLabel", shortLabelLike ) ) .createAlias( "xrefs", "xref" ) .createAlias( "xref.cvXrefQualifier", "cvXrefQual" ) .add( Restrictions.eq( "cvXrefQual.shortLabel", CvXrefQualifier.TARGET_SPECIES ) ) .setProjection( Projections.projectionList() .add( Projections.distinct( Projections.property( "ac" ) ) ) .add( Projections.property( "xref.primaryId" ) ) ).list(); Map<String, List<String>> expAndTaxid = new HashMap<String, List<String>>(); for ( Object[] expAndTaxidResult : expsAndTaxidResults ) { String expAc = (String) expAndTaxidResult[ 0 ]; String taxId = (String) expAndTaxidResult[ 1 ]; if ( expAndTaxid.containsKey( expAc ) ) { expAndTaxid.get( expAc ).add( taxId ); } else { List<String> taxIds = new ArrayList<String>(); taxIds.add( taxId ); expAndTaxid.put( expAc, taxIds ); } } return expAndTaxid; }
public static Map<String, String> getExperimentAcAndPmid( String shortLabelLike ) { List<Object[]> expsAndPmidResults = getSession().createCriteria( Experiment.class ) .add( Restrictions.like( "shortLabel", shortLabelLike ) ) .createAlias( "xrefs", "xref" ) .createAlias( "xref.cvDatabase", "cvDb" ) .createAlias( "xref.cvXrefQualifier", "cvXrefQual" ) .add( Restrictions.eq( "cvDb.shortLabel", CvDatabase.PUBMED ) ) .add( Restrictions.eq( "cvXrefQual.shortLabel", CvXrefQualifier.PRIMARY_REFERENCE ) ) .setProjection( Projections.projectionList() .add( Projections.distinct( Projections.property( "ac" ) ) ) .add( Projections.property( "xref.primaryId" ) ) ).list(); Map<String, String> expAndPmids = new HashMap<String, String>(); for ( Object[] expAndPmid : expsAndPmidResults ) { String pmid = (String) expAndPmid[ 1 ]; if ( pmid != null ) { expAndPmids.put( (String) expAndPmid[ 0 ], pmid ); } } return expAndPmids; }
public static Map<String, String> getExperimentAcAndPmid( String shortLabelLike ) { List<Object[]> expsAndPmidResults = getSession().createCriteria( Experiment.class ) .add( Restrictions.like( "shortLabel", shortLabelLike ) ) .createAlias( "xrefs", "xref" ) .createAlias( "xref.cvDatabase", "cvDb" ) .createAlias( "xref.cvXrefQualifier", "cvXrefQual" ) .add( Restrictions.eq( "cvDb.shortLabel", CvDatabase.PUBMED ) ) .add( Restrictions.eq( "cvXrefQual.shortLabel", CvXrefQualifier.PRIMARY_REFERENCE ) ) .setProjection( Projections.projectionList() .add( Projections.distinct( Projections.property( "ac" ) ) ) .add( Projections.property( "xref.primaryId" ) ) ).list(); Map<String, String> expAndPmids = new HashMap<String, String>(); for ( Object[] expAndPmid : expsAndPmidResults ) { String pmid = (String) expAndPmid[ 1 ]; if ( pmid != null ) { expAndPmids.put( (String) expAndPmid[ 0 ], pmid ); } } return expAndPmids; }
public static Map<String, String> getExperimentAcAndPmid( String shortLabelLike ) { List<Object[]> expsAndPmidResults = getSession().createCriteria( Experiment.class ) .add( Restrictions.like( "shortLabel", shortLabelLike ) ) .createAlias( "xrefs", "xref" ) .createAlias( "xref.cvDatabase", "cvDb" ) .createAlias( "xref.cvXrefQualifier", "cvXrefQual" ) .add( Restrictions.eq( "cvDb.shortLabel", CvDatabase.PUBMED ) ) .add( Restrictions.eq( "cvXrefQual.shortLabel", CvXrefQualifier.PRIMARY_REFERENCE ) ) .setProjection( Projections.projectionList() .add( Projections.distinct( Projections.property( "ac" ) ) ) .add( Projections.property( "xref.primaryId" ) ) ).list(); Map<String, String> expAndPmids = new HashMap<String, String>(); for ( Object[] expAndPmid : expsAndPmidResults ) { String pmid = (String) expAndPmid[ 1 ]; if ( pmid != null ) { expAndPmids.put( (String) expAndPmid[ 0 ], pmid ); } } return expAndPmids; }
public static Map<String, String> getExperimentAcAndLabelWithoutPubmedId( String shortLabelLike ) { List<Object[]> allExps = getSession().createCriteria( Experiment.class ) .add( Restrictions.like( "shortLabel", shortLabelLike ) ) .setProjection( Projections.projectionList() .add( Projections.distinct( Projections.property( "ac" ) ) ) .add( Projections.property( "shortLabel" ) ) ).list(); Map<String, String> filteredExpsMap = new HashMap<String, String>(); for ( Object[] exp : allExps ) { filteredExpsMap.put( (String) exp[ 0 ], (String) exp[ 1 ] ); } Map<String, String> expsAndPmid = getExperimentAcAndPmid( shortLabelLike ); for ( String expWithPmid : expsAndPmid.keySet() ) { filteredExpsMap.remove( expWithPmid ); } return filteredExpsMap; }
List<Object[]> expWithDataset = getSession().createCriteria( Experiment.class ) .add( Restrictions.like( "shortLabel", shortLabelLike ) ) .createAlias( "annotations", "annot" )
public static Map<String, String> getExperimentAcAndLabelWithoutPubmedId( String shortLabelLike ) { List<Object[]> allExps = getSession().createCriteria( Experiment.class ) .add( Restrictions.like( "shortLabel", shortLabelLike ) ) .setProjection( Projections.projectionList() .add( Projections.distinct( Projections.property( "ac" ) ) ) .add( Projections.property( "shortLabel" ) ) ).list(); Map<String, String> filteredExpsMap = new HashMap<String, String>(); for ( Object[] exp : allExps ) { filteredExpsMap.put( (String) exp[ 0 ], (String) exp[ 1 ] ); } Map<String, String> expsAndPmid = getExperimentAcAndPmid( shortLabelLike ); for ( String expWithPmid : expsAndPmid.keySet() ) { filteredExpsMap.remove( expWithPmid ); } return filteredExpsMap; }
public static Map<String, Integer> countInteractionCountsForExperiments( String shortLabelLike ) { List<Object[]> expWithInteractionsCount = getSession().createCriteria( Experiment.class ) .add( Restrictions.like( "shortLabel", shortLabelLike ) ) .createAlias( "interactions", "int" ) .setProjection( Projections.projectionList() .add( Projections.distinct( Projections.property( "ac" ) ) ) .add( Projections.count( "int.ac" ) ) .add( Projections.groupProperty( "ac" ) ) ).list(); Map<String, Integer> interactionCountByExpAc = new HashMap<String, Integer>(); for ( Object[] expAndIntCount : expWithInteractionsCount ) { interactionCountByExpAc.put( (String) expAndIntCount[ 0 ], (Integer) expAndIntCount[ 1 ] ); } return interactionCountByExpAc; }
public static Map<String, String> getExperimentAcAndLabelWithoutPubmedId( String shortLabelLike ) { List<Object[]> allExps = getSession().createCriteria( Experiment.class ) .add( Restrictions.like( "shortLabel", shortLabelLike ) ) .setProjection( Projections.projectionList() .add( Projections.distinct( Projections.property( "ac" ) ) ) .add( Projections.property( "shortLabel" ) ) ).list(); Map<String, String> filteredExpsMap = new HashMap<String, String>(); for ( Object[] exp : allExps ) { filteredExpsMap.put( (String) exp[ 0 ], (String) exp[ 1 ] ); } Map<String, String> expsAndPmid = getExperimentAcAndPmid( shortLabelLike ); for ( String expWithPmid : expsAndPmid.keySet() ) { filteredExpsMap.remove( expWithPmid ); } return filteredExpsMap; }
List<Object[]> expWithDataset = getSession().createCriteria( Experiment.class ) .add( Restrictions.like( "shortLabel", shortLabelLike ) ) .createAlias( "annotations", "annot" )
public static Map<String, Integer> countInteractionCountsForExperiments( String shortLabelLike ) { List<Object[]> expWithInteractionsCount = getSession().createCriteria( Experiment.class ) .add( Restrictions.like( "shortLabel", shortLabelLike ) ) .createAlias( "interactions", "int" ) .setProjection( Projections.projectionList() .add( Projections.distinct( Projections.property( "ac" ) ) ) .add( Projections.count( "int.ac" ) ) .add( Projections.groupProperty( "ac" ) ) ).list(); Map<String, Integer> interactionCountByExpAc = new HashMap<String, Integer>(); for ( Object[] expAndIntCount : expWithInteractionsCount ) { interactionCountByExpAc.put( (String) expAndIntCount[ 0 ], (Integer) expAndIntCount[ 1 ] ); } return interactionCountByExpAc; }
public static Map<String, Integer> countInteractionCountsForExperiments( String shortLabelLike ) { List<Object[]> expWithInteractionsCount = getSession().createCriteria( Experiment.class ) .add( Restrictions.like( "shortLabel", shortLabelLike ) ) .createAlias( "interactions", "int" ) .setProjection( Projections.projectionList() .add( Projections.distinct( Projections.property( "ac" ) ) ) .add( Projections.count( "int.ac" ) ) .add( Projections.groupProperty( "ac" ) ) ).list(); Map<String, Integer> interactionCountByExpAc = new HashMap<String, Integer>(); for ( Object[] expAndIntCount : expWithInteractionsCount ) { interactionCountByExpAc.put( (String) expAndIntCount[ 0 ], (Integer) expAndIntCount[ 1 ] ); } return interactionCountByExpAc; }