Skip to content

Commit

Permalink
Fixed a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo Li committed Nov 11, 2015
1 parent 308e5b6 commit 25a74f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Transcript.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void Transcript::read(std::ifstream& fin) {
strin>> transcript_id>> transcript_name;

getline(fin, tmp);
strin.str(tmp);
strin.clear(); strin.str(tmp);
strin>> gene_id>> gene_name;

getline(fin, seqname);
Expand Down
9 changes: 7 additions & 2 deletions WriteResults.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,11 @@ void writeResultsEM(int M, const char* refName, const char* imdName, Transcripts
}
for (int i = 1; i <= M; i++) {
const Transcript& transcript = transcripts.getTranscriptAt(i);
fprintf(fo, "%s%c", transcript.getGeneID().c_str(), (i < M ? '\t' : '\n'));

fprintf(fo, "%s", transcript.getGeneID().c_str());
if (appendNames && transcript.getGeneName() != "")
fprintf(fo, "_%s", transcript.getGeneName().c_str());
fprintf(fo, "%c", (i < M ? '\t' : '\n'));
}
for (int i = 1; i <= M; i++)
fprintf(fo, "%d%c", tlens[i], (i < M ? '\t' : '\n'));
Expand Down Expand Up @@ -313,7 +317,8 @@ void writeResultsEM(int M, const char* refName, const char* imdName, Transcripts
const Transcript& transcript = transcripts.getTranscriptAt(gi.spAt(i));

fprintf(fo, "%s", transcript.getGeneID().c_str());
if (appendNames && transcript.getGeneName() != "") fprintf(fo, "_%s", transcript.getGeneName().c_str());
if (appendNames && transcript.getGeneName() != "")
fprintf(fo, "_%s", transcript.getGeneName().c_str());
fprintf(fo, "%c", (i < m - 1 ? '\t' : '\n'));
}
for (int i = 0; i < m; i++) {
Expand Down

0 comments on commit 25a74f0

Please sign in to comment.