Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions gortools/src/main/scala/gorsat/Analysis/ForkWrite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ case class ForkWrite(forkCol: Int,
header = headerBuilder.toString
}

override def isTypeInformationMaintained: Boolean = true

/**
* Creates OutFile with given name
* if the path is a directory save a file with generated md5 sum as name under directory
Expand Down
4 changes: 1 addition & 3 deletions gortools/src/main/scala/gorsat/Commands/Write.scala
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ class Write extends CommandInfo("WRITE",
throw new GorParsingException("Option -noheader (skip header) is not valid with gor/gorz/nor/norz")
}

val fixedHeader = forcedInputHeader.split("\t").slice(0, 2).mkString("\t")

CommandParsingResult(
ForkWrite(forkCol,
fileName,
Expand All @@ -146,7 +144,7 @@ class Write extends CommandInfo("WRITE",
maxseg = maxseg
)
),
fixedHeader
forcedInputHeader
)
}
}
2 changes: 1 addition & 1 deletion gortools/src/test/java/gorsat/UTestGorWrite.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public void testGorWriteColumnNumber() {
tmpfile.toFile().deleteOnExit();
String query = "gor ../tests/data/gor/genes.gorz | write -m " + tmpfile.toAbsolutePath().normalize();
String headerRes = TestUtils.runGorPipe(query);
Assert.assertEquals("", "Chrom\tgene_start\n", headerRes);
Assert.assertEquals("", "Chrom\tgene_start\tgene_end\tGene_Symbol\n", headerRes);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void testRowCountAndBytesCountForSelfWriting() {
}
}

assertEquals("", statsMonitor.getHeader());
assertEquals("chrom\tpos\ta", statsMonitor.getHeader());
assertEquals(0, statsMonitor.rowCount());
assertEquals(0, statsMonitor.bytesCount());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public DbConnection lookup(String source) {
* @throws IOException
*/
@SuppressWarnings("WeakerAccess") // Used from gor-services
public void initializeDbSources(String credpath) throws ClassNotFoundException, IOException {
public void initializeDbSources(String credpath) throws IOException {
clearDbSources();
if (credpath != null && credpath.trim().length() > 0) {
final Path path = Paths.get(credpath);
Expand All @@ -62,7 +62,12 @@ public void initializeDbSources(String credpath) throws ClassNotFoundException,
List<String[]> partsList = parseLinesForDbSourceInstallation(credpath, lines);

for (String[] parts : partsList) {
installDbSourceFromParts(parts);
try {
installDbSourceFromParts(parts);
} catch (ClassNotFoundException e) {
log.error("Failed to load driver class {} for db source {}. Please ensure the driver is in the classpath.",
parts[1], parts[0], e);
}
}
} else {
log.info("No db credential path specified");
Expand Down
Loading