Skip to content

Commit

Permalink
Adding information to filenames of GC profile and subclones
Browse files Browse the repository at this point in the history
  • Loading branch information
valeu committed Nov 30, 2016
1 parent 8778faf commit 2a0b5c7
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/SVfinder.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void runWithDefinedPloidy(int ploidy, GenomeCopyNumber & sampleCopyNumber, Genom
int degree,int intercept,bool logLogNorm,float minExpectedGC,float maxExpectedGC,float knownContamination,float breakPointThreshold,int breakPointType,int minCNAlength,
int teloCentroFlanks, std::vector<double> & RSS, std::vector<double> &percentage_GenExpl,bool contaminationAdjustment,std::vector<double> &contamination,
ThreadPool * thrPool,ThreadPoolManager * thrPoolManager,std::string makePileup, float seekSubclones,
std::string outputDir,std::vector<int> &unexplainedChromosomes, bool CompleteGenomicsData) ;
std::string myName,std::vector<int> &unexplainedChromosomes, bool CompleteGenomicsData) ;


#endif //SVFINDER_H
Expand Down
8 changes: 4 additions & 4 deletions src/SeekSubclones.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ SeekSubclones::~SeekSubclones(void)
}


SeekSubclones::SeekSubclones(GenomeCopyNumber & samplecopynumber, int ploidy, std::string outputDir, float minimal_pop) {
SeekSubclones::SeekSubclones(GenomeCopyNumber & samplecopynumber, int ploidy, std::string myName, float minimal_pop) {
ploidy_ = ploidy;
minimal_pop_ = minimal_pop/100;
getSegmentsInfo(samplecopynumber, outputDir);
getSegmentsInfo(samplecopynumber, myName);
}


void SeekSubclones::getSegmentsInfo(GenomeCopyNumber & samplecopynumber, std::string outputDir)
void SeekSubclones::getSegmentsInfo(GenomeCopyNumber & samplecopynumber, std::string myName)
{
string::size_type pos = 0;
map<string,int>::iterator it;
ofstream myfile;
std::string Newfile = outputDir + "Subclones" + ".txt";
std::string Newfile = myName + "_subclones" + ".txt";
double bonfer_correction = 0;
int thresholdOnChrLengthForSubcloneDetection=20;
int numberOfChromosomes = samplecopynumber.getNumberOfChromosomes();
Expand Down
4 changes: 2 additions & 2 deletions src/SeekSubclones.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
class SeekSubclones
{
public:
SeekSubclones(GenomeCopyNumber & samplecopynumber, int ploidy, std::string outputDir, float minimal_pop);
SeekSubclones(GenomeCopyNumber & samplecopynumber, int ploidy, std::string myName, float minimal_pop);
SeekSubclones();
~SeekSubclones(void);
void getSegmentsInfo(GenomeCopyNumber & samplecopynumber, std::string outputDir);
void getSegmentsInfo(GenomeCopyNumber & samplecopynumber, std::string myName);
bool SignTest(std::vector <float>& data, float& threshold, int bonfer_correction);
void EstimateSubclonalPopulation(std::vector <float> data, float threshold, int ploidy_);
bool PercentageTest(std::vector <float>& data, float& threshold);
Expand Down
Binary file modified src/freec
Binary file not shown.
24 changes: 15 additions & 9 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,17 @@ int main(int argc, char *argv[])

//If GC profile for exome is needed
//sampleCopyNumber.fillCGprofile(dirWithFastaSeq);
//GCprofileFile = outputDir+"GC_profile.cnp";

if (!has_GCprofile || GCprofileFile=="") {
if (sampleCopyNumber.getWindowSize()==0)
GCprofileFile = outputDir+"GC_profile.targetedRegions.cnp";
else {
stringstream ss;
ss << outputDir <<"GC_profile." <<window <<"bp.cnp";
GCprofileFile = ss.str();
}
}

//sampleCopyNumber.printCGprofile(GCprofileFile);

//READ GC-CONTENT:
Expand All @@ -849,14 +859,12 @@ int main(int argc, char *argv[])
}
} else {// has_dirWithFastaSeq is true
sampleCopyNumber.fillCGprofile(dirWithFastaSeq);
GCprofileFile = outputDir+"GC_profile.cnp";
if (!has_MapFile)
sampleCopyNumber.printCGprofile(GCprofileFile); //if has_MapFile will print out GC-content later
}
if (has_MapFile) { //read mappability file
sampleCopyNumber.readGemMappabilityFile(gemMapFile);
//rewrite GC-profile with mappability as the last (5th) colomn
GCprofileFile = outputDir+"GC_profile.cnp";
sampleCopyNumber.printCGprofile(GCprofileFile);
cout << "..Mappability track from "<< gemMapFile <<" has been added to "<< GCprofileFile <<"\n";
}
Expand All @@ -867,14 +875,12 @@ int main(int argc, char *argv[])
}
if (has_dirWithFastaSeq) {// has_dirWithFastaSeq is true
sampleCopyNumber.fillCGprofile(dirWithFastaSeq);
GCprofileFile = outputDir+"GC_profile.cnp";
if (!has_MapFile)
sampleCopyNumber.printCGprofile(GCprofileFile); //if has_MapFile will print out GC-content later
} else {cerr << "Error: Cannot read chromosome fasta files for the GC content correction\n";}
if (has_MapFile) { //read mappability file
sampleCopyNumber.readGemMappabilityFile(gemMapFile);
//rewrite GC-profile with mappability as the last (5th) colomn
GCprofileFile = outputDir+"GC_profile.cnp";
sampleCopyNumber.printCGprofile(GCprofileFile);
cout << "..Mappability track from "<< gemMapFile <<" has been added to "<< GCprofileFile <<"\n";
}
Expand Down Expand Up @@ -918,7 +924,7 @@ int main(int argc, char *argv[])
runWithDefinedPloidy(ploidy,sampleCopyNumber,controlCopyNumber,isControlIsPresent,forceGC,has_BAF,ifTargeted,WESanalysis,
degree,intercept,logLogNorm,minExpectedGC,maxExpectedGC,knownContamination,breakPointThreshold,breakPointType,minCNAlength,
teloCentroFlanks, RSS,percentage_GenExpl,contaminationAdjustment,contamination, thrPool,thrPoolManager,
makePileup,seekSubclones,outputDir,unexplainedChromosomes, CompleteGenomicsData);
makePileup,seekSubclones,myName,unexplainedChromosomes, CompleteGenomicsData);

}

