Codota Logo
ExperimentListGeneratorDao
Code IndexAdd Codota to your IDE (free)

How to use
ExperimentListGeneratorDao
in
uk.ac.ebi.intact.application.dataConversion.dao

Best Java code snippets using uk.ac.ebi.intact.application.dataConversion.dao.ExperimentListGeneratorDao (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: uk.ac.ebi.intact.dataexchange.psimi.legacy/data-conversion

private int interactionsForExperiment( String experimentAc ) {
  if ( interactionCount == null ) {
    interactionCount = ExperimentListGeneratorDao.countInteractionCountsForExperiments( searchPattern );
  }
  if ( experimentAc == null ) {
    throw new NullPointerException( "Experiment AC is null" );
  }
  if ( interactionCount.containsKey( experimentAc ) ) {
    return interactionCount.get( experimentAc );
  }
  return 0;
}
origin: uk.ac.ebi.intact.util/data-conversion

private Collection<SimpleDataset> datasetForExperiment( String experimentAc ) {
  if ( experiment2dataset == null ) {
    experiment2dataset = ExperimentListGeneratorDao.datasetForExperiments( searchPattern );
  }
  if ( experimentAc == null ) {
    throw new NullPointerException( "Experiment AC is null" );
  }
  if ( experiment2dataset.containsKey( experimentAc ) ) {
    return experiment2dataset.get( experimentAc );
  }
  return null;
}
origin: uk.ac.ebi.intact.app/data-conversion

/**
 * Checks for a negative interaction. NB This will have to be done using SQL otherwise we end up materializing all
 * interactions just to do the check.
 * <p/>
 * Also the new intact curation rules specify that an Experiment should ONLY contain negative Interactions if it is
 * annotated as 'negative'. Thus to decide if an Experiment is classified as 'negative', the Annotations of that
 * Experiment need to be checked for one with a 'negative' Controlled Vocab attached to it as a topic. </p>
 * <p/>
 * However at some point in the future there may be a possibility that only the Interactions will be marked as
 * 'negative' (not the Experiment), and so these should be checked also, with duplicate matches being ignored. </p>
 * This method has to be static because it is called by the static 'classifyExperiments'.
 */
private void classifyNegatives() {
  negativeExperiments = new HashSet<Experiment>();
  negativeExperiments.addAll( ExperimentListGeneratorDao.getExpWithInteractionsContainingAnnotation( CvTopic.NEGATIVE, searchPattern ) );
  negativeExperiments.addAll( ExperimentListGeneratorDao.getContainingAnnotation( Experiment.class, CvTopic.NEGATIVE, searchPattern ) );
  log.debug( negativeExperiments.size() + " negative experiment found." );
}
origin: uk.ac.ebi.intact.dataexchange.psimi.legacy/data-conversion

/**
 * 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();
}
origin: uk.ac.ebi.intact.util/data-conversion

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;
}
origin: uk.ac.ebi.intact.util/data-conversion

private List<String> taxIdsForExperiment( String experimentAc ) {
  if ( expAcToTaxid == null ) {
    expAcToTaxid = ExperimentListGeneratorDao.getExperimentAcAndTaxids( searchPattern );
  }
  return expAcToTaxid.get( experimentAc );
}
origin: uk.ac.ebi.intact.util/data-conversion

public Set<String> getFilteredExperimentAcs() {
  if ( filteredExperimentAcs != null ) {
    return filteredExperimentAcs;
  }
  if ( !onlyWithPmid ) {
    filteredExperimentAcs = Collections.EMPTY_SET;
  } else {
    filteredExperimentAcs = new HashSet<String>();
    Map<String, String> expAcAndLabels = ExperimentListGeneratorDao.getExperimentAcAndLabelWithoutPubmedId( searchPattern );
    for ( Map.Entry<String, String> expAcAndLabel : expAcAndLabels.entrySet() ) {
      String ac = expAcAndLabel.getKey();
      String shortlabel = expAcAndLabel.getValue();
      output.println( "Filter out: " + shortlabel + " (" + ac + ")" );
      filteredExperimentAcs.add( ac );
    }
    output.println( filteredExperimentAcs.size() + " experiment filtered out." );
  }
  return filteredExperimentAcs;
}
origin: uk.ac.ebi.intact.util/data-conversion

/**
 * Fetch publication primaryId from experiment.
 *
 * @param experimentAc the experiment AC for which we want the primary pubmed ID.
 *
 * @return a pubmed Id or null if none found.
 */
private String getPubmedId( String experimentAc ) {
  if ( expAcToPmid == null ) {
    // map all exps to pmid
    expAcToPmid = ExperimentListGeneratorDao.getExperimentAcAndPmid( searchPattern );
  }
  String pubmedId = expAcToPmid.get( experimentAc );
  if ( pubmedId == null ) {
    experimentsWithErrors.put( experimentAc, "Null pubmed Id" );
  }
  try {
    Integer.parseInt( pubmedId );
  }
  catch ( NumberFormatException e ) {
    experimentsWithErrors.put( experimentAc, "Not a number pubmedId" );
  }
  return pubmedId;
}
origin: uk.ac.ebi.intact.app/data-conversion

/**
 * 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();
}
origin: uk.ac.ebi.intact.app/data-conversion

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;
}
origin: uk.ac.ebi.intact.dataexchange.psimi.legacy/data-conversion

private List<String> taxIdsForExperiment( String experimentAc ) {
  if ( expAcToTaxid == null ) {
    expAcToTaxid = ExperimentListGeneratorDao.getExperimentAcAndTaxids( searchPattern );
  }
  return expAcToTaxid.get( experimentAc );
}
origin: uk.ac.ebi.intact.app/data-conversion

public Set<String> getFilteredExperimentAcs() {
  if ( filteredExperimentAcs != null ) {
    return filteredExperimentAcs;
  }
  if ( !onlyWithPmid ) {
    filteredExperimentAcs = Collections.EMPTY_SET;
  } else {
    filteredExperimentAcs = new HashSet<String>();
    Map<String, String> expAcAndLabels = ExperimentListGeneratorDao.getExperimentAcAndLabelWithoutPubmedId( searchPattern );
    for ( Map.Entry<String, String> expAcAndLabel : expAcAndLabels.entrySet() ) {
      String ac = expAcAndLabel.getKey();
      String shortlabel = expAcAndLabel.getValue();
      log.debug( "Filter out: " + shortlabel + " (" + ac + ")" );
      filteredExperimentAcs.add( ac );
    }
    log.debug( filteredExperimentAcs.size() + " experiment filtered out." );
  }
  return filteredExperimentAcs;
}
origin: uk.ac.ebi.intact.dataexchange.psimi.legacy/data-conversion

/**
 * Fetch publication primaryId from experiment.
 *
 * @param experimentAc the experiment AC for which we want the primary pubmed ID.
 *
 * @return a pubmed Id or null if none found.
 */
private String getPubmedId( String experimentAc ) {
  if ( expAcToPmid == null ) {
    // map all exps to pmid
    expAcToPmid = ExperimentListGeneratorDao.getExperimentAcAndPmid( searchPattern );
  }
  String pubmedId = expAcToPmid.get( experimentAc );
  if ( pubmedId == null ) {
    experimentsWithErrors.put( experimentAc, "Null pubmed Id" );
  }
  try {
    Integer.parseInt( pubmedId );
  }
  catch ( NumberFormatException e ) {
    experimentsWithErrors.put( experimentAc, "Not a number pubmedId" );
  }
  return pubmedId;
}
origin: uk.ac.ebi.intact.util/data-conversion

/**
 * 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();
}
origin: uk.ac.ebi.intact.dataexchange.psimi.legacy/data-conversion

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;
}
origin: uk.ac.ebi.intact.dataexchange.psimi.legacy/data-conversion

/**
 * Checks for a negative interaction. NB This will have to be done using SQL otherwise we end up materializing all
 * interactions just to do the check.
 * <p/>
 * Also the new intact curation rules specify that an Experiment should ONLY contain negative Interactions if it is
 * annotated as 'negative'. Thus to decide if an Experiment is classified as 'negative', the Annotations of that
 * Experiment need to be checked for one with a 'negative' Controlled Vocab attached to it as a topic. </p>
 * <p/>
 * However at some point in the future there may be a possibility that only the Interactions will be marked as
 * 'negative' (not the Experiment), and so these should be checked also, with duplicate matches being ignored. </p>
 * This method has to be static because it is called by the static 'classifyExperiments'.
 */
private void classifyNegatives() {
  negativeExperiments = new HashSet<Experiment>();
  negativeExperiments.addAll( ExperimentListGeneratorDao.getExpWithInteractionsContainingAnnotation( CvTopic.NEGATIVE, searchPattern ) );
  negativeExperiments.addAll( ExperimentListGeneratorDao.getContainingAnnotation( Experiment.class, CvTopic.NEGATIVE, searchPattern ) );
  output.println( negativeExperiments.size() + " negative experiment found." );
}
origin: uk.ac.ebi.intact.app/data-conversion

private Collection<SimpleDataset> datasetForExperiment( String experimentAc ) {
  if ( experiment2dataset == null ) {
    experiment2dataset = ExperimentListGeneratorDao.datasetForExperiments( searchPattern );
  }
  if ( experimentAc == null ) {
    throw new NullPointerException( "Experiment AC is null" );
  }
  if ( experiment2dataset.containsKey( experimentAc ) ) {
    return experiment2dataset.get( experimentAc );
  }
  return null;
}
origin: uk.ac.ebi.intact.app/data-conversion

private List<String> taxIdsForExperiment( String experimentAc ) {
  if ( expAcToTaxid == null ) {
    expAcToTaxid = ExperimentListGeneratorDao.getExperimentAcAndTaxids( searchPattern );
  }
  return expAcToTaxid.get( experimentAc );
}
origin: uk.ac.ebi.intact.app/data-conversion

private int interactionsForExperiment( String experimentAc ) {
  if ( interactionCount == null ) {
    interactionCount = ExperimentListGeneratorDao.countInteractionCountsForExperiments( searchPattern );
  }
  if ( experimentAc == null ) {
    throw new NullPointerException( "Experiment AC is null" );
  }
  if ( interactionCount.containsKey( experimentAc ) ) {
    return interactionCount.get( experimentAc );
  }
  return 0;
}
origin: uk.ac.ebi.intact.dataexchange.psimi.legacy/data-conversion

public Set<String> getFilteredExperimentAcs() {
  if ( filteredExperimentAcs != null ) {
    return filteredExperimentAcs;
  }
  if ( !onlyWithPmid ) {
    filteredExperimentAcs = Collections.EMPTY_SET;
  } else {
    filteredExperimentAcs = new HashSet<String>();
    Map<String, String> expAcAndLabels = ExperimentListGeneratorDao.getExperimentAcAndLabelWithoutPubmedId( searchPattern );
    for ( Map.Entry<String, String> expAcAndLabel : expAcAndLabels.entrySet() ) {
      String ac = expAcAndLabel.getKey();
      String shortlabel = expAcAndLabel.getValue();
      output.println( "Filter out: " + shortlabel + " (" + ac + ")" );
      filteredExperimentAcs.add( ac );
    }
    output.println( filteredExperimentAcs.size() + " experiment filtered out." );
  }
  return filteredExperimentAcs;
}
uk.ac.ebi.intact.application.dataConversion.daoExperimentListGeneratorDao

Javadoc

TODO: comment this!

Most used methods

  • countInteractionCountsForExperiments
  • datasetForExperiments
    Retreives experiment ahving assiciated dataset annotation.
  • getContainingAnnotation
    Query to obtain annotated objects by searching for an Annotation with the cvTopic label provided
  • getExpWithInteractionsContainingAnnotation
    Query to get at the Experiment ACs containing negative interaction annotations
  • getExperimentAcAndLabelWithoutPubmedId
  • getExperimentAcAndPmid
  • getExperimentAcAndTaxids
  • getSession

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (Timer)
  • setContentView (Activity)
  • startActivity (Activity)
  • ObjectMapper (com.fasterxml.jackson.databind)
    This mapper (or, data binder, or codec) provides functionality for converting between Java objects (
  • InputStreamReader (java.io)
    An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes
  • PriorityQueue (java.util)
    An unbounded priority Queue based on a priority heap. The elements of the priority queue are ordered
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Runner (org.openjdk.jmh.runner)
  • Option (scala)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now