1 |
gpertea |
165 |
// |
2 |
|
|
// gtfToFasta.h |
3 |
|
|
// TopHat |
4 |
|
|
// |
5 |
|
|
// Created by Harold Pimentel on 10/26/11. |
6 |
|
|
// Copyright 2011 __MyCompanyName__. All rights reserved. |
7 |
|
|
// |
8 |
|
|
|
9 |
|
|
#ifndef GTFToFasta_H |
10 |
|
|
#define GTFToFasta_H |
11 |
|
|
|
12 |
|
|
#ifdef HAVE_CONFIG_H |
13 |
|
|
#include <config.h> |
14 |
|
|
#endif |
15 |
|
|
|
16 |
|
|
#include <cassert> |
17 |
|
|
#include <cstdlib> |
18 |
|
|
#include <cstring> |
19 |
|
|
#include <fstream> |
20 |
|
|
#include <iostream> |
21 |
|
|
#include <map> |
22 |
|
|
#include <string> |
23 |
|
|
#include <sstream> |
24 |
|
|
#include <utility> |
25 |
|
|
#include <vector> |
26 |
|
|
|
27 |
|
|
#include "common.h" |
28 |
|
|
#include "gff.h" |
29 |
|
|
#include "GFaSeqGet.h" |
30 |
|
|
#include "FastaTools.h" |
31 |
|
|
|
32 |
|
|
std::string get_exonic_sequence(GffObj *p_trans, FastaRecord *rec); |
33 |
|
|
|
34 |
|
|
class GTFToFasta { |
35 |
|
|
public: |
36 |
|
|
GTFToFasta(std::string gtf_fname, std::string genome_fname); |
37 |
|
|
~GTFToFasta(); |
38 |
|
|
void make_transcriptome(std::string out_fname); |
39 |
|
|
|
40 |
|
|
// for debugging |
41 |
|
|
void print_mapping(); |
42 |
|
|
private: |
43 |
|
|
GffReader gtfReader_; |
44 |
|
|
GFaSeqGet genome_fhandle_; |
45 |
|
|
|
46 |
|
|
std::string gtf_fname_; |
47 |
|
|
std::string genome_fname_; |
48 |
|
|
|
49 |
|
|
FILE* gtf_fhandle_; |
50 |
|
|
|
51 |
|
|
// "contig" => vector(index_of_gff_obj) |
52 |
|
|
// typedef std::map<const char* , std::vector< size_t >* > ContigTransMap; |
53 |
|
|
typedef std::map<std::string, std::vector< size_t >* > ContigTransMap; |
54 |
|
|
ContigTransMap contigTransMap_; |
55 |
|
|
|
56 |
|
|
void transcript_map(); |
57 |
|
|
|
58 |
|
|
GTFToFasta(); // Don't want anyone calling the constructor w/o options |
59 |
|
|
}; |
60 |
|
|
|
61 |
|
|
#endif |