X-Git-Url: https://git.donarmstrong.com/?p=rsem.git;a=blobdiff_plain;f=Transcript.h;h=f7afa2b20542ebdb2f4883d1cc12631eb2b1176e;hp=ea621f3072b98ca16c7b6d6f4e195f10e8ebb624;hb=910250881a4c3e48a33aa427b82131acda914da3;hpb=a95154919f950f86de9104b2b9dcf1f0c7e83387 diff --git a/Transcript.h b/Transcript.h index ea621f3..f7afa2b 100644 --- a/Transcript.h +++ b/Transcript.h @@ -10,6 +10,10 @@ #include "utils.h" +/** + If no genome is provided, seqname field is used to store the allele name. + */ + struct Interval { int start, end; @@ -49,7 +53,7 @@ public: } bool operator< (const Transcript& o) const { - return gene_id < o.gene_id || gene_id == o.gene_id && transcript_id < o.transcript_id; + return gene_id < o.gene_id || (gene_id == o.gene_id && transcript_id < o.transcript_id) || (gene_id == o.gene_id && transcript_id == o.transcript_id && seqname < o.seqname); } const std::string& getTranscriptID() const { return transcript_id; } @@ -113,7 +117,10 @@ void Transcript::read(std::ifstream& fin) { int s; std::string tmp; - fin>>transcript_id>>gene_id>>seqname>>tmp>>length; + getline(fin, transcript_id); + getline(fin, gene_id); + getline(fin, seqname); + fin>>tmp>>length; assert(tmp.length() == 1 && (tmp[0] == '+' || tmp[0] == '-')); strand = tmp[0]; structure.clear(); @@ -130,7 +137,10 @@ void Transcript::read(std::ifstream& fin) { void Transcript::write(std::ofstream& fout) { int s = structure.size(); - fout<