Skip to content

Commit

Permalink
switch cerr
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasrausch committed Mar 5, 2024
1 parent e22699e commit 97657b7
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 47 deletions.
16 changes: 8 additions & 8 deletions src/annotate.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <boost/iostreams/filter/gzip.hpp>
#include <boost/icl/split_interval_map.hpp>
#include <boost/filesystem.hpp>
#include <boost/progress.hpp>

#include "parsedb.h"
#include "query.h"
Expand Down Expand Up @@ -122,7 +121,7 @@ namespace sansa

// End
boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
std::cout << '[' << boost::posix_time::to_simple_string(now) << "] Done." << std::endl;
std::cerr << '[' << boost::posix_time::to_simple_string(now) << "] Done." << std::endl;
return 0;
}

Expand Down Expand Up @@ -179,8 +178,9 @@ namespace sansa

// Check command line arguments
if ((vm.count("help")) || (!vm.count("input-file"))) {
std::cout << "Usage: sansa " << argv[0] << " [OPTIONS] input.bcf" << std::endl;
std::cout << visible_options << "\n";
std::cerr << std::endl;
std::cerr << "Usage: sansa " << argv[0] << " [OPTIONS] input.bcf" << std::endl;
std::cerr << visible_options << "\n";
return -1;
}

Expand Down Expand Up @@ -223,10 +223,10 @@ namespace sansa

// Show cmd
boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
std::cout << '[' << boost::posix_time::to_simple_string(now) << "] ";
std::cout << "sansa ";
for(int i=0; i<argc; ++i) { std::cout << argv[i] << ' '; }
std::cout << std::endl;
std::cerr << '[' << boost::posix_time::to_simple_string(now) << "] ";
std::cerr << "sansa ";
for(int i=0; i<argc; ++i) { std::cerr << argv[i] << ' '; }
std::cerr << std::endl;

return runAnnotate(c);
}
Expand Down
2 changes: 1 addition & 1 deletion src/bed.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace sansa
inline int32_t
parseBEDAll(TConfig const& c, TGenomicRegions& overlappingRegions, TGeneIds& geneIds, TProteinCoding& pCoding) {
boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
std::cout << '[' << boost::posix_time::to_simple_string(now) << "] " << "BED feature parsing" << std::endl;
std::cerr << '[' << boost::posix_time::to_simple_string(now) << "] " << "BED feature parsing" << std::endl;

// Check gzip
if (!is_gz(c.gtfFile)) {
Expand Down
2 changes: 1 addition & 1 deletion src/gff3.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ namespace sansa
inline int32_t
parseGFF3All(TConfig const& c, TGenomicRegions& overlappingRegions, TGeneIds& geneIds, TProteinCoding& pCoding) {
boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
std::cout << '[' << boost::posix_time::to_simple_string(now) << "] " << "GFF3 feature parsing" << std::endl;
std::cerr << '[' << boost::posix_time::to_simple_string(now) << "] " << "GFF3 feature parsing" << std::endl;

// Check gzip
if (!is_gz(c.gtfFile)) {
Expand Down
2 changes: 1 addition & 1 deletion src/gtf.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace sansa
inline int32_t
parseGTFAll(TConfig const& c, TGenomicRegions& overlappingRegions, TGeneIds& geneIds, TProteinCoding& pCoding) {
boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
std::cout << '[' << boost::posix_time::to_simple_string(now) << "] " << "GTF feature parsing" << std::endl;
std::cerr << '[' << boost::posix_time::to_simple_string(now) << "] " << "GTF feature parsing" << std::endl;

// Check gzip
if (!is_gz(c.gtfFile)) {
Expand Down
4 changes: 2 additions & 2 deletions src/parsedb.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace sansa
parseDB(TConfig& c, TSV& svs) {

boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
std::cout << '[' << boost::posix_time::to_simple_string(now) << "] Parse SV annotation database" << std::endl;
std::cerr << '[' << boost::posix_time::to_simple_string(now) << "] Parse SV annotation database" << std::endl;

// Load bcf file
htsFile* ifile = bcf_open(c.db.string().c_str(), "r");
Expand Down Expand Up @@ -115,7 +115,7 @@ namespace sansa

// Statistics
now = boost::posix_time::second_clock::local_time();
std::cout << '[' << boost::posix_time::to_simple_string(now) << "] Parsed " << svid << " out of " << sitecount << " VCF/BCF records." << std::endl;
std::cerr << '[' << boost::posix_time::to_simple_string(now) << "] Parsed " << svid << " out of " << sitecount << " VCF/BCF records." << std::endl;

// Close output VCF
bcf_hdr_destroy(hdr_out);
Expand Down
4 changes: 2 additions & 2 deletions src/query.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ namespace sansa
query(TConfig& c, TSV& svs, TGenomicRegions& gRegions, TGeneIds& geneIds) {

boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
std::cout << '[' << boost::posix_time::to_simple_string(now) << "] Query input SVs" << std::endl;
std::cerr << '[' << boost::posix_time::to_simple_string(now) << "] Query input SVs" << std::endl;

// Load bcf file
htsFile* ifile = bcf_open(c.infile.string().c_str(), "r");
Expand Down Expand Up @@ -259,7 +259,7 @@ namespace sansa

// Statistics
now = boost::posix_time::second_clock::local_time();
std::cout << '[' << boost::posix_time::to_simple_string(now) << "] Parsed " << parsedSV << " out of " << sitecount << " VCF/BCF records." << std::endl;
std::cerr << '[' << boost::posix_time::to_simple_string(now) << "] Parsed " << parsedSV << " out of " << sitecount << " VCF/BCF records." << std::endl;

// Close file handles
dataOut.pop();
Expand Down
64 changes: 32 additions & 32 deletions src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,47 +10,47 @@ namespace sansa
inline
void printTitle(std::string const& title)
{
std::cout << "**********************************************************************" << std::endl;
std::cout << "Program: Sansa" << std::endl;
std::cout << "This is free software, and you are welcome to redistribute it under" << std::endl;
std::cout << "certain conditions (BSD License); for license details use '-l'." << std::endl;
std::cout << "This program comes with ABSOLUTELY NO WARRANTY; for details use '-w'." << std::endl;
std::cout << std::endl;
std::cout << title << " (Version: " << sansaVersionNumber << ")" << std::endl;
std::cout << "Contact: Tobias Rausch ([email protected])" << std::endl;
std::cout << "**********************************************************************" << std::endl;
std::cout << std::endl;
std::cerr << "**********************************************************************" << std::endl;
std::cerr << "Program: Sansa" << std::endl;
std::cerr << "This is free software, and you are welcome to redistribute it under" << std::endl;
std::cerr << "certain conditions (BSD License); for license details use '-l'." << std::endl;
std::cerr << "This program comes with ABSOLUTELY NO WARRANTY; for details use '-w'." << std::endl;
std::cerr << std::endl;
std::cerr << title << " (Version: " << sansaVersionNumber << ")" << std::endl;
std::cerr << "Contact: Tobias Rausch ([email protected])" << std::endl;
std::cerr << "**********************************************************************" << std::endl;
std::cerr << std::endl;
}

inline
void displayWarranty()
{
std::cout << "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, ";
std::cout << "THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ";
std::cout << "CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ";
std::cout << "PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ";
std::cout << "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ";
std::cout << "ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." << std::endl;
std::cout << std::endl;
std::cerr << "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, ";
std::cerr << "THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ";
std::cerr << "CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ";
std::cerr << "PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ";
std::cerr << "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ";
std::cerr << "ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." << std::endl;
std::cerr << std::endl;
}

inline void
bsd() {
std::cout << "Copyright (c) 2019 Sansa Project Authors (see AUTHORS file for details)." << std::endl;
std::cout << "All rights reserved." << std::endl;
std::cout << std::endl;
std::cout << "Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:" << std::endl;
std::cout << " 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer." << std::endl;
std::cout << " 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution." << std::endl;
std::cout << " 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission." << std::endl;
std::cout << std::endl;
std::cout << "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, ";
std::cout << "THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ";
std::cout << "CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ";
std::cout << "PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ";
std::cout << "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ";
std::cout << "ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." << std::endl;
std::cout << std::endl;
std::cerr << "Copyright (c) 2019 Sansa Project Authors (see AUTHORS file for details)." << std::endl;
std::cerr << "All rights reserved." << std::endl;
std::cerr << std::endl;
std::cerr << "Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:" << std::endl;
std::cerr << " 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer." << std::endl;
std::cerr << " 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution." << std::endl;
std::cerr << " 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission." << std::endl;
std::cerr << std::endl;
std::cerr << "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, ";
std::cerr << "THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ";
std::cerr << "CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ";
std::cerr << "PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ";
std::cerr << "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ";
std::cerr << "ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." << std::endl;
std::cerr << std::endl;
}

}
Expand Down

0 comments on commit 97657b7

Please sign in to comment.