final static private String INPUT_GENOMES_FILE_OPTION = "genomes";
final static private String INPUT_SPECIES_TREE_OPTION = "species_tree";
final static private String SEQ_EXTRACT_OPTION = "prot_extract";
- final static private String PRG_VERSION = "2.301";
- final static private String PRG_DATE = "130712";
+ final static private String PRG_VERSION = "2.302";
+ final static private String PRG_DATE = "130715";
final static private String E_MAIL = "czmasek@burnham.org";
final static private String WWW = "https://sites.google.com/site/cmzmasek/home/software/forester/surfacing";
final static private boolean IGNORE_DUFS_DEFAULT = true;
+ new java.text.SimpleDateFormat( "yyyy.MM.dd HH:mm:ss" ).format( new java.util.Date() )
+ "</td></tr>" + nl );
html_desc.append( "</table>" + nl );
+ final Writer simple_tab_writer = new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR
+ + my_outfile + ".tsv" ) );
SurfacingUtil.writeDomainSimilaritiesToFile( html_desc,
new StringBuilder( number_of_genomes + " genomes" ),
+ simple_tab_writer,
writer,
split_writers,
similarities,
scoring,
true,
tax_code_to_id_map );
+ simple_tab_writer.close();
ForesterUtil.programMessage( surfacing.PRG_NAME, "Wrote main output (includes domain similarities) to: \""
+ ( out_dir == null ? my_outfile : out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile ) + "\"" );
}
: out_dir + ForesterUtil.FILE_SEPARATOR + pairwise_similarities_output_file_str ) );
SurfacingUtil.writeDomainSimilaritiesToFile( html_desc,
new StringBuilder( species_i + "-" + species_j ),
+ null,
writer,
null,
similarities,
sb.append( species.getSpeciesId() );
}
if ( getDetaildness() != DomainSimilarityCalculator.Detailedness.BASIC ) {
- sb.append( ":" );
+ if ( html ) {
+ sb.append( ":" );
+ }
+ else {
+ sb.append( "\t" );
+ }
sb.append( getSpeciesData().get( species ).toStringBuffer( getDetaildness(), html ) );
}
if ( html ) {
sb.append( "<br>" );
}
else {
- sb.append( PrintableDomainSimilarity.SPECIES_SEPARATOR );
+ sb.append( "\n\t" );
}
}
private StringBuffer toStringBufferSimpleTabDelimited() {
final StringBuffer sb = new StringBuffer();
sb.append( getDomainId() );
+ sb.append( "\t" );
+ sb.append( getSpeciesDataInAlphabeticalOrder( false, null ) );
+ sb.append( "\n" );
return sb;
}
public StringBuffer toStringBuffer( final DomainSimilarityCalculator.Detailedness detailedness, final boolean html ) {
final StringBuffer sb = new StringBuffer();
if ( detailedness == DomainSimilarityCalculator.Detailedness.PUNCTILIOUS ) {
- sb.append( " " );
+ if ( html ) {
+ sb.append( " " );
+ }
sb.append( getKeyDomainDomainsCount() );
- sb.append( ", " );
- sb.append( getKeyDomainProteinsCount() );
- sb.append( ", " );
- sb.append( getCombinableDomainsCount() );
- if ( !getCombinableDomainIdToCountsMap().isEmpty() ) {
- sb.append( ":" );
+ if ( html ) {
+ sb.append( ", " );
}
- }
- final Set<String> ids = getCombinableDomainIdToCountsMap().keySet();
- int i = 0;
- for( final String domain_id : ids ) {
- ++i;
- sb.append( " " );
+ else {
+ sb.append( "\t" );
+ }
+ sb.append( getKeyDomainProteinsCount() );
if ( html ) {
- sb.append( "<a href=\"" + SurfacingConstants.PFAM_FAMILY_ID_LINK + domain_id + "\">" + domain_id
- + "</a>" );
+ sb.append( ", " );
}
else {
- sb.append( domain_id );
+ sb.append( "\t" );
}
- if ( detailedness == DomainSimilarityCalculator.Detailedness.PUNCTILIOUS ) {
+ sb.append( getCombinableDomainsCount() );
+ if ( html && !getCombinableDomainIdToCountsMap().isEmpty() ) {
sb.append( ":" );
- sb.append( getCombinableDomainIdToCountsMap().get( domain_id ) );
}
}
- sb.append( " [" );
- boolean first = true;
- for( final String p : getKeyDomainProteins() ) {
- final String link = obtainSeqLink( p );
- if ( first ) {
- first = false;
+ if ( html ) {
+ final Set<String> ids = getCombinableDomainIdToCountsMap().keySet();
+ int i = 0;
+ for( final String domain_id : ids ) {
+ ++i;
+ sb.append( " " );
+ if ( html ) {
+ sb.append( "<a href=\"" + SurfacingConstants.PFAM_FAMILY_ID_LINK + domain_id + "\">" + domain_id
+ + "</a>" );
+ }
+ else {
+ sb.append( domain_id );
+ }
+ if ( detailedness == DomainSimilarityCalculator.Detailedness.PUNCTILIOUS ) {
+ sb.append( ":" );
+ sb.append( getCombinableDomainIdToCountsMap().get( domain_id ) );
+ }
}
- else {
- sb.append( ", " );
+ sb.append( " [" );
+ boolean first = true;
+ for( final String p : getKeyDomainProteins() ) {
+ final String link = obtainSeqLink( p );
+ if ( first ) {
+ first = false;
+ }
+ else {
+ sb.append( ", " );
+ }
+ sb.append( link );
}
- sb.append( link );
+ sb.append( "]" );
}
- sb.append( "]" );
return sb;
}
import org.forester.species.Species;
import org.forester.surfacing.DomainSimilarityCalculator.Detailedness;
import org.forester.surfacing.GenomeWideCombinableDomains.GenomeWideCombinableDomainsSortOrder;
+import org.forester.surfacing.PrintableDomainSimilarity.PRINT_OPTION;
import org.forester.util.AsciiHistogram;
import org.forester.util.BasicDescriptiveStatistics;
import org.forester.util.BasicTable;
public static void writeDomainSimilaritiesToFile( final StringBuilder html_desc,
final StringBuilder html_title,
+ final Writer simple_tab_writer,
final Writer single_writer,
Map<Character, Writer> split_writers,
final SortedSet<DomainSimilarity> similarities,
if ( ( species_order != null ) && !species_order.isEmpty() ) {
( ( PrintableDomainSimilarity ) similarity ).setSpeciesOrder( species_order );
}
+ if ( simple_tab_writer != null ) {
+ simple_tab_writer.write( similarity.toStringBuffer( PRINT_OPTION.SIMPLE_TAB_DELIMITED,
+ tax_code_to_id_map ).toString() );
+ }
if ( single_writer != null ) {
single_writer.write( similarity.toStringBuffer( print_option, tax_code_to_id_map ).toString() );
single_writer.write( SurfacingConstants.NL );