Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dridk committed Jan 21, 2018
0 parents commit 0d4771a
Show file tree
Hide file tree
Showing 694 changed files with 321,506 additions and 0 deletions.
48 changes: 48 additions & 0 deletions bamviewer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#include "bamviewer.h"

BamViewer::BamViewer(QObject *parent)
{



}

void BamViewer::setFilename(const QString &filename)
{
QFileInfo info(filename);
mFilename = info.absoluteFilePath();

QString s = "/home/sacha/exemple.sam";
qDebug()<<QFile::exists(s);

BamFileIn file(s.toStdString().c_str());


BamHeader header;
readHeader(header,file);

while (!atEnd(file))
{
BamAlignmentRecord record;

readRecord(record, file);

qDebug()<<record.beginPos;


}





}

void BamViewer::paintEvent(QPaintEvent *event)
{
Q_UNUSED(event)
QPainter painter(viewport());



}
31 changes: 31 additions & 0 deletions bamviewer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#ifndef BAMVIEWER_H
#define BAMVIEWER_H
#include <QAbstractScrollArea>
#include <QPainter>
#include <QtCore>
#include <zlib.h>

#include "seqan/bam_io.h"
#include <iostream>

#define SEQAN_HAS_ZLIB 1

using namespace seqan;

class BamViewer : public QAbstractScrollArea
{
public:
BamViewer(QObject * parent = nullptr);

void setFilename(const QString& filename);

protected:

void paintEvent(QPaintEvent * event) override;

private:
QString mFilename;

};

#endif // BAMVIEWER_H
39 changes: 39 additions & 0 deletions bamviewer.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#-------------------------------------------------
#
# Project created by QtCreator 2018-01-21T16:57:25
#
#-------------------------------------------------

QT += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = bamviewer
TEMPLATE = app

# The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

CONFIG+= c++14

SOURCES += \
main.cpp \
mainwindow.cpp \
bamviewer.cpp

HEADERS += \
mainwindow.h \
bamviewer.h

FORMS += \
mainwindow.ui

LIBS+= -lz
11 changes: 11 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "mainwindow.h"
#include <QApplication>

int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();

return a.exec();
}
18 changes: 18 additions & 0 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent)
{

mViewer = new BamViewer;

mViewer->setFilename("/home/sacha/exemple.bam");


setCentralWidget(mViewer);
}

MainWindow::~MainWindow()
{
}
20 changes: 20 additions & 0 deletions mainwindow.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "bamviewer.h"


class MainWindow : public QMainWindow
{
Q_OBJECT

public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();

private:
BamViewer * mViewer;
};

#endif // MAINWINDOW_H
24 changes: 24 additions & 0 deletions mainwindow.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle" >
<string>MainWindow</string>
</property>
<widget class="QMenuBar" name="menuBar" />
<widget class="QToolBar" name="mainToolBar" />
<widget class="QWidget" name="centralWidget" />
<widget class="QStatusBar" name="statusBar" />
</widget>
<layoutDefault spacing="6" margin="11" />
<pixmapfunction></pixmapfunction>
<resources/>
<connections/>
</ui>
27 changes: 27 additions & 0 deletions seqan/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright (c) 2006-2016, Knut Reinert, FU Berlin
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* 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.
* Neither the name of Knut Reinert or the FU Berlin nor the names of
its contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

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

Loading

0 comments on commit 0d4771a

Please sign in to comment.