Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.
Open
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
27 changes: 23 additions & 4 deletions src/pindel2vcf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
e.m.w.lameijer@gmail.com
+31(0)71-5 125 831

Version 0.6.4 [December 19th, 2017] Add more fields to INFO column, SAF and SAR
Version 0.6.3 [February 19th, 2014] Clearer text on usage of -P option
Version 0.6.2 [December 12th, 2014] Now robust against fasta files that have non-standard line lengths (C++'s getline does not work well on lines of over a million characters)
Version 0.6.1 [December 12th, 2014] Now has special code to recognize lines that contain SV-data, instead of relying on indirect establishment of their identity from context
Expand Down Expand Up @@ -773,6 +774,8 @@ void createHeader(ofstream &outFile, const string& sourceProgram, const string&
}
outFile << "##FORMAT=<ID=AD,Number=2,Type=Integer,Description=\"Allele depth, how many reads support this allele\">" << endl;

outFile << "##FORMAT=<ID=SAF,Number=A,Type=Integer,Description=\"Alternate allele observations on the forward strand\">" << endl;
outFile << "##FORMAT=<ID=SAR,Number=A,Type=Integer,Description=\"Alternate allele observations on the reverse strand\">" << endl;
// headers of columns
outFile << "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO";
if (samples.size()>0) {
Expand Down Expand Up @@ -847,7 +850,9 @@ class Genotype
return d_totalRefSupport;
}
const string getGTRDAD() const;
const string getGTRDADSAFSAR() const;
const string getGTAD() const;
const string getGTADSAFSAR() const;

private:
int d_readDepthPlus;
Expand Down Expand Up @@ -981,6 +986,13 @@ const string Genotype::getGTnew() const
return deriveGenotype( *this );
}

const string Genotype::getGTRDADSAFSAR() const
{
stringstream ss;
ss << getGTnew() << ":" << getTotalRefSupport() << "," << getTotalReads() << ":" << getReadDepthPlus() << ":" << getReadDepthMinus();
return ss.str();
}

const string Genotype::getGTRDAD() const
{
stringstream ss;
Expand All @@ -995,6 +1007,13 @@ const string Genotype::getGTAD() const
return ss.str();
}

const string Genotype::getGTADSAFSAR() const
{
stringstream ss;
ss << getGTold() << ":" << getTotalReads() << ":" << getReadDepthPlus() << ":" << getReadDepthMinus();
return ss.str();
}


/* 'SVData' stores the data of a certain structural variant. */
class SVData
Expand Down Expand Up @@ -1577,17 +1596,17 @@ ostream& operator<<(ostream& os, const SVData& svd)


if (pindel024uOrLater && svd.getAlternative()!="<INS>") {
os << "\tGT:AD";
os << "\tGT:AD:SAF:SAR";
} else {
os << "\tGT:AD";
os << "\tGT:AD:SAF:SAR";
}

for (int counter=0; counter<svd.d_format.size(); counter++ ) {
os << "\t";
if (pindel024uOrLater && svd.getAlternative()!="<INS>") {
os << svd.d_format[ counter ].getGTRDAD();
os << svd.d_format[ counter ].getGTRDADSAFSAR();
} else {
os << svd.d_format[ counter ].getGTAD();
os << svd.d_format[ counter ].getGTADSAFSAR();
}
}

Expand Down
18 changes: 15 additions & 3 deletions src/pindel2vcf4tcga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
e.m.w.lameijer@gmail.com
+31(0)71-5 125 831

Version 0.6.4 [December 19th, 2017] Add more fields to INFO column, SAF and SAR
Version 0.6.3 [February 19th, 2014] Clearer text on usage of -P option
Version 0.6.2 [December 12th, 2014] Now robust against fasta files that have non-standard line lengths (C++'s getline does not work well on lines of over a million characters)
Version 0.6.1 [December 12th, 2014] Now has special code to recognize lines that contain SV-data, instead of relying on indirect establishment of their identity from context
Expand Down Expand Up @@ -774,6 +775,8 @@ void createHeader(ofstream &outFile, const string& sourceProgram, const string&
outFile << "##FORMAT=<ID=PL,Number=3,Type=Integer,Description=\"Normalized, Phred-scaled likelihoods for AA,AB,BB genotypes where A=ref and B=alt; "
<< "not applicable if site is not biallelic\">" << endl;

outFile << "##FORMAT=<ID=SAF,Number=A,Type=Integer,Description=\"Alternate allele observations on the forward strand\">" << endl;
outFile << "##FORMAT=<ID=SAR,Number=A,Type=Integer,Description=\"Alternate allele observations on the reverse strand\">" << endl;

//outFile << "##INFO=<ID=DP,Number=1,Type=Integer,Description=\"Total Depth across samples\">" << endl;
//outFile << "##INFO=<ID=DP,Number=1,Type=Integer,Description=\"Total Depth across samples\">" << endl;
Expand Down Expand Up @@ -883,6 +886,7 @@ class Genotype
}
const string getSampleDataOfEvent() const;
const string getGTAD() const;
const string getGTADSAFSAR() const;

private:
int d_readDepthPlus;
Expand Down Expand Up @@ -1025,7 +1029,8 @@ const string Genotype::getSampleDataOfEvent() const
<< getTotalRefSupport() + getTotalReads() << ":" // DP
<< "." << ":" // BQ (TODO)
<< 2 << ":" // SS (TODO)
<< getTotalRefSupport() << "," << getTotalReads(); // AD
<< getTotalRefSupport() << "," << getTotalReads() // AD
<< getReadDepthPlus() << ":" << getReadDepthMinus(); // SAF:SAR
return ss.str();
}

Expand All @@ -1036,6 +1041,13 @@ const string Genotype::getGTAD() const
return ss.str();
}

const string Genotype::getGTADSAFSAR() const
{
stringstream ss;
ss << getGTold() << ":" << getTotalReads() << ":" << getReadDepthPlus() << ":" << getReadDepthMinus();
return ss.str();
}


/* 'SVData' stores the data of a certain structural variant. */
class SVData
Expand Down Expand Up @@ -1617,14 +1629,14 @@ ostream& operator<<(ostream& os, const SVData& svd)
os << ";" << somatic_p_value;
}

os << "\tGT:DP:BQ:SS:AD";
os << "\tGT:DP:BQ:SS:AD:SAF:SAR";

for (int counter=0; counter<svd.d_format.size(); counter++ ) {
os << "\t";
if (pindel024uOrLater && svd.getAlternative()!="<INS>") {
os << svd.d_format[ counter ].getSampleDataOfEvent();
} else {
os << svd.d_format[ counter ].getGTAD();
os << svd.d_format[ counter ].getGTADSAFSAR();
}
}

Expand Down