Skip to content

Commit

Permalink
fix(pharmcat): fix NPE when called without -o flag
Browse files Browse the repository at this point in the history
  • Loading branch information
markwoon committed Aug 2, 2023
1 parent 7e794b3 commit a8d5f51
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/main/java/org/pharmgkb/pharmcat/Pipeline.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ public Pipeline(Env env,
m_vcfFile = Objects.requireNonNull(vcfFile);
m_sampleId = sampleId;
generateBasename(baseFilename, vcfFile.getFile(), sampleId, singleSample);
if (m_baseDir == null) {
m_baseDir = m_vcfFile.getFile().getParent();
}
m_matcherJsonFile = m_baseDir.resolve(m_basename + BaseConfig.MATCHER_SUFFIX + ".json");
m_topCandidateOnly = topCandidateOnly;
m_callCyp2d6 = callCyp2d6;
Expand All @@ -121,6 +124,9 @@ public Pipeline(Env env,
throw new IllegalStateException("No phenotyper input file");
}
generateBasename(baseFilename, inputFile, sampleId, singleSample);
if (m_baseDir == null) {
m_baseDir = inputFile.getParent();
}
m_phenotyperJsonFile = m_baseDir.resolve(m_basename + BaseConfig.PHENOTYPER_SUFFIX + ".json");
}

Expand All @@ -135,6 +141,9 @@ public Pipeline(Env env,
throw new IllegalStateException("No reporter input file");
}
generateBasename(baseFilename, inputFile, sampleId, singleSample);
if (m_baseDir == null) {
m_baseDir = inputFile.getParent();
}
m_reporterHtmlFile = m_baseDir.resolve(m_basename + BaseConfig.REPORTER_SUFFIX + ".html");
if (reporterJson) {
m_reporterJsonFile = m_baseDir.resolve(m_basename + BaseConfig.REPORTER_SUFFIX + ".json");
Expand Down Expand Up @@ -219,7 +228,7 @@ public PipelineResult call() throws IOException {
org.pharmgkb.pharmcat.haplotype.model.Result matcherResult = null;
if (m_runMatcher) {
NamedAlleleMatcher namedAlleleMatcher =
new NamedAlleleMatcher(m_env.getDefinitionReader(), m_findCombinations, m_topCandidateOnly, m_callCyp2d6);
new NamedAlleleMatcher(m_env, m_env.getDefinitionReader(), m_findCombinations, m_topCandidateOnly, m_callCyp2d6);
if (!batchDisplayMode) {
namedAlleleMatcher.printWarnings();
}
Expand Down

0 comments on commit a8d5f51

Please sign in to comment.