Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bedtools2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
R3
legacy
bedtools2
Commits
308ffd7e
Commit
308ffd7e
authored
13 years ago
by
Aaron
Browse files
Options
Downloads
Patches
Plain Diff
Added number of and list of files with coverage to mIB
parent
e9d129b6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/multiIntersectBed/multiIntersectBed.cpp
+37
-9
37 additions, 9 deletions
src/multiIntersectBed/multiIntersectBed.cpp
src/multiIntersectBed/multiIntersectBed.h
+3
-1
3 additions, 1 deletion
src/multiIntersectBed/multiIntersectBed.h
with
40 additions
and
10 deletions
src/multiIntersectBed/multiIntersectBed.cpp
+
37
−
9
View file @
308ffd7e
...
...
@@ -33,6 +33,7 @@ MultiIntersectBed::MultiIntersectBed(std::ostream& _output,
output
(
_output
),
current_non_zero_inputs
(
0
),
print_empty_regions
(
_print_empty_regions
),
haveTitles
(
false
),
genome_sizes
(
NULL
),
no_coverage_value
(
_no_coverage_value
)
{
...
...
@@ -41,6 +42,10 @@ MultiIntersectBed::MultiIntersectBed(std::ostream& _output,
genome_sizes
=
new
GenomeFile
(
_genome_size_filename
);
}
if
(
titles
.
size
()
>
0
)
{
haveTitles
=
true
;
}
}
...
...
@@ -118,12 +123,14 @@ void MultiIntersectBed::UpdateInformation(const IntervalItem &item) {
case
START
:
current_depth
[
item
.
source_index
]
=
1
;
current_non_zero_inputs
++
;
files_with_coverage
[
item
.
source_index
]
=
true
;
break
;
case
END
:
//Read the next interval from this file
AddInterval
(
item
.
source_index
);
current_depth
[
item
.
source_index
]
=
0
;
current_non_zero_inputs
--
;
files_with_coverage
.
erase
(
item
.
source_index
);
break
;
default:
assert
(
0
);
...
...
@@ -155,7 +162,7 @@ void MultiIntersectBed::AddInterval(int index) {
void
MultiIntersectBed
::
PrintHeader
()
{
output
<<
"chrom
\t
start
\t
end"
;
output
<<
"chrom
\t
start
\t
end
\t
num
\t
list
"
;
for
(
size_t
i
=
0
;
i
<
titles
.
size
();
++
i
)
output
<<
"
\t
"
<<
titles
[
i
];
output
<<
endl
;
...
...
@@ -168,23 +175,44 @@ void MultiIntersectBed::PrintCoverage(CHRPOS start, CHRPOS end) {
output
<<
current_chrom
<<
"
\t
"
<<
start
<<
"
\t
"
<<
end
;
for
(
size_t
i
=
0
;
i
<
current_depth
.
size
();
++
i
)
output
<<
"
\t
"
<<
current_depth
[
i
]
;
output
<<
endl
;
<<
end
<<
"
\t
"
<<
current_non_zero_inputs
<<
"
\t
"
;
ostringstream
file_list_string
;
ostringstream
file_bool_string
;
int
depth_count
=
0
;
for
(
size_t
i
=
0
;
i
<
current_depth
.
size
();
++
i
)
{
if
(
current_depth
[
i
]
>
0
)
{
if
(
depth_count
<
current_non_zero_inputs
-
1
)
{
if
(
!
haveTitles
)
file_list_string
<<
i
+
1
<<
","
;
else
file_list_string
<<
titles
[
i
]
<<
","
;
}
else
{
if
(
!
haveTitles
)
file_list_string
<<
i
+
1
;
else
file_list_string
<<
titles
[
i
];
}
depth_count
++
;
}
file_bool_string
<<
"
\t
"
<<
current_depth
[
i
];
}
cout
<<
file_list_string
.
str
()
<<
file_bool_string
.
str
()
<<
endl
;
}
void
MultiIntersectBed
::
PrintEmptyCoverage
(
CHRPOS
start
,
CHRPOS
end
)
{
output
<<
current_chrom
<<
"
\t
"
<<
start
<<
"
\t
"
<<
end
;
<<
end
<<
"
\t
"
<<
"0"
<<
"
\t
"
<<
"none"
;
for
(
size_t
i
=
0
;
i
<
current_depth
.
size
();
++
i
)
output
<<
"
\t
0"
;
output
<<
endl
;
}
...
...
This diff is collapsed.
Click to expand it.
src/multiIntersectBed/multiIntersectBed.h
+
3
−
1
View file @
308ffd7e
...
...
@@ -35,9 +35,11 @@ private:
INTERVALS_PRIORITY_QUEUE
queue
;
std
::
string
current_chrom
;
map
<
int
,
bool
>
files_with_coverage
;
int
current_non_zero_inputs
;
bool
print_empty_regions
;
bool
haveTitles
;
GenomeFile
*
genome_sizes
;
std
::
string
no_coverage_value
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment