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
dd037684
Commit
dd037684
authored
13 years ago
by
Aaron
Browse files
Options
Downloads
Patches
Plain Diff
expand now handles gzipped files w/o .gz extension.
parent
bb393ba8
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/utils/tabFile/Makefile
+3
-1
3 additions, 1 deletion
src/utils/tabFile/Makefile
src/utils/tabFile/tabFile.cpp
+8
-33
8 additions, 33 deletions
src/utils/tabFile/tabFile.cpp
src/utils/tabFile/tabFile.h
+1
-0
1 addition, 0 deletions
src/utils/tabFile/tabFile.h
with
12 additions
and
34 deletions
src/utils/tabFile/Makefile
+
3
−
1
View file @
dd037684
...
@@ -4,7 +4,9 @@ UTILITIES_DIR = ../../utils/
...
@@ -4,7 +4,9 @@ UTILITIES_DIR = ../../utils/
# -------------------
# -------------------
# define our includes
# define our includes
# -------------------
# -------------------
INCLUDES
=
-I
$(
UTILITIES_DIR
)
/lineFileUtilities/
-I
$(
UTILITIES_DIR
)
/gzstream/
-I
$(
UTILITIES_DIR
)
/fileType/
INCLUDES
=
-I
$(
UTILITIES_DIR
)
/lineFileUtilities/
\
-I
$(
UTILITIES_DIR
)
/gzstream/
\
-I
$(
UTILITIES_DIR
)
/fileType/
# ----------------------------------
# ----------------------------------
# define our source and object files
# define our source and object files
...
...
This diff is collapsed.
Click to expand it.
src/utils/tabFile/tabFile.cpp
+
8
−
33
View file @
dd037684
...
@@ -25,45 +25,20 @@ TabFile::TabFile(const string &tabFile)
...
@@ -25,45 +25,20 @@ TabFile::TabFile(const string &tabFile)
TabFile
::~
TabFile
(
void
)
{
TabFile
::~
TabFile
(
void
)
{
}
}
void
TabFile
::
Open
(
void
)
{
void
TabFile
::
Open
(
void
)
{
if
(
_tabFile
==
"stdin"
||
_tabFile
==
"-"
)
{
if
(
_tabFile
==
"stdin"
||
_tabFile
==
"-"
)
{
_tabStream
=
&
cin
;
_tabStream
=
&
cin
;
}
}
else
{
else
{
size_t
foundPos
;
_tabStream
=
new
ifstream
(
_tabFile
.
c_str
(),
ios
::
in
);
foundPos
=
_tabFile
.
find_last_of
(
".gz"
);
// is this a GZIPPED TAB file?
if
(
isGzipFile
(
_tabStream
)
)
{
if
(
foundPos
==
_tabFile
.
size
()
-
1
)
{
delete
_tabStream
;
igzstream
tabs
(
_tabFile
.
c_str
(),
ios
::
in
);
_tabStream
=
new
igzstream
(
_tabFile
.
c_str
(),
ios
::
in
);
if
(
!
tabs
)
{
cerr
<<
"Error: The requested file ("
<<
_tabFile
<<
") could not be opened. Exiting!"
<<
endl
;
exit
(
1
);
}
else
{
// if so, close it (this was just a test)
tabs
.
close
();
// now set a pointer to the stream so that we
// can read the file later on.
_tabStream
=
new
igzstream
(
_tabFile
.
c_str
(),
ios
::
in
);
}
}
}
// not GZIPPED.
if
(
!
(
_tabStream
->
good
())
)
{
else
{
cerr
<<
"Error: The requested file ("
<<
_tabFile
<<
") could not be opened. Exiting!"
<<
endl
;
exit
(
1
);
ifstream
tabs
(
_tabFile
.
c_str
(),
ios
::
in
);
// can we open the file?
if
(
!
tabs
)
{
cerr
<<
"Error: The requested file ("
<<
_tabFile
<<
") could not be opened. Exiting!"
<<
endl
;
exit
(
1
);
}
else
{
// if so, close it (this was just a test)
tabs
.
close
();
// now set a pointer to the stream so that we
// can read the file later on.
_tabStream
=
new
ifstream
(
_tabFile
.
c_str
(),
ios
::
in
);
}
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/utils/tabFile/tabFile.h
+
1
−
0
View file @
dd037684
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
#define TABFILE_H
#define TABFILE_H
#include
"gzstream.h"
#include
"gzstream.h"
#include
"fileType.h"
#include
<vector>
#include
<vector>
#include
<string>
#include
<string>
#include
<iostream>
#include
<iostream>
...
...
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