Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
R3
legacy
bedtools2
Commits
cbad1fc5
Commit
cbad1fc5
authored
May 16, 2015
by
arq5x
Browse files
cleanup
parent
43f88db6
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/bedtools.cpp
View file @
cbad1fc5
...
...
@@ -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
;
...
...
src/spacingFile/SpacingFile.cpp
View file @
cbad1fc5
...
...
@@ -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
());
}
...
...
src/spacingFile/spacingMain.cpp
View file @
cbad1fc5
...
...
@@ -37,14 +37,14 @@ void spacing_help(void) {
cerr
<<
"
\n
Tool: 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
length
s
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 d
istance for
both
overlapping and bookended
intervals
is 0."
<<
endl
<<
endl
;
cerr
<<
"
\t
(3)
D
istance for overlapping
intervaks is -1
and bookended is 0."
<<
endl
<<
endl
;
cerr
<<
"Example: "
<<
endl
;
cerr
<<
"
\t
$ cat test.bed "
<<
endl
;
...
...
src/split/splitBed.cpp
View file @
cbad1fc5
...
...
@@ -124,7 +124,7 @@ int BedSplit::main(int argc,char** argv)
}
if
(
num_chuncks
<=
0
)
{
cerr
<<
"Error: num_chun
c
ks==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
<<
"Unknow
n
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
"
,
...
...
src/split/splitBed.h
View file @
cbad1fc5
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment