+ "ENDGROUP\tuniprot\n\n"
+ "desc1\tFER_CAPAN\t-1\t0\t0\tPfam\t1.3\n\n"
+ "desc3\tFER1_SOLLC\t-1\t0\t0\tPfam\n"; // NaN is not output
- assertEquals(expected, exported);
+ assertEquals(
+ expected.replace("\n", System.getProperty("line.separator")),
+ exported);
/*
* set METAL (in uniprot group) and GAMMA-TURN visible, but not Pfam
+ "Turn\tFER_CAPAA\t-1\t36\t38\tGAMMA-TURN\t0.0\n"
+ "Iron\tFER_CAPAA\t-1\t39\t39\tMETAL\t0.0\n"
+ "ENDGROUP\tuniprot\n";
- assertEquals(expected, exported);
+ assertEquals(fixLineEnd(expected), exported);
/*
* now set Pfam visible
// null / empty group features are output after named groups
+ "\ndesc2\tFER_CAPAN\t-1\t4\t9\tPfam\n"
+ "\ndesc4\tFER1_SOLLC\t-1\t5\t8\tPfam\t-2.6\n";
- assertEquals(expected, exported);
+ assertEquals(fixLineEnd(expected), exported);
/*
* hide uniprot group
+ "\ndesc4\tFER1_SOLLC\t-1\t5\t8\tPfam\t-2.6\n";
exported = featuresFile.printJalviewFormat(al.getSequencesArray(), fr,
false);
- assertEquals(expected, exported);
+ assertEquals(fixLineEnd(expected), exported);
/*
* include non-positional (overrides group not shown)
+ "desc2\tFER_CAPAN\t-1\t4\t9\tPfam\n"
+ "\ndesc3\tFER1_SOLLC\t-1\t0\t0\tPfam\n"
+ "desc4\tFER1_SOLLC\t-1\t5\t8\tPfam\t-2.6\n";
- assertEquals(expected, exported);
+ assertEquals(fixLineEnd(expected), exported);
}
@Test(groups = { "Functional" })
String exported = featuresFile.printGffFormat(al.getSequencesArray(),
fr, false);
String gffHeader = "##gff-version 2\n";
- assertEquals(gffHeader, exported);
+ assertEquals(
+ fixLineEnd(gffHeader),
+ exported);
exported = featuresFile.printGffFormat(al.getSequencesArray(), fr,
true);
- assertEquals(gffHeader, exported);
+ assertEquals(
+ fixLineEnd(gffHeader),
+ exported);
/*
* add some features
*/
exported = featuresFile.printGffFormat(al.getSequencesArray(), fr,
false);
- assertEquals(gffHeader, exported);
+ assertEquals(
+ fixLineEnd(gffHeader),
+ exported);
/*
* include non-positional features
true);
String expected = gffHeader
+ "FER_CAPAA\tUniprot\tDomain\t0\t0\t0.0\t.\t.\n";
- assertEquals(expected, exported);
+ assertEquals(
+ fixLineEnd(expected),
+ exported);
/*
* set METAL (in uniprot group) and GAMMA-TURN visible, but not Pfam
false);
// METAL feature has null group: description used for column 2
expected = gffHeader + "FER_CAPAA\tCath\tMETAL\t39\t39\t1.2\t.\t.\n";
- assertEquals(expected, exported);
+ assertEquals(
+ expected.replace("\n", System.getProperty("line.separator")),
+ exported);
/*
* set s3dm group visible
// METAL feature has null group: description used for column 2
expected = gffHeader + "FER_CAPAA\tCath\tMETAL\t39\t39\t1.2\t.\t.\n"
+ "FER_CAPAN\ts3dm\tGAMMA-TURN\t36\t38\t2.1\t.\t.\n";
- assertEquals(expected, exported);
+ assertEquals(
+ expected.replace("\n", System.getProperty("line.separator")),
+ exported);
/*
* now set Pfam visible
+ "FER_CAPAA\tCath\tMETAL\t39\t39\t1.2\t.\t.\n"
+ "FER_CAPAN\ts3dm\tGAMMA-TURN\t36\t38\t2.1\t.\t.\n"
+ "FER_CAPAN\tUniprot\tPfam\t20\t20\t0.0\t+\t2\tx=y;black=white\n";
- assertEquals(expected, exported);
+ assertEquals(
+ expected.replace("\n", System.getProperty("line.separator")),
+ exported);
+ }
+
+ private String fixLineEnd(String s)
+ {
+ return s.replace("\n", System.getProperty("line.separator"));
}
/**
visible.put("foobar", new FeatureColour(Color.blue));
ff.outputFeatureFilters(sb, visible, featureFilters);
String expected = "\nSTARTFILTERS\nfoobar\tLabel Present\npfam\t(CSQ:PolyPhen Present) AND (Score LE -2.4)\nENDFILTERS\n";
- assertEquals(expected, sb.toString());
+ assertEquals(fixLineEnd(expected), sb.toString());
}
/**
String expected = gffHeader
+ "FER_CAPAA\tCath\tMETAL\t39\t39\t1.2\t.\t.\n"
+ "FER_CAPAA\tCath\tMETAL\t41\t41\t0.6\t.\t.\n";
- assertEquals(expected, exported);
+ assertEquals(
+ fixLineEnd(expected), exported);
/*
* now threshold to Score > 1.1 - should exclude sf2
exported = featuresFile.printGffFormat(al.getSequencesArray(), fr,
false);
expected = gffHeader + "FER_CAPAA\tCath\tMETAL\t39\t39\t1.2\t.\t.\n";
- assertEquals(expected, exported);
+ assertEquals(fixLineEnd(expected), exported);
/*
* remove threshold and check sf2 is exported
false);
expected = gffHeader + "FER_CAPAA\tCath\tMETAL\t39\t39\t1.2\t.\t.\n"
+ "FER_CAPAA\tCath\tMETAL\t41\t41\t0.6\t.\t.\n";
- assertEquals(expected, exported);
+ assertEquals(fixLineEnd(expected), exported);
/*
* filter on (clin_sig contains Benign) - should include sf2 and exclude sf1
exported = featuresFile.printGffFormat(al.getSequencesArray(), fr,
false);
expected = gffHeader + "FER_CAPAA\tCath\tMETAL\t41\t41\t0.6\t.\t.\n";
- assertEquals(expected, exported);
+ assertEquals(fixLineEnd(expected), exported);
}
/**
+ "ENDGROUP\tgrp1\n\nSTARTGROUP\tgrp2\n"
+ "Cath\tFER_CAPAA\t-1\t41\t41\tMETAL\t0.6\n"
+ "ENDGROUP\tgrp2\n";
- assertEquals(expected, exported);
+ assertEquals(
+ fixLineEnd(expected),
+ exported);
/*
* now threshold to Score > 1.1 - should exclude sf2
+ "STARTGROUP\tgrp1\n"
+ "Cath\tFER_CAPAA\t-1\t39\t39\tMETAL\t1.2\n"
+ "ENDGROUP\tgrp1\n";
- assertEquals(expected, exported);
+ assertEquals(
+ expected.replace("\n", System.getProperty("line.separator")),
+ exported);
/*
* remove threshold and check sf2 is exported
+ "ENDGROUP\tgrp1\n\nSTARTGROUP\tgrp2\n"
+ "Cath\tFER_CAPAA\t-1\t41\t41\tMETAL\t0.6\n"
+ "ENDGROUP\tgrp2\n";
- assertEquals(expected, exported);
+ assertEquals(fixLineEnd(expected), exported);
/*
* filter on (clin_sig contains Benign) - should include sf2 and exclude sf1
+ "STARTGROUP\tgrp2\n"
+ "Cath\tFER_CAPAA\t-1\t41\t41\tMETAL\t0.6\n"
+ "ENDGROUP\tgrp2\n";
- assertEquals(expected, exported);
+ assertEquals(fixLineEnd(expected), exported);
}
}