X-Git-Url: https://git.donarmstrong.com/?p=rsem.git;a=blobdiff_plain;f=Transcript.h;h=f7afa2b20542ebdb2f4883d1cc12631eb2b1176e;hp=8d7be7ae68afae09c773144e45db4ba79b81b36f;hb=92b24279a3ecc72946e7e7c23149ad0d181f373a;hpb=37513308b7557ae65899e59df8e43b5dec90da5c diff --git a/Transcript.h b/Transcript.h index 8d7be7a..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<