code: protected void writeResultAsSIF(Map<BioPAXElement, List<Match>> matches, OutputStream out,
  		boolean directed, String label1, String label2) throws IOException
  	{
  		if (matches.isEmpty()) return;
  		if (this instanceof SIFMiner)
  		{
  			writeSIFsUsingSIFFramework(matches, out);
  			return;
  		}
  
  		// Memory for already written pairs.
  		Set<String> mem = new HashSet<String>();
  
  		String mid = getRelationType() == null ? "\t" : "\trelation\t";
  
  		OutputStreamWriter writer = new OutputStreamWriter(out);
  		String header = getHeader();
  		writer.write(header  == null ? label1 + mid + label2 : header);
  
  		for (BioPAXElement ele : matches.keySet())
  		{
  			for (Match m : matches.get(ele))
  			{
  				Set<String> s1 = getIdentifiers(m, label1);
  				Set<String> s2 = getIdentifiers(m, label2);
  
  				for (String s1s : s1)
  				{
  					for (String s2s : s2)
  					{
  						String type = getRelationType();
  						String sep = type == null ? "\t" : "\t" + type + "\t";
  
  						String relation = s1s + sep + s2s;
  						String reverse = s2s + sep + s1s;
  
  						if (!mem.contains(relation) && (directed || !mem.contains(reverse)))
  						{
  							writer.write("\n" + relation);
  							mem.add(relation);
  							if (!directed) mem.add(reverse);
  						}
  					}
  				}
  			}
  		}
  		writer.flush();
  	}
docs: This method writes the output as pairs of gene symbols of the given two ProteinReference.
  Parameters labels have to map to ProteinReference.
  @param matches the search result
  @param out output stream for text output
  @param directed if true, reverse pairs is treated as different pairs
  @param label1 label for the first ProteinReference in the result matches
  @param label2 label for the second ProteinReference in the result matches
  @throws IOException if cannot write to output stream