Commit cbad1fc5 authored by arq5x's avatar arq5x
Browse files

cleanup

parent 43f88db6
......@@ -210,7 +210,7 @@ int bedtools_help(void)
cout << " random " << "Generate random intervals in a genome.\n";
cout << " shuffle " << "Randomly redistrubute intervals in a genome.\n";
cout << " sample " << "Sample random records from file using reservoir sampling.\n";
cout << " spacing " << "Report the spacing between intervals in a file.\n";
cout << " spacing " << "Report the gap lengths between intervals in a file.\n";
cout << " annotate " << "Annotate coverage of features from multiple files.\n";
cout << endl;
......
......@@ -52,7 +52,7 @@ bool SpacingFile::getSpacing()
{
// do curr and prev overlap?
if (curr->sameChromIntersects(prev, false, false, 1E-9, false))
distance.append(0);
distance.append(-1);
else
distance.append(curr->getStartPos() - prev->getEndPos());
}
......
......@@ -37,14 +37,14 @@ void spacing_help(void) {
cerr << "\nTool: bedtools spacing" << endl;
cerr << "Version: " << VERSION << "\n";
cerr << "Summary: Report (last col.) the length of the space between intervals." << endl << endl;
cerr << "Summary: Report (last col.) the gap lengths between intervals in a file." << endl << endl;
cerr << "Usage: " << PROGRAM_NAME << " [OPTIONS] -i <bed/gff/vcf/bam>" << endl << endl;
cerr << "Notes: " << endl;
cerr << "\t(1) Input must be sorted by chrom,start (sort -k1,1 -k2,2n for BED)." << endl;
cerr << "\t(2) The 1st element for each chrom will have NULL distance. (\".\")." << endl;
cerr << "\t(3) The distance for both overlapping and bookended intervals is 0." << endl << endl;
cerr << "\t(3) Distance for overlapping intervaks is -1 and bookended is 0." << endl << endl;
cerr << "Example: " << endl;
cerr << "\t$ cat test.bed " << endl;
......
......@@ -124,7 +124,7 @@ int BedSplit::main(int argc,char** argv)
}
if(num_chuncks<=0)
{
cerr << "Error: num_chuncks==0.\n" << endl;
cerr << "Error: num_chunks==0.\n" << endl;
usage(cerr);
return EXIT_FAILURE;
}
......@@ -138,7 +138,7 @@ int BedSplit::main(int argc,char** argv)
}
else
{
cerr << "Unknow split algorithm " << algorithm << endl;
cerr << "Unknown split algorithm " << algorithm << endl;
return EXIT_FAILURE;
}
}
......@@ -151,6 +151,7 @@ std::FILE* BedSplit::saveFileChunk(std::string& filename,size_t file_index)
sprintf(tmp,"%05d",(file_index+1));
filename.append(".").append(tmp).append(".bed");
FILE* out = fopen(filename.c_str(),"w");
if(out==NULL)
{
fprintf(stderr,"Cannot open \"%s\". %s\n",
......
......@@ -24,6 +24,7 @@
// Class methods and elements
//************************************************
class BedSplit {
private:
std::string bedFileName;
std::string outfileprefix;
......@@ -37,10 +38,8 @@ private:
void loadBed();
int doSimpleSplit();
int doEuristicSplitOnTotalSize();
public:
public:
// constructor
BedSplit();
// destructor
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment