public ExpressedInTag( final AnnotationTag annotation ) { if ( !Constants.EXPRESSED_IN.equalsIgnoreCase( annotation.getType() ) ) { throw new IllegalArgumentException( "You can only create an ExpressedInTag out of an AnnotationTag having " + Constants.EXPRESSED_IN + " as type." ); } String text = annotation.getText(); int index = text.indexOf( ':' ); String id = null; String shortlabel = null; if ( index == -1 ) { throw new IllegalArgumentException( "You can only create an ExpressedInTag out of an AnnotationTag having its text formatted as follow:" + "<proteinInteractorID>:<biosourceShortlabel>" ); } else { id = text.substring( 0, index ); if ( id == null || "".equals( id ) ) { throw new IllegalArgumentException( "You can only create an ExpressedInTag out of an AnnotationTag having its text formatted as follow:" + "<proteinInteractorID>:<biosourceShortlabel>. the id is missing." ); } shortlabel = text.substring( index + 1, text.length() ); if ( shortlabel == null || "".equals( shortlabel ) ) { throw new IllegalArgumentException( "You can only create an ExpressedInTag out of an AnnotationTag having its text formatted as follow:" + "<proteinInteractorID>:<biosourceShortlabel>. the shortlabel is missing" ); } } this.proteinInteractorID = id; this.bioSourceShortlabel = shortlabel; }
public ExpressedInTag( final AnnotationTag annotation ) { if ( !Constants.EXPRESSED_IN.equalsIgnoreCase( annotation.getType() ) ) { throw new IllegalArgumentException( "You can only create an ExpressedInTag out of an AnnotationTag having " + Constants.EXPRESSED_IN + " as type." ); } String text = annotation.getText(); int index = text.indexOf( ':' ); String id = null; String shortlabel = null; if ( index == -1 ) { throw new IllegalArgumentException( "You can only create an ExpressedInTag out of an AnnotationTag having its text formatted as follow:" + "<proteinInteractorID>:<biosourceShortlabel>" ); } else { id = text.substring( 0, index ); if ( id == null || "".equals( id ) ) { throw new IllegalArgumentException( "You can only create an ExpressedInTag out of an AnnotationTag having its text formatted as follow:" + "<proteinInteractorID>:<biosourceShortlabel>. the id is missing." ); } shortlabel = text.substring( index + 1, text.length() ); if ( shortlabel == null || "".equals( shortlabel ) ) { throw new IllegalArgumentException( "You can only create an ExpressedInTag out of an AnnotationTag having its text formatted as follow:" + "<proteinInteractorID>:<biosourceShortlabel>. the shortlabel is missing" ); } } this.proteinInteractorID = id; this.bioSourceShortlabel = shortlabel; }
public ExpressedInTag( final AnnotationTag annotation ) { if ( !Constants.EXPRESSED_IN.equalsIgnoreCase( annotation.getType() ) ) { throw new IllegalArgumentException( "You can only create an ExpressedInTag out of an AnnotationTag having " + Constants.EXPRESSED_IN + " as type." ); } String text = annotation.getText(); int index = text.indexOf( ':' ); String id = null; String shortlabel = null; if ( index == -1 ) { throw new IllegalArgumentException( "You can only create an ExpressedInTag out of an AnnotationTag having its text formatted as follow:" + "<proteinInteractorID>:<biosourceShortlabel>" ); } else { id = text.substring( 0, index ); if ( id == null || "".equals( id ) ) { throw new IllegalArgumentException( "You can only create an ExpressedInTag out of an AnnotationTag having its text formatted as follow:" + "<proteinInteractorID>:<biosourceShortlabel>. the id is missing." ); } shortlabel = text.substring( index + 1, text.length() ); if ( shortlabel == null || "".equals( shortlabel ) ) { throw new IllegalArgumentException( "You can only create an ExpressedInTag out of an AnnotationTag having its text formatted as follow:" + "<proteinInteractorID>:<biosourceShortlabel>. the shortlabel is missing" ); } } this.proteinInteractorID = id; this.bioSourceShortlabel = shortlabel; }
/** * Search in IntAct for an Annotation having the a specific type and annotationText. * * @param annotationTag the description of the Annotation we are looking for. * * @return the found Annotation or null if not found. * * @throws IntactException */ private static Annotation searchIntactAnnotation( final AnnotationTag annotationTag ) throws IntactException { Annotation annotation = null; final String text = annotationTag.getText(); Collection annotations = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getAnnotationDao().getByTextLike(text); for ( Iterator iterator = annotations.iterator(); iterator.hasNext() && annotation == null; ) { Annotation anAnnotation = (Annotation) iterator.next(); if ( annotationTag.getType().equals( anAnnotation.getCvTopic().getShortLabel() ) ) { annotation = anAnnotation; } } return annotation; }
/** * Search in IntAct for an Annotation having the a specific type and annotationText. * * @param annotationTag the description of the Annotation we are looking for. * * @return the found Annotation or null if not found. * * @throws IntactException */ private static Annotation searchIntactAnnotation( final AnnotationTag annotationTag ) throws IntactException { Annotation annotation = null; final String text = annotationTag.getText(); Collection annotations = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getAnnotationDao().getByTextLike(text); for ( Iterator iterator = annotations.iterator(); iterator.hasNext() && annotation == null; ) { Annotation anAnnotation = (Annotation) iterator.next(); if ( annotationTag.getType().equals( anAnnotation.getCvTopic().getShortLabel() ) ) { annotation = anAnnotation; } } return annotation; }
/** * Search in IntAct for an Annotation having the a specific type and annotationText. * * @param annotationTag the description of the Annotation we are looking for. * * @return the found Annotation or null if not found. * * @throws IntactException */ private static Annotation searchIntactAnnotation( final AnnotationTag annotationTag ) throws IntactException { Annotation annotation = null; final String text = annotationTag.getText(); Collection annotations = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getAnnotationDao().getByTextLike(text); for ( Iterator iterator = annotations.iterator(); iterator.hasNext() && annotation == null; ) { Annotation anAnnotation = (Annotation) iterator.next(); if ( annotationTag.getType().equals( anAnnotation.getCvTopic().getShortLabel() ) ) { annotation = anAnnotation; } } return annotation; }
/** * Search in IntAct for an Annotation having the a specific type and annotationText. * * @param annotationTag the description of the Annotation we are looking for. * * @return the found Annotation or null if not found. * * @throws IntactException */ private static Annotation searchIntactAnnotation( final AnnotationTag annotationTag ) throws IntactException { final String text = annotationTag.getText(); Collection annotations = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getAnnotationDao().getByTextLike(text); Annotation annotation = null; if ( annotations != null ) { for ( Iterator iterator = annotations.iterator(); iterator.hasNext() && annotation == null; ) { Annotation anAnnotation = (Annotation) iterator.next(); if ( annotationTag.getType().equals( anAnnotation.getCvTopic().getShortLabel() ) ) { annotation = anAnnotation; } } } return annotation; } }
/** * Search in IntAct for an Annotation having the a specific type and annotationText. * * @param annotationTag the description of the Annotation we are looking for. * * @return the found Annotation or null if not found. * * @throws IntactException */ private static Annotation searchIntactAnnotation( final AnnotationTag annotationTag ) throws IntactException { final String text = annotationTag.getText(); Collection annotations = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getAnnotationDao().getByTextLike(text); Annotation annotation = null; if ( annotations != null ) { for ( Iterator iterator = annotations.iterator(); iterator.hasNext() && annotation == null; ) { Annotation anAnnotation = (Annotation) iterator.next(); if ( annotationTag.getType().equals( anAnnotation.getCvTopic().getShortLabel() ) ) { annotation = anAnnotation; } } } return annotation; } }
/** * Search in IntAct for an Annotation having the a specific type and annotationText. * * @param annotationTag the description of the Annotation we are looking for. * * @return the found Annotation or null if not found. * * @throws IntactException */ private static Annotation searchIntactAnnotation( final AnnotationTag annotationTag ) throws IntactException { final String text = annotationTag.getText(); Collection annotations = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getAnnotationDao().getByTextLike(text); Annotation annotation = null; if ( annotations != null ) { for ( Iterator iterator = annotations.iterator(); iterator.hasNext() && annotation == null; ) { Annotation anAnnotation = (Annotation) iterator.next(); if ( annotationTag.getType().equals( anAnnotation.getCvTopic().getShortLabel() ) ) { annotation = anAnnotation; } } } return annotation; } }
public static void check( final AnnotationTag annotation ) { final String type = annotation.getType();
public static void check( final AnnotationTag annotation ) { final String type = annotation.getType();
if ( Constants.EXPRESSED_IN.equalsIgnoreCase( annotation.getType() ) ) {
if ( Constants.EXPRESSED_IN.equalsIgnoreCase( annotation.getType() ) ) {
public static void check( final AnnotationTag annotation ) { final String type = annotation.getType();
for ( Iterator iterator2 = annotations.iterator(); iterator2.hasNext(); ) { final AnnotationTag annotationTag = (AnnotationTag) iterator2.next(); final CvTopic cvTopic = AnnotationChecker.getCvTopic( annotationTag.getType() );
for ( Iterator iterator2 = annotations.iterator(); iterator2.hasNext(); ) { final AnnotationTag annotationTag = (AnnotationTag) iterator2.next(); final CvTopic cvTopic = AnnotationChecker.getCvTopic( annotationTag.getType() );
for ( Iterator iterator2 = annotations.iterator(); iterator2.hasNext(); ) { final AnnotationTag annotationTag = (AnnotationTag) iterator2.next(); final CvTopic cvTopic = AnnotationChecker.getCvTopic( annotationTag.getType() );
for ( Iterator iterator = annotations.iterator(); iterator.hasNext(); ) { final AnnotationTag annotationTag = (AnnotationTag) iterator.next(); final CvTopic cvTopic = AnnotationChecker.getCvTopic( annotationTag.getType() );
for ( Iterator iterator = annotations.iterator(); iterator.hasNext(); ) { final AnnotationTag annotationTag = (AnnotationTag) iterator.next(); final CvTopic cvTopic = AnnotationChecker.getCvTopic( annotationTag.getType() );
for ( Iterator iterator = annotations.iterator(); iterator.hasNext(); ) { final AnnotationTag annotationTag = (AnnotationTag) iterator.next(); final CvTopic cvTopic = AnnotationChecker.getCvTopic( annotationTag.getType() );