public void setBinaryInteractionIterator(File file, boolean hasHeader) throws ClusterServiceException { final InputStream inputStream; try { inputStream = new FileInputStream(file); } catch (FileNotFoundException e) { throw new ClusterServiceException( "No file found", e ); } setBinaryInteractionIterator(inputStream, hasHeader); }
public void setBinaryInteractionIterator(File[] files, boolean hasHeader) throws ClusterServiceException { List<InputStream> streams = new ArrayList<InputStream>( ); for(File file:files){ try { streams.add( new FileInputStream( file ) ); } catch (FileNotFoundException e) { throw new ClusterServiceException( "No file found", e ); } } final InputStream inputStream; try { inputStream = new CompositeInputStream( streams.iterator() ); } catch (IOException e) { throw new ClusterServiceException( "Input error", e ); } setBinaryInteractionIterator(inputStream, hasHeader); }
public void setBinaryInteractionIterator(InputStream inputStream, boolean hasHeader) throws ClusterServiceException { if ( inputStream != null ) { final PsimiTabReader reader = new PsimiTabReader( ); try { this.binaryInteractionIterator = reader.iterate( inputStream ); } catch ( Exception e ) { throw new ClusterServiceException( "An error occured while read MITAB data", e ); } } }
public void setBinaryInteractionIterator(Reader r, boolean hasHeader) throws ClusterServiceException { if ( r != null ) { final PsimiTabReader reader = new PsimiTabReader( ); try { this.binaryInteractionIterator = reader.iterate( r ); } catch ( Exception e ) { throw new ClusterServiceException( "An error occured while read MITAB data", e ); } } }
public AbstractInteractionCluster( Reader r, boolean hasHeader ) throws ClusterServiceException { if ( r == null ) { throw new IllegalArgumentException( "You must give a non null MITAB Reader" ); } String [] dbNames; if (mappingIdDbNames.contains(",")){ dbNames = mappingIdDbNames.split(","); } else { dbNames = new String [] {mappingIdDbNames}; } this.binary2Encore = new Binary2Encore(dbNames); final PsimiTabReader reader = new PsimiTabReader( ); try { this.binaryInteractionIterator = reader.iterate( r ); } catch ( Exception e ) { throw new ClusterServiceException( "An error occured while read MITAB data", e ); } }