/** * Check if the set of proteins is related to more than one biosource. * * @param proteins * * @return true if more than one distinct biosource found, else false. */ private static boolean hasMultipleBioSource( final Collection proteins ) { Set biosources = new HashSet(); for ( Iterator iterator = proteins.iterator(); iterator.hasNext(); ) { Protein protein = (Protein) iterator.next(); BioSource bioSource = protein.getBioSource(); if ( null != bioSource ) { biosources.add( bioSource ); } } boolean answer; if ( biosources.size() > 1 ) { answer = true; } else { answer = false; } return answer; }
/** * Check if the set of proteins is related to more than one biosource. * * @param proteins * * @return true if more than one distinct biosource found, else false. */ private static boolean hasMultipleBioSource( final Collection proteins ) { Set biosources = new HashSet(); for ( Iterator iterator = proteins.iterator(); iterator.hasNext(); ) { Protein protein = (Protein) iterator.next(); BioSource bioSource = protein.getBioSource(); if ( null != bioSource ) { biosources.add( bioSource ); } } boolean answer; if ( biosources.size() > 1 ) { answer = true; } else { answer = false; } return answer; }
/** * Check if the set of proteins is related to more than one biosource. * * @param proteins * * @return true if more than one distinct biosource found, else false. */ private static boolean hasMultipleBioSource( final Collection proteins ) { Set biosources = new HashSet(); for ( Iterator iterator = proteins.iterator(); iterator.hasNext(); ) { Protein protein = (Protein) iterator.next(); BioSource bioSource = protein.getBioSource(); if ( null != bioSource ) { biosources.add( bioSource ); } } boolean answer; if ( biosources.size() > 1 ) { answer = true; } else { answer = false; } return answer; }
/** * Remove from a collection of Protein all those that are not related to the given taxid. * * @param proteins the collection of protein to filter out. * @param taxid the taxid that the returned protein must have (can be null - in which case there is no * filtering). * * @return a new collection of proteins. */ private static Collection filterByTaxid( final Collection proteins, final String taxid ) { if ( taxid == null ) { if ( DEBUG ) { System.out.println( "No taxid specified, returns identical collection" ); } return proteins; } Collection filteredProteins = new ArrayList( proteins.size() ); for ( Iterator iterator = proteins.iterator(); iterator.hasNext(); ) { final Protein protein = (Protein) iterator.next(); if ( taxid.equals( protein.getBioSource().getTaxId() ) ) { filteredProteins.add( protein ); } } return filteredProteins; }
/** * Remove from a collection of Protein all those that are not related to the given taxid. * * @param proteins the collection of protein to filter out. * @param taxid the taxid that the returned protein must have (can be null - in which case there is no * filtering). * * @return a new collection of proteins. */ private static Collection filterByTaxid( final Collection proteins, final String taxid ) { if ( taxid == null ) { if ( DEBUG ) { System.out.println( "No taxid specified, returns identical collection" ); } return proteins; } Collection filteredProteins = new ArrayList( proteins.size() ); for ( Iterator iterator = proteins.iterator(); iterator.hasNext(); ) { final Protein protein = (Protein) iterator.next(); if ( taxid.equals( protein.getBioSource().getTaxId() ) ) { filteredProteins.add( protein ); } } return filteredProteins; }
/** * Remove from a collection of Protein all those that are not related to the given taxid. * * @param proteins the collection of protein to filter out. * @param taxid the taxid that the returned protein must have (can be null - in which case there is no * filtering). * * @return a new collection of proteins. */ private static Collection filterByTaxid( final Collection proteins, final String taxid ) { if ( taxid == null ) { if ( DEBUG ) { System.out.println( "No taxid specified, returns identical collection" ); } return proteins; } Collection filteredProteins = new ArrayList( proteins.size() ); for ( Iterator iterator = proteins.iterator(); iterator.hasNext(); ) { final Protein protein = (Protein) iterator.next(); if ( taxid.equals( protein.getBioSource().getTaxId() ) ) { filteredProteins.add( protein ); } } return filteredProteins; }
if (!protein1.getBioSource().equals(protein2.getBioSource())) { buffer.append(' ').append("(xeno)");
if (!protein1.getBioSource().equals(protein2.getBioSource())) { buffer.append(' ').append("(xeno)");
final BioSource biosource2 = protein2.getBioSource(); if (!protein1.getBioSource().equals( biosource2 )) { buffer.append(" Organism="); buffer.append( biosource2.getFullName() ).append( " [NCBI_TaxID=" ).append( biosource2.getTaxId() ).append( "]" );
BioSource2xmlFactory.getInstance( session ).createOrganism( session, element, protein.getBioSource() );
BioSource2xmlFactory.getInstance( session ).createOrganism( session, element, protein.getBioSource() );
BioSource2xmlFactory.getInstance( session ).createOrganism( session, element, protein.getBioSource() );
BioSource2xmlFactory.getInstance( session ).createOrganism( session, element, protein.getBioSource() );
BioSource2xmlFactory.getInstance( session ).createOrganism( session, element, protein.getBioSource() );
BioSource2xmlFactory.getInstance( session ).createOrganism( session, element, protein.getBioSource() );
for ( Iterator iterator = proteins.iterator(); iterator.hasNext(); ) { Protein protein1 = (Protein) iterator.next(); BioSource biosource = protein1.getBioSource(); sb.append( biosource.getShortLabel() ).append( '(' ); sb.append( biosource.getTaxId() ).append( ')' ).append( ' ' ); for ( Iterator iterator = proteins.iterator(); iterator.hasNext(); ) { Protein protein1 = (Protein) iterator.next(); BioSource biosource = protein1.getBioSource(); sb.append( biosource.getShortLabel() ).append( '(' ); sb.append( biosource.getTaxId() ).append( ')' ).append( ' ' );
if ( protein1.getBioSource().getTaxId().equals( proteinInteractor.getOrganism().getTaxId() ) ) {
tremblEntry = SearchReplace.replace( tremblEntry, NCBI_TAXID, protein.getBioSource().getTaxId() );
if ( protein1.getBioSource().getTaxId().equals( proteinInteractor.getOrganism().getTaxId() ) ) {
if ( protein1.getBioSource().getTaxId().equals( proteinInteractor.getOrganism().getTaxId() ) ) {