Skip to content

Commit 7999ce9

Browse files
committed
dont output deletion and untranslated fusions by default
1 parent bf58774 commit 7999ce9

7 files changed

Lines changed: 40 additions & 4 deletions

File tree

src/common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef COMMON_H
22
#define COMMON_H
33

4-
#define FUSIONSCAN_VER "0.5.0"
4+
#define FUSIONSCAN_VER "0.6.0"
55

66
#define _DEBUG true
77

src/fusionmapper.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,12 @@ void FusionMapper::clusterMatches() {
303303
frs[f].calcUnique();
304304
frs[f].updateInfo(fusionList);
305305
if(frs[f].isQualified()) {
306+
if(!GlobalSettings::outputDeletions && frs[f].isDeletion())
307+
continue;
308+
if(frs[f].isLeftProteinForward() != frs[f].isRightProteinForward()) {
309+
if(!GlobalSettings::outputUntranslated)
310+
continue;
311+
}
306312
frs[f].print(fusionList);
307313
mFusionResults.push_back(frs[f]);
308314
}

src/globalsettings.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22

33
bool GlobalSettings::markedOnlyForVCF = false;
44
int GlobalSettings::uniqueRequirement = 2;
5-
int GlobalSettings::deletionThreshold = 50;
5+
int GlobalSettings::deletionThreshold = 50;
6+
bool GlobalSettings::outputDeletions = false;
7+
bool GlobalSettings::outputUntranslated = false;

src/globalsettings.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,19 @@ class GlobalSettings{
2121
inline static void setDeletionThreshold(int val){
2222
deletionThreshold = val;
2323
}
24+
inline static void setOutputDeletions(bool flag){
25+
outputDeletions = flag;
26+
}
27+
inline static void setOutputUntranslated(bool flag){
28+
outputUntranslated = flag;
29+
}
2430

2531
public:
2632
static bool markedOnlyForVCF;
2733
static int uniqueRequirement;
2834
static int deletionThreshold;
35+
static bool outputDeletions;
36+
static bool outputUntranslated;
2937
};
3038

3139

src/htmlreporter.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "htmlreporter.h"
22
#include "common.h"
33
#include <chrono>
4+
#include "globalsettings.h"
45

56
const std::string getCurrentSystemTime()
67
{
@@ -62,8 +63,15 @@ void HtmlReporter::printFusions() {
6263
mFile<<"</ul></div>";
6364
id=0;
6465
for(int i=0;i<mFusionResults.size();i++){
66+
FusionResult fusion = mFusionResults[i];
67+
if(!GlobalSettings::outputDeletions && fusion.isDeletion())
68+
continue;
69+
if(fusion.isLeftProteinForward() != fusion.isRightProteinForward()) {
70+
if(!GlobalSettings::outputUntranslated)
71+
continue;
72+
}
6573
id++;
66-
printFusion(id, mFusionResults[i]);
74+
printFusion(id, fusion);
6775
}
6876
}
6977

src/jsonreporter.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ void JsonReporter::run() {
2828
for(int i=0;i<mFusionResults.size();i++){
2929
FusionResult fusion = mFusionResults[i];
3030
vector<Match*> matches = fusion.mMatches;
31+
if(!GlobalSettings::outputDeletions && fusion.isDeletion())
32+
continue;
33+
if(fusion.isLeftProteinForward() != fusion.isRightProteinForward()) {
34+
if(!GlobalSettings::outputUntranslated)
35+
continue;
36+
}
3137

3238
if(isFirstMut) {
3339
mFile << endl;

src/main.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ int main(int argc, char* argv[]){
2222
cmd.add<string>("fusion", 'f', "fusion file name, in CSV format", true, "");
2323
cmd.add<string>("ref", 'r', "reference fasta file name", true, "");
2424
cmd.add<int>("unique", 'u', "specify the least supporting read number is required to report a fusion, default is 2", false, 2);
25-
cmd.add<int>("deletion", 'd', "specify the least deletion length of a intra-gene deletion to report, default is 50", false, 50);
2625
cmd.add<string>("html", 'h', "file name to store HTML report, default is genefuse.html", false, "genefuse.html");
2726
cmd.add<string>("json", 'j', "file name to store JSON report, default is genefuse.json", false, "genefuse.json");
2827
cmd.add<int>("thread", 't', "worker thread number, default is 4", false, 4);
28+
cmd.add<int>("deletion", 'd', "specify the least deletion length of a intra-gene deletion to report, default is 50", false, 50);
29+
cmd.add("output_deletions", 'D', "long deletions are not output by default, enable this option to output them");
30+
cmd.add("output_untranslated_fusions", 'U', "the fusions that cannot be transcribed or translated are not output by default, enable this option to output them");
2931
cmd.parse_check(argc, argv);
3032
string r1file = cmd.get<string>("read1");
3133
string r2file = cmd.get<string>("read2");
@@ -36,9 +38,13 @@ int main(int argc, char* argv[]){
3638
int threadNum = cmd.get<int>("thread");
3739
int unique = cmd.get<int>("unique");
3840
int deletion = cmd.get<int>("deletion");
41+
bool outputDeletion = cmd.exist("output_deletions");
42+
bool outputUntranslated = cmd.exist("output_untranslated_fusions");
3943

4044
GlobalSettings::setUniqueRequirement(unique);
4145
GlobalSettings::setDeletionThreshold(deletion);
46+
GlobalSettings::setOutputDeletions(outputDeletion);
47+
GlobalSettings::setOutputUntranslated(outputUntranslated);
4248

4349

4450
if(ends_with(refFile, ".gz") || ends_with(refFile, ".gz")) {

0 commit comments

Comments
 (0)