12 Isoform id starts from 1 !
20 exceptionList.clear();
23 //Assume parameters are valid here
24 PolyARules(int polyAChoice, int polyALen, char* exceptionF) {
25 this->polyAChoice = polyAChoice;
26 this->polyALen = polyALen;
28 if (polyAChoice == 2) {
29 exceptionList.clear();
31 std::string transcript_id;
32 std::ifstream fin(exceptionF);
33 if (!fin.is_open()) { fprintf(stderr, "Cannot open %s! It may not exist.\n", exceptionF); exit(-1); }
35 while (fin>> transcript_id) {
36 exceptionList.insert(transcript_id);
43 //get the length of padding poly As
44 int getLenAt(const std::string& transcript_id) {
46 case 0 : return polyALen;
48 case 2 : iter = exceptionList.find(transcript_id);
49 return (iter == exceptionList.end() ? polyALen : 0);
50 default : assert(false);
55 int polyAChoice; // 0, pad; 1, do not pad; 2 pad all but those in exceptionList
57 std::set<std::string> exceptionList; // exception list of transcript_ids
58 std::set<std::string>::iterator iter;