@Override protected void addParticipant(Participant participant, BinaryInteraction interaction) { if (interaction.getParticipantA() != null){ interaction.setParticipantB(participant); } else { interaction.setParticipantA(participant); } } }
/** * Writes a binary interaction. * Does not write any extended properties from participants, interaction and features * This method will write empty columns for interaction detection method, publication author and identifier, * source and confidences. * It will also ignore experimental roles, host organism, interaction parameters and participant identification methods * @param interaction * @throws MIIOException */ public void write(T interaction) throws MIIOException { if (!isInitialised){ throw new IllegalStateException("The mitab writer was not initialised. The options for the Mitab25Writer should contain at least "+ InteractionWriterOptions.OUTPUT_OPTION_KEY + " to know where to write the interactions."); } try{ P A = (P) interaction.getParticipantA(); P B = (P) interaction.getParticipantB(); writeBinary(interaction, A, B); } catch (IOException e) { throw new MIIOException("Impossible to write " +interaction.toString(), e); } }