Expand Down Expand Up @@ -954,7 +960,7 @@ int main(int argc, char *argv[])
runWithDefinedPloidy(bestPloidy,sampleCopyNumber,controlCopyNumber,isControlIsPresent,forceGC,has_BAF,ifTargeted,WESanalysis,
degree,intercept,logLogNorm,minExpectedGC,maxExpectedGC,knownContamination,breakPointThreshold,breakPointType,minCNAlength,
teloCentroFlanks, RSS,percentage_GenExpl,contaminationAdjustment,contamination, thrPool,thrPoolManager,makePileup,seekSubclones,
outputDir,unexplainedChromosomes, CompleteGenomicsData);
myName,unexplainedChromosomes, CompleteGenomicsData);
}

if (has_BAF || makePileup != "false") {
Expand Down Expand Up @@ -1024,7 +1030,7 @@ void runWithDefinedPloidy(int ploidy, GenomeCopyNumber & sampleCopyNumber, Genom
bool has_BAF,bool ifTargeted,bool WESanalysis,
int degree,int intercept,bool logLogNorm,float minExpectedGC,float maxExpectedGC,float knownContamination,float breakPointThreshold,int breakPointType,int minCNAlength,
int teloCentroFlanks, vector<double> & RSS, vector<double> &percentage_GenExpl,bool contaminationAdjustment,vector<double> &contamination, ThreadPool * thrPool,
ThreadPoolManager * thrPoolManager, string makePileup, float seekSubclones, std::string outputDir, vector<int> &unexplainedChromosomes, bool CompleteGenomicsData) {
ThreadPoolManager * thrPoolManager, string makePileup, float seekSubclones, std::string myName, vector<int> &unexplainedChromosomes, bool CompleteGenomicsData) {
//NORMALIZE READ COUNT:
sampleCopyNumber.setPloidy(ploidy);
sampleCopyNumber.setNormalContamination(knownContamination);
Expand Down Expand Up @@ -1181,7 +1187,7 @@ void runWithDefinedPloidy(int ploidy, GenomeCopyNumber & sampleCopyNumber, Genom
if (seekSubclones < 100 && seekSubclones>0)
{
cout << "Seeking eventual subclones...";
SeekSubclones subc(sampleCopyNumber, ploidy, outputDir, seekSubclones);
SeekSubclones subc(sampleCopyNumber, ploidy, myName, seekSubclones);
cout << "-> Done!\n";
}
//Calculate RSS score
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#define VERSION_H

const double VERSION_OFFSET = 3;
const double FREEC_VERSION = 9.9;
const double FREEC_VERSION = 10.0;
const double CONTROL_FREEC_VERSION = FREEC_VERSION - VERSION_OFFSET;

#endif

0 comments on commit 2a0b5c7

Please sign in to comment.