uint16_t rstrand = b->core.flag & 0x0010; // read strand
b->core.flag -= rstrand;
- rstrand = (!rstrand && transcript.getStrand() == '+' || rstrand && transcript.getStrand() == '-' ? 0 : 0x0010);
+ rstrand = (((!rstrand && transcript.getStrand() == '+') || (rstrand && transcript.getStrand() == '-')) ? 0 : 0x0010);
b->core.flag += rstrand;
push_qname(qname, b->core.l_qname, data);
b2->core.flag = b2->core.flag - (b2->core.flag & 0x0010) - (b2->core.flag & 0x0020);
uint16_t add, add2;
- if (!rstrand && transcript.getStrand() == '+' || rstrand && transcript.getStrand() == '-') {
+ if ((!rstrand && transcript.getStrand() == '+') || (rstrand && transcript.getStrand() == '-')) {
add = 0x0020; add2 = 0x0010;
}
else {
}
if (verbose) printf("ROUND = %d, SUM = %.15g, bChange = %f, totNum = %d\n", ROUND, sum, bChange, totNum);
- } while (ROUND < MIN_ROUND || totNum > 0 && ROUND < MAX_ROUND);
+ } while (ROUND < MIN_ROUND || (totNum > 0 && ROUND < MAX_ROUND));
//while (ROUND < MAX_ROUND);
if (totNum > 0) fprintf(stderr, "Warning: RSEM reaches %d iterations before meeting the convergence criteria.\n", MAX_ROUND);
};
QProfile::QProfile() {
- memset(p, sizeof(p), 0);
+ memset(p, 0, sizeof(p));
//make initialized parameters
//ASSUME order of A, C, G, T, N
}
bool isValid(int sid, int dir, int pos, const std::string& readseq, int LEN, int C) {
- if (sid <= 0 || sid > M || dir != 0 && dir != 1 || pos < 0 || pos + LEN > seqs[sid].getTotLen() || LEN > (int)readseq.length()) return false;
+ if (sid <= 0 || sid > M || (dir != 0 && dir != 1) || pos < 0 || pos + LEN > seqs[sid].getTotLen() || LEN > (int)readseq.length()) return false;
const std::string& seq = seqs[sid].getSeq(dir);
return countMismatch(seq, pos, readseq, LEN, C) <= C;
}
}
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);
}
const std::string& getTranscriptID() const { return transcript_id; }
int start = items[i].getStart();
int end = items[i].getEnd();
- assert(strand == items[i].getStrand());
- assert(seqname == items[i].getSeqName());
+ if (strand != items[i].getStrand()) {
+ fprintf(stderr, "According to the GTF file given, a transcript has exons from different orientations!\n");
+ exit(-1);
+ }
+ if (seqname != items[i].getSeqName()) {
+ fprintf(stderr, "According to the GTF file given, a transcript has exons on multiple chromosomes!\n");
+ exit(-1);
+ }
if (cur_e + 1 < start) {
if (cur_s > 0) vec.push_back(Interval(cur_s, cur_e));
}
int main(int argc, char* argv[]) {
- if (argc < 6 || (hasMappingFile = atoi(argv[4])) && argc < 7) {
+ if (argc < 6 || ((hasMappingFile = atoi(argv[4])) && argc < 7)) {
printf("Usage: rsem-extract-reference-transcripts refName quiet gtfF hasMappingFile [mappingFile] chromosome_file_1 [chromosome_file_2 ...]\n");
exit(-1);
}
}
int main(int argc, char* argv[]) {
- if (argc < 5 || (hasMappingFile = atoi(argv[3])) && argc < 6) {
+ if (argc < 5 || ((hasMappingFile = atoi(argv[3])) && argc < 6)) {
printf("Usage: synthesisRef refName quiet hasMappingFile [mappingFile] reference_file_1 [reference_file_2 ...]\n");
exit(-1);
}