Skip to content

Commit

Permalink
deprecated progress
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasrausch committed Nov 16, 2023
1 parent 0517bfa commit 7d13c1d
Show file tree
Hide file tree
Showing 22 changed files with 1 addition and 55 deletions.
1 change: 0 additions & 1 deletion src/alfred.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/tokenizer.hpp>
#include <boost/filesystem.hpp>
#include <boost/progress.hpp>

#include <htslib/sam.h>
#include <htslib/faidx.h>
Expand Down
3 changes: 0 additions & 3 deletions src/annotate.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <boost/unordered_map.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/progress.hpp>

#include <htslib/sam.h>
#include <htslib/faidx.h>
Expand Down Expand Up @@ -53,7 +52,6 @@ namespace bamstats
// Parse BED file
boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
std::cout << '[' << boost::posix_time::to_simple_string(now) << "] " << "BED file parsing" << std::endl;
boost::progress_display show_progress(c.nchr.size());

// Distance vector
std::vector<int32_t> dist(geneIds.size(), 0);
Expand All @@ -72,7 +70,6 @@ namespace bamstats

// Iterate chromosomese
for(int32_t refIndex=0; refIndex < (int32_t) c.nchr.size(); ++refIndex) {
++show_progress;

// Sort by position
std::sort(gRegions[refIndex].begin(), gRegions[refIndex].end(), SortIntervalStart<IntervalLabel>());
Expand Down
3 changes: 0 additions & 3 deletions src/ase.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <boost/generator_iterator.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/filesystem.hpp>
#include <boost/progress.hpp>
#include <htslib/faidx.h>
#include <htslib/sam.h>
#include <htslib/vcf.h>
Expand Down Expand Up @@ -66,7 +65,6 @@ namespace bamstats {

boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
std::cout << '[' << boost::posix_time::to_simple_string(now) << "] " << "Assign reads to haplotypes" << std::endl;
boost::progress_display show_progress(hdr->n_targets);

// Allele support file
boost::iostreams::filtering_ostream dataOut;
Expand All @@ -78,7 +76,6 @@ namespace bamstats {
faidx_t* fai = fai_load(c.genome.string().c_str());
for (int refIndex = 0; refIndex<hdr->n_targets; ++refIndex) {
std::string chrName(hdr->target_name[refIndex]);
++show_progress;

// Load het. markers
typedef std::vector<BiallelicVariant> TPhasedVariants;
Expand Down
3 changes: 0 additions & 3 deletions src/bam2match.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <boost/generator_iterator.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/filesystem.hpp>
#include <boost/progress.hpp>

#include <htslib/faidx.h>
#include <htslib/sam.h>
Expand Down Expand Up @@ -62,7 +61,6 @@ namespace bamstats

boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
std::cout << '[' << boost::posix_time::to_simple_string(now) << "] " << "Extract matches" << std::endl;
boost::progress_display show_progress(hdr->n_targets);

// Parse BAM alignments
int32_t refIndex = -1;
Expand All @@ -75,7 +73,6 @@ namespace bamstats

// New chromosome?
if (rec->core.tid != refIndex) {
++show_progress;
if (refIndex != -1) {
if (seq != NULL) free(seq);
}
Expand Down
3 changes: 0 additions & 3 deletions src/bamstats.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <boost/unordered_map.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/progress.hpp>
#include <boost/iostreams/device/file.hpp>
#include <boost/iostreams/filtering_stream.hpp>
#include <boost/iostreams/filter/zlib.hpp>
Expand Down Expand Up @@ -165,7 +164,6 @@ namespace bamstats
// Parse reference and BAM file
boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
std::cout << '[' << boost::posix_time::to_simple_string(now) << "] " << "BAM file parsing" << std::endl;
boost::progress_display show_progress( hdr->n_targets );

// GC- and N-content
typedef boost::dynamic_bitset<> TBitSet;
Expand Down Expand Up @@ -199,7 +197,6 @@ namespace bamstats
while (sam_read1(samfile, hdr, rec) >= 0) {
// New chromosome?
if ((!(rec->core.flag & BAM_FUNMAP)) && (rec->core.tid != refIndex)) {
++show_progress;

// Summarize bp-level coverage
if (refIndex != -1) {
Expand Down
1 change: 0 additions & 1 deletion src/barcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/tokenizer.hpp>
#include <boost/filesystem.hpp>
#include <boost/progress.hpp>

#include <htslib/sam.h>
#include <htslib/faidx.h>
Expand Down
1 change: 0 additions & 1 deletion src/bcsplit.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/tokenizer.hpp>
#include <boost/filesystem.hpp>
#include <boost/progress.hpp>

#include <htslib/sam.h>
#include <htslib/faidx.h>
Expand Down
3 changes: 0 additions & 3 deletions src/count_dna.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <boost/unordered_map.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/progress.hpp>

#include <htslib/sam.h>

Expand Down Expand Up @@ -157,7 +156,6 @@ namespace bamstats
// Parse BAM file
boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
std::cout << '[' << boost::posix_time::to_simple_string(now) << "] " << "BAM file parsing" << std::endl;
boost::progress_display show_progress( hdr->n_targets );

// Mate map
typedef boost::unordered_map<std::size_t, bool> TMateMap;
Expand All @@ -171,7 +169,6 @@ namespace bamstats

// Iterate chromosomes
for(int32_t refIndex=0; refIndex < (int32_t) hdr->n_targets; ++refIndex) {
++show_progress;

// Any regions on this chromosome?
if (!c.validChr[refIndex]) continue;
Expand Down
9 changes: 0 additions & 9 deletions src/count_junction.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <boost/unordered_map.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/progress.hpp>

#include <htslib/sam.h>
#include <htslib/faidx.h>
Expand Down Expand Up @@ -73,15 +72,13 @@ namespace bamstats
// Parse BAM file
boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
std::cout << '[' << boost::posix_time::to_simple_string(now) << "] " << "BAM file parsing" << std::endl;
boost::progress_display show_progress( hdr->n_targets );

// Iterate chromosomes
typedef std::set<SpGp> TSpGpSet;
typedef boost::unordered_map<std::size_t, TSpGpSet> TClipReads;
TClipReads clipReads;
uint32_t minClipLength = 25;
for(int32_t refIndex=0; refIndex < (int32_t) hdr->n_targets; ++refIndex) {
++show_progress;
if (gRegions[refIndex].empty()) continue;

// Sort by position
Expand Down Expand Up @@ -264,11 +261,9 @@ namespace bamstats
// Intra-gene table
boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
std::cout << '[' << boost::posix_time::to_simple_string(now) << "] " << "Output intra-gene splicing table" << std::endl;
boost::progress_display show_progress( c.nchr.size() );
std::ofstream intrafile(c.outintra.string().c_str());
intrafile << "gene\texonA\texonB\t" << c.sampleName << std::endl;
for(int32_t refIndex=0; refIndex < (int32_t) c.nchr.size(); ++refIndex) {
++show_progress;
if (gRegions[refIndex].empty()) continue;

// Output intra-gene exon-exon junction support
Expand Down Expand Up @@ -315,11 +310,9 @@ namespace bamstats
// Inter-gene table
now = boost::posix_time::second_clock::local_time();
std::cout << '[' << boost::posix_time::to_simple_string(now) << "] " << "Output inter-gene splicing table" << std::endl;
boost::progress_display spr( c.nchr.size() );
std::ofstream interfile(c.outinter.string().c_str());
interfile << "geneA\texonA\tgeneB\texonB\t" << c.sampleName << std::endl;
for(int32_t refIndex=0; refIndex < (int32_t) c.nchr.size(); ++refIndex) {
++spr;
for(typename TExonJctCount::const_iterator itE = ejct[refIndex].begin(); itE != ejct[refIndex].end(); ++itE) {
int32_t e1 = itE->first.first;
int32_t e2 = itE->first.second;
Expand Down Expand Up @@ -357,11 +350,9 @@ namespace bamstats
// Novel intra-chromosomal splice junctions
now = boost::posix_time::second_clock::local_time();
std::cout << '[' << boost::posix_time::to_simple_string(now) << "] " << "Output novel splicing table" << std::endl;
boost::progress_display sprgr( c.nchr.size() );
std::ofstream novelfile(c.outnovel.string().c_str());
novelfile << "geneA\tpositionA\tgeneB\tpositionB\t" << c.sampleName << std::endl;
for(int32_t refIndex=0; refIndex < (int32_t) c.nchr.size(); ++refIndex) {
++sprgr;
for(typename TExonJctCount::const_iterator itN = njct[refIndex].begin(); itN != njct[refIndex].end(); ++itN) {
int32_t p1 = itN->first.first;
std::string geneA = "NA";
Expand Down
5 changes: 0 additions & 5 deletions src/count_rna.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <boost/unordered_map.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/progress.hpp>

#include <htslib/sam.h>
#include <htslib/faidx.h>
Expand Down Expand Up @@ -48,11 +47,9 @@ namespace bamstats
// Parse BED file
boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
std::cout << '[' << boost::posix_time::to_simple_string(now) << "] " << "BED file parsing" << std::endl;
boost::progress_display show_progress(c.nchr.size());

// Iterate chromosomese
for(int32_t refIndex=0; refIndex < (int32_t) c.nchr.size(); ++refIndex) {
++show_progress;
if (gRegions[refIndex].empty()) continue;

// Sort by position
Expand Down Expand Up @@ -159,7 +156,6 @@ namespace bamstats
// Parse BAM file
boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
std::cout << '[' << boost::posix_time::to_simple_string(now) << "] " << "BAM file parsing" << std::endl;
boost::progress_display show_progress( hdr->n_targets );

// Pair qualities and features
typedef boost::unordered_map<std::size_t, int32_t> TFeatures;
Expand All @@ -171,7 +167,6 @@ namespace bamstats

// Iterate chromosomes
for(int32_t refIndex=0; refIndex < (int32_t) hdr->n_targets; ++refIndex) {
++show_progress;
if (gRegions[refIndex].empty()) continue;

// Sort by position
Expand Down
1 change: 0 additions & 1 deletion src/json.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifndef JSON_H
#define JSON_H

#include <boost/progress.hpp>
#include <boost/iostreams/filtering_streambuf.hpp>
#include <boost/iostreams/filtering_stream.hpp>
#include <boost/iostreams/copy.hpp>
Expand Down
3 changes: 0 additions & 3 deletions src/motif.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <boost/unordered_map.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/progress.hpp>
#include <boost/iostreams/device/file.hpp>
#include <boost/iostreams/filtering_stream.hpp>
#include <boost/iostreams/filter/zlib.hpp>
Expand Down Expand Up @@ -310,7 +309,6 @@ namespace bamstats
// Motif search
now = boost::posix_time::second_clock::local_time();
std::cout << '[' << boost::posix_time::to_simple_string(now) << "] " << "Motif search" << std::endl;
boost::progress_display show_progress(c.nchr.size());

// Output motif positions
boost::iostreams::filtering_ostream dataOut;
Expand All @@ -324,7 +322,6 @@ namespace bamstats
faidx_t* fai = fai_load(c.genome.string().c_str());
char* seq = NULL;
for(int32_t refIndex=0; refIndex < (int32_t) c.nchr.size(); ++refIndex) {
++show_progress;

// Chromosome name and length
std::string tname = "NA";
Expand Down
1 change: 0 additions & 1 deletion src/qc.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/tokenizer.hpp>
#include <boost/filesystem.hpp>
#include <boost/progress.hpp>

#include <htslib/sam.h>
#include <htslib/faidx.h>
Expand Down
1 change: 0 additions & 1 deletion src/qcstruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <boost/unordered_map.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/progress.hpp>
#include <boost/iostreams/device/file.hpp>
#include <boost/iostreams/filtering_stream.hpp>
#include <boost/iostreams/filter/zlib.hpp>
Expand Down
1 change: 0 additions & 1 deletion src/repliseq.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/tokenizer.hpp>
#include <boost/filesystem.hpp>
#include <boost/progress.hpp>

#include <htslib/sam.h>
#include <htslib/faidx.h>
Expand Down
3 changes: 0 additions & 3 deletions src/repliseqproc.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <boost/unordered_map.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/progress.hpp>

#include <htslib/sam.h>
#include <htslib/faidx.h>
Expand Down Expand Up @@ -42,12 +41,10 @@ namespace bamstats
// Parse reference and BAM file
boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
std::cout << '[' << boost::posix_time::to_simple_string(now) << "] " << "BAM file parsing" << std::endl;
boost::progress_display show_progress( hdr->n_targets );

// Parse genome
faidx_t* fai = fai_load(c.genome.string().c_str());
for(int32_t refIndex = 0; refIndex < hdr->n_targets; ++refIndex) {
++show_progress;

// Fetch sequence
char* seq = NULL;
Expand Down
1 change: 0 additions & 1 deletion src/spaced.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <boost/unordered_map.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/progress.hpp>

#include <htslib/sam.h>
#include <htslib/faidx.h>
Expand Down
3 changes: 0 additions & 3 deletions src/split.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <boost/generator_iterator.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/filesystem.hpp>
#include <boost/progress.hpp>

#include <htslib/faidx.h>
#include <htslib/sam.h>
Expand Down Expand Up @@ -66,7 +65,6 @@ namespace bamstats

boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
std::cout << '[' << boost::posix_time::to_simple_string(now) << "] " << "Assign reads to haplotypes" << std::endl;
boost::progress_display show_progress(hdr->n_targets);

// Open output file
samFile* h1bam = sam_open(c.h1bam.string().c_str(), "wb");
Expand Down Expand Up @@ -96,7 +94,6 @@ namespace bamstats
faidx_t* fai = fai_load(c.genome.string().c_str());
for (int refIndex = 0; refIndex<hdr->n_targets; ++refIndex) {
std::string chrName(hdr->target_name[refIndex]);
++show_progress;

// Load het. markers
typedef std::vector<BiallelicVariant> TPhasedVariants;
Expand Down
1 change: 0 additions & 1 deletion src/telmotif.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/tokenizer.hpp>
#include <boost/filesystem.hpp>
#include <boost/progress.hpp>

#include <htslib/sam.h>
#include <htslib/faidx.h>
Expand Down
6 changes: 0 additions & 6 deletions src/tracks.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <boost/unordered_map.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/progress.hpp>

#include <htslib/sam.h>

Expand Down Expand Up @@ -56,10 +55,7 @@ namespace bamstats
uint64_t totalPairs = 0;
boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
std::cout << '[' << boost::posix_time::to_simple_string(now) << "] " << "Total read count normalization" << std::endl;
boost::progress_display show_progress( hdr->n_targets );
for(int32_t refIndex=0; refIndex < (int32_t) hdr->n_targets; ++refIndex) {
++show_progress;

hts_itr_t* iter = sam_itr_queryi(idx, refIndex, 0, hdr->target_len[refIndex]);
bam1_t* rec = bam_init1();
int32_t lastAlignedPos = 0;
Expand Down Expand Up @@ -139,9 +135,7 @@ namespace bamstats
// Iterate chromosomes
boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
std::cout << '[' << boost::posix_time::to_simple_string(now) << "] " << "BAM file parsing" << std::endl;
boost::progress_display show_progress( hdr->n_targets );
for(int32_t refIndex=0; refIndex < (int32_t) hdr->n_targets; ++refIndex) {
++show_progress;
if (c.wiggleFormat) dataOut << "fixedStep chrom=" << hdr->target_name[refIndex] << " start=1 step=1" << std::endl;

// Find valid pairs
Expand Down
1 change: 0 additions & 1 deletion src/tsv.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifndef TSV_H
#define TSV_H

#include <boost/progress.hpp>
#include <boost/iostreams/filtering_streambuf.hpp>
#include <boost/iostreams/filtering_stream.hpp>
#include <boost/iostreams/copy.hpp>
Expand Down
Loading

0 comments on commit 7d13c1d

Please sign in to comment.