~ubuntu-branches/debian/jessie/ugene/jessie

« back to all changes in this revision

Viewing changes to src/include/U2Core/U2SequenceDbi.h

  • Committer: Package Import Robot
  • Author(s): Steffen Moeller
  • Date: 2011-11-02 13:29:07 UTC
  • mfrom: (1.2.1) (3.1.11 natty)
  • Revision ID: package-import@ubuntu.com-20111102132907-o34gwnt0uj5g6hen
Tags: 1.9.8+repack-1
* First release to Debian
  - added README.Debian
  - increased policy version to 3.9.2
  - added URLs for version control system
* Added debug package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * UGENE - Integrated Bioinformatics Tools.
 
3
 * Copyright (C) 2008-2011 UniPro <ugene@unipro.ru>
 
4
 * http://ugene.unipro.ru
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the GNU General Public License
 
8
 * as published by the Free Software Foundation; either version 2
 
9
 * of the License, or (at your option) any later version.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program; if not, write to the Free Software
 
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 
19
 * MA 02110-1301, USA.
 
20
 */
 
21
 
 
22
#ifndef _U2_SEQUENCE_DBI_H_
 
23
#define _U2_SEQUENCE_DBI_H_
 
24
 
 
25
#include <U2Core/U2Type.h>
 
26
#include <U2Core/U2Dbi.h>
 
27
#include <U2Core/U2Sequence.h>
 
28
 
 
29
namespace U2 {
 
30
 
 
31
/**
 
32
    An interface to access to sequence objects
 
33
*/
 
34
class U2CORE_EXPORT U2SequenceDbi : public U2ChildDbi {
 
35
protected:
 
36
    U2SequenceDbi(U2Dbi* rootDbi) : U2ChildDbi(rootDbi){}
 
37
 
 
38
public:
 
39
    /** 
 
40
        Reads sequence object from database by its id.
 
41
        If there is no sequence object with the specified id returns a default constructed value.
 
42
    */
 
43
    virtual U2Sequence getSequenceObject(const U2DataId& sequenceId, U2OpStatus& os) = 0;
 
44
    
 
45
    /**  
 
46
        Reads specified sequence data region from database.
 
47
        The region must be valid region within sequence bounds.
 
48
        If there is no sequence with the specified id returns an empty QByteArray.
 
49
    */
 
50
    virtual QByteArray getSequenceData(const U2DataId& sequenceId, const U2Region& region, U2OpStatus& os) = 0;
 
51
 
 
52
    /**
 
53
        Adds a new (empty) sequence instance into database.
 
54
        Sets the assigned id to the passed U2Sequence instance.
 
55
        The folder must exist in the database.
 
56
 
 
57
        Note: Use 'updateSequenceData' method to supply data to the created sequence.
 
58
 
 
59
        Requires: U2DbiFeature_WriteSequence feature support
 
60
    */
 
61
    virtual void createSequenceObject(U2Sequence& sequence, const QString& folder, U2OpStatus& os) = 0;
 
62
 
 
63
    /** 
 
64
        Updates sequence region:
 
65
        replaces 'regionToReplace' sequence region with 'dataToInsert'.
 
66
 
 
67
        Note: 'regionToReplace' length can differ from dataToInsert length, so the method
 
68
        can be used to insert/remove sequence regions.
 
69
 
 
70
        WARNING: The passed region 'startPos' has to be between 0 and sequence length inclusive.
 
71
        If the sequence is empty 'regionToReplace.startPos' has to be 0.
 
72
 
 
73
        //TODO think about annotations: should we fix locations automatically?? If yes, emit notifications??
 
74
        // varlax: I think this should be left to user, no automatic fixes.
 
75
 
 
76
        Requires: U2DbiFeature_WriteSequence feature support
 
77
    */
 
78
    virtual void updateSequenceData(const U2DataId& sequenceId, const U2Region& regionToReplace, const QByteArray& dataToInsert, U2OpStatus& os) = 0;
 
79
};
 
80
 
 
81
 
 
82
} //namespace
 
83
 
 
84
#endif