Skip to content
Snippets Groups Projects
Commit f61d87b7 authored by Aaron's avatar Aaron
Browse files

Cleanup after testing.

parent d0e44320
No related branches found
No related tags found
No related merge requests found
No preview for this file type
No preview for this file type
...@@ -25,6 +25,8 @@ MaskFastaFromBed::MaskFastaFromBed(string &fastaInFile, string &bedFile, string ...@@ -25,6 +25,8 @@ MaskFastaFromBed::MaskFastaFromBed(string &fastaInFile, string &bedFile, string
this->fastaOutFile = fastaOutFile; this->fastaOutFile = fastaOutFile;
this->bed = new BedFile(this->bedFile); this->bed = new BedFile(this->bedFile);
//
bed->loadBedFileIntoMapNoBin(); bed->loadBedFileIntoMapNoBin();
} }
...@@ -54,9 +56,8 @@ void MaskFastaFromBed::MaskFasta() { ...@@ -54,9 +56,8 @@ void MaskFastaFromBed::MaskFasta() {
exit (1); exit (1);
} }
/* Read the fastaDb chromosome by chromosome*/
/* Read the fastaDb chromosome by chromosome*/
string fastaInLine; string fastaInLine;
string currChrom; string currChrom;
string currDNA = ""; string currDNA = "";
...@@ -92,7 +93,7 @@ void MaskFastaFromBed::MaskFasta() { ...@@ -92,7 +93,7 @@ void MaskFastaFromBed::MaskFasta() {
/* /*
(1) if soft masking, extract the sequence, lowercase it, (1) if soft masking, extract the sequence, lowercase it,
then put it back then put it back
(2) otherwise replace with Ns (2) otherwise replace with Ns
*/ */
if (this->softMask) { if (this->softMask) {
replacement = currDNA.substr(start, length); replacement = currDNA.substr(start, length);
...@@ -138,18 +139,19 @@ void MaskFastaFromBed::MaskFasta() { ...@@ -138,18 +139,19 @@ void MaskFastaFromBed::MaskFasta() {
PrettyPrintChrom(faOut, currChrom, currDNA, fastaWidth); PrettyPrintChrom(faOut, currChrom, currDNA, fastaWidth);
} }
// closed for business.
fa.close(); fa.close();
faOut.close(); faOut.close();
} }
void MaskFastaFromBed::PrettyPrintChrom(ofstream &out, string chrom, const string &sequence, int width) { void MaskFastaFromBed::PrettyPrintChrom(ofstream &out, string chrom, const string &sequence, int width) {
int seqLength = sequence.size(); int seqLength = sequence.size();
out << ">" << chrom << endl; out << ">" << chrom << endl;
for(int i=0; i < seqLength; i+=width) for(int i = 0; i < seqLength; i += width) {
{ if (i + width < seqLength) out << sequence.substr(i, width) << endl;
if (i+width < seqLength) out << sequence.substr(i, width) << endl;
else out << sequence.substr(i, seqLength-i) << endl; else out << sequence.substr(i, seqLength-i) << endl;
} }
} }
......
...@@ -178,7 +178,8 @@ void ShowHelp(void) { ...@@ -178,7 +178,8 @@ void ShowHelp(void) {
cerr << "\t\txor\tReport overlaps if one and only one end of A overlaps B." << endl; cerr << "\t\txor\tReport overlaps if one and only one end of A overlaps B." << endl;
cerr << "\t\tnotboth\tReport overlaps if one or none of ends of A overlap B." << endl << endl; cerr << "\t\tnotboth\tReport overlaps if neither end or one and only one " << endl;
cerr << "\t\t\tend of A overlap B. That is, xor + neither." << endl << endl;
cerr << "\t\tispan\tReport overlaps between [end1, start2] of A and B." << endl; cerr << "\t\tispan\tReport overlaps between [end1, start2] of A and B." << endl;
cerr << "\t\t\t- Note: If chrom1 <> chrom2, entry is ignored." << endl << endl; cerr << "\t\t\t- Note: If chrom1 <> chrom2, entry is ignored." << endl << endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment