Skip to content

Commit f1f11ad

Browse files
committed
Merge branch 'devel'
2 parents 4ecc9ef + c495247 commit f1f11ad

File tree

11 files changed

+34
-65
lines changed

11 files changed

+34
-65
lines changed

CHANGELOG

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/)
6-
.
6+
7+
## [0.2.3] - 2017-14-03
8+
### Changed
9+
- Fix delay time before running. Now analysis doesn't wait to run
10+
- Remove debugging message
11+
- Fix bug when exporting PNG data.
12+
713
## [0.2.2] - 2017-03-03
814
### Changed
915
- Fix Crash when reading .xz file

FastQt.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
QT += core gui concurrent charts svg
77
#QMAKE_CXXFLAGS += -Ofast
88
QMAKE_CXXFLAGS += -std=c++11
9-
#CONFIG(release, debug|release):DEFINES += QT_NO_DEBUG_OUTPUT
9+
CONFIG(release, debug|release):DEFINES += QT_NO_DEBUG_OUTPUT
1010

1111

1212
# METHOD 1 : If KArchive is not installed as a Qt Module then copy to your Qt installation :

analysis/analysis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void Analysis::save(const QString &path)
4040
QString pngPath = dir.filePath(QString("%1.png").arg(name));
4141

4242
capture(svgPath);
43-
capture(pngPath);
43+
capture(pngPath, ImageFormat::PngFormat);
4444
}
4545

4646

analysis/analysisrunner.cpp

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -61,30 +61,30 @@ void AnalysisRunner::run()
6161

6262
QFileInfo fileInfo(mFilename);
6363

64-
QIODevice * file = Q_NULLPTR;
64+
QIODevice * file = Q_NULLPTR;
65+
QIODevice * rawFile = new QFile(mFilename);
6566

66-
file = new QFile(mFilename);
67-
if (is_gz(file))
67+
if (is_gz(rawFile))
6868
{
69-
file = new KCompressionDevice(mFilename, KCompressionDevice::GZip);
69+
file = new KCompressionDevice(rawFile,true,KCompressionDevice::GZip);
7070
if (!is_fastq(file))
7171
file = Q_NULLPTR;
7272
}
73-
else if (is_bz2(file))
73+
else if (is_bz2(rawFile))
7474
{
75-
file = new KCompressionDevice(mFilename, KCompressionDevice::BZip2);
75+
file = new KCompressionDevice(rawFile, true, KCompressionDevice::BZip2);
7676
if (!is_fastq(file))
7777
file = Q_NULLPTR;
7878
}
79-
else if (is_xz(file))
79+
else if (is_xz(rawFile))
8080
{
81-
file = new KCompressionDevice(mFilename, KCompressionDevice::Xz);
81+
file = new KCompressionDevice(rawFile,true, KCompressionDevice::Xz);
8282
if (!is_fastq(file))
8383
file = Q_NULLPTR;
8484
}
85-
else if (is_fastq(file))
85+
else if (is_fastq(rawFile))
8686
{
87-
file = new QFile(mFilename);
87+
file = rawFile;
8888
}
8989

9090
if (file == Q_NULLPTR)
@@ -108,11 +108,6 @@ void AnalysisRunner::run()
108108
FastqReader reader(file);
109109
mStartTime.start();
110110

111-
// pre compute total size for sequencial access .
112-
//emitUpdate(tr("Analysis ..."));
113-
reader.computeTotalSize();
114-
115-
116111

117112
for (Analysis * a : mAnalysisHash)
118113
a->before();
@@ -137,7 +132,7 @@ void AnalysisRunner::run()
137132
// this is critcal and can decrease the speed. Send message only 1 sequence / 1000
138133
if (mSequenceCount % 1000 == 0)
139134
{
140-
int percentNow = reader.percentComplete();
135+
int percentNow = (float)(rawFile->pos()) / fileInfo.size() * 100;
141136
// if percentNow is still null, return empty percent ...
142137
if ( (percentNow >= mProgression + 5) || (percentNow == 0))
143138
{

analysis/analysisrunner.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Copyright Copyright 2016-17 Sacha Schutz
2424
#define ANALYSISRUNNER_H
2525
#include <QtCore>
2626
#include <KCompressionDevice>
27+
#include <KFilterBase>
2728
#include "analysis.h"
2829
#include "fastqreader.h"
2930
#include "imageformatdefinition.h"

main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ int main(int argc, char *argv[])
4040
a.setApplicationName("FastQt");
4141
a.setOrganizationName("Labsquare");
4242
a.setOrganizationDomain("labsquare.org");
43-
a.setApplicationVersion("0.2.2");
43+
a.setApplicationVersion("0.2.3");
4444

4545
QString locale = QLocale::system().name().section('_', 0, 0);
4646

model/mainanalysemodel.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ MainAnalyseModel::MainAnalyseModel(QObject * parent)
99
// connect(mSignalMapper,SIGNAL(mapped(int)),this,SLOT(updated(int)));
1010
connect(mTimer,SIGNAL(timeout()),this,SLOT(timeUpdated()));
1111

12-
mTimer->setInterval(1000);
12+
mTimer->setInterval(300);
1313

1414
}
1515

@@ -56,6 +56,7 @@ QVariant MainAnalyseModel::data(const QModelIndex &index, int role) const
5656
if (index.column() == ProgressColumn)
5757
return mRunners.at(index.row())->progression();
5858

59+
5960
if (index.column() == ReadsColumn)
6061
return mRunners.at(index.row())->sequenceCount();
6162

sequence/abstractsequencereader.cpp

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -29,42 +29,13 @@ AbstractSequenceReader::AbstractSequenceReader(QIODevice *device)
2929
{
3030

3131

32-
}
33-
34-
int AbstractSequenceReader::percentComplete() const
35-
{
36-
if (totalSize() == 0)
37-
return 0;
38-
39-
quint64 percent = qFloor(qreal(mDevice->pos()) / totalSize() * 100);
40-
return percent;
41-
4232
}
4333

4434
const Sequence &AbstractSequenceReader::sequence() const
4535
{
4636
return mSequence;
4737
}
4838

49-
void AbstractSequenceReader::computeTotalSize()
50-
{
51-
if (mDevice->size() == 0) // sequential
52-
{
53-
while (!mDevice->atEnd())
54-
mDevice->readLine();
55-
mTotalSize = mDevice->pos();
56-
mDevice->seek(0);
57-
}
58-
else { // Random access
59-
mTotalSize = mDevice->size();
60-
}
61-
}
62-
63-
long long AbstractSequenceReader::totalSize() const
64-
{
65-
return mTotalSize;
66-
}
67-
6839
QIODevice *AbstractSequenceReader::device() const
6940
{
7041
return mDevice;

sequence/abstractsequencereader.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,6 @@ class AbstractSequenceReader
5050
* \return false if the file end has been reach.
5151
*/
5252
virtual bool next() = 0;
53-
/*!
54-
* \brief percentComplete return percent of bytes processed
55-
* \return a a value between 0 and 100
56-
*/
57-
virtual int percentComplete() const;
5853

5954
/*!
6055
* \brief Return the current sequence.
@@ -63,18 +58,13 @@ class AbstractSequenceReader
6358
*/
6459
const Sequence& sequence() const;
6560

66-
67-
void computeTotalSize() ;
68-
long long totalSize() const;
69-
7061
protected:
7162
void setSequence(const Sequence& seq);
7263
QIODevice * device() const;
7364

7465
private:
7566
QIODevice * mDevice;
7667
Sequence mSequence;
77-
long long mTotalSize = 0;
7868
};
7969

8070
#endif // ABSTRACTSEQUENCEREADER_H

ui/mainanalyseview.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ void MainAnalyseDelegate::paint(QPainter *painter, const QStyleOptionViewItem &o
2121

2222

2323
progressBarOption.minimum = 0;
24-
progressBarOption.maximum = 100;
24+
progressBarOption.maximum = progress == -1 ? 0 : 100;
2525
progressBarOption.textAlignment = Qt::AlignCenter;
2626
progressBarOption.progress = progress;
27-
progressBarOption.text = QString ( "%1%" ).arg ( progress );
27+
progressBarOption.text = progress == -1 ? QString("") : QString ( "%1%" ).arg ( progress );
2828
progressBarOption.textVisible = true;
2929
QApplication::style()->drawControl ( QStyle::CE_ProgressBar, &progressBarOption, painter );
3030

0 commit comments

Comments
 (0)