-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #640 from TheJacksonLaboratory/update-output-formats
Enhance output formats
- Loading branch information
Showing
6 changed files
with
67 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,6 @@ | |
import org.monarchinitiative.phenol.ontology.data.MinimalOntology; | ||
import org.monarchinitiative.phenol.ontology.data.Term; | ||
import org.monarchinitiative.phenol.ontology.data.TermId; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
|
@@ -27,7 +25,6 @@ | |
* @author <a href="mailto:[email protected]">Peter Robinson</a> | ||
*/ | ||
public abstract class LiricalTemplate { | ||
private static final Logger logger = LoggerFactory.getLogger(LiricalTemplate.class); | ||
|
||
private final AnalysisData analysisData; | ||
/** Map of data that will be used for the FreeMark template. */ | ||
|
@@ -75,7 +72,7 @@ private void initTemplateData(AnalysisData analysisData, | |
String tstr = String.format("%s <a href=\"https://hpo.jax.org/app/browse/term/%s\">%s</a>",termName,id.getValue(),id.getValue()); | ||
observedHPOs.add(tstr); | ||
} | ||
this.templateData.put("observedHPOs",observedHPOs); | ||
templateData.put("observedHPOs",observedHPOs); | ||
List<String> excludedHpos = new ArrayList<>(); | ||
for (TermId id:analysisData.negatedPhenotypeTerms()) { | ||
String termName = ontology.termForTermId(id) | ||
|
@@ -84,12 +81,10 @@ private void initTemplateData(AnalysisData analysisData, | |
String tstr = String.format("%s <a href=\"https://hpo.jax.org/app/browse/term/%s\">%s</a>",termName,id.getValue(),id.getValue()); | ||
excludedHpos.add(tstr); | ||
} | ||
this.templateData.put("excludedHPOs",excludedHpos); | ||
// This is a flag for the output to only show the list if there are some phenotypes that were excluded in the | ||
// proband. | ||
if (!excludedHpos.isEmpty()) { | ||
this.templateData.put("hasExcludedHPOs","true"); | ||
} | ||
templateData.put("excludedHPOs",excludedHpos); | ||
// Indicates that LIRICAL was run without a VCF file. | ||
templateData.put("phenotypeOnly", analysisData.genes().size() == 0); | ||
|
||
} | ||
|
||
/** Some of our name strings contain multiple synonyms. This function removes all but the first.*/ | ||
|
@@ -101,8 +96,6 @@ protected String shortName(String name) { | |
return name; | ||
} | ||
|
||
public Path getOutPath() { return outputPath;} | ||
|
||
protected static Path createOutputFile(Path outdir, String prefix, String format) { | ||
if (!Files.isDirectory(outdir)) | ||
mkdirIfNotExist(outdir); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 20 additions & 5 deletions
25
lirical-io/src/main/resources/org/monarchinitiative/lirical/io/output/liricalTSV.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,26 @@ | ||
! LIRICAL TSV Output (${resultsMeta.liricalVersion}) | ||
! Sample: ${resultsMeta.sampleName!"n/a"} | ||
! Observed HPO terms | ||
<#if observedHPOs?has_content> | ||
! Observed HPO terms: | ||
<#list observedHPOs as obs_hpo> | ||
! ${obs_hpo} | ||
</#list> | ||
</#if> | ||
<#if excludedHPOs?has_content> | ||
! Excluded HPO terms: | ||
<#list excludedHPOs as ex_hpo> | ||
! ${ex_hpo} | ||
</#list> | ||
</#if> | ||
<#assign tab="\t"> | ||
<#list observedHPOs as hpo> | ||
! ${hpo} | ||
<#if phenotypeOnly> | ||
rank${tab}diseaseName${tab}diseaseCurie${tab}pretestprob${tab}posttestprob${tab}compositeLR | ||
<#list diff as dd> | ||
${dd.rank}${tab}${dd.diseaseName}${tab}${dd.diseaseCurie}${tab}${dd.pretestprob}${tab}${dd.posttestprob}${tab}${dd.compositeLR} | ||
</#list> | ||
${header} | ||
<#else> | ||
rank${tab}diseaseName${tab}diseaseCurie${tab}pretestprob${tab}posttestprob${tab}compositeLR${tab}${tab}entrezGeneId${tab}variants | ||
<#list diff as dd> | ||
${dd.rank}${tab}${dd.diseaseName}${tab}${dd.diseaseCurie}${tab}${dd.pretestprob}${tab}${dd.posttestprob}${tab}${dd.compositeLR}${tab}${dd.entrezGeneId}${tab}${dd.varString} | ||
</#list> | ||
</#list> | ||
</#if> |