map<string, string> name2seq;
map<string, string>::iterator iter;
-Transcripts transcripts;
-char groupF[STRLEN], tiF[STRLEN], refFastaF[STRLEN];
+Transcripts transcripts(1); // no genome, just transcript set
+char groupF[STRLEN], tiF[STRLEN], refFastaF[STRLEN], chromListF[STRLEN];
bool hasMappingFile;
char mappingFile[STRLEN];
}
void writeResults(char* refName) {
- ofstream fout;
+ ofstream fout, fout2;
string cur_gene_id, name;
sprintf(groupF, "%s.grp", refName);
sprintf(tiF, "%s.ti", refName);
sprintf(refFastaF, "%s.transcripts.fa", refName);
+ sprintf(chromListF, "%s.chrlist", refName);
transcripts.writeTo(tiF);
if (verbose) { printf("Transcript Information File is generated!\n"); }
fout.close();
if (verbose) { printf("Group File is generated!\n"); }
- // We have to generate this .transcripts.fa, even reference_file is only one. Reason : polyA choice 2, need ">transcript_id"
+ fout2.open(chromListF);
fout.open(refFastaF);
for (int i = 1; i <= M; i++) {
name = transcripts.getTranscriptAt(i).getTranscriptID();
}
fout<<">"<<name<<endl;
fout<<iter->second<<endl;
+
+ fout2<<name<<'\t'<<iter->second.length()<<endl;
}
fout.close();
- if (verbose) { printf("Extracted Sequences File is generated!\n"); }
+ fout2.close();
+
+ if (verbose) {
+ printf("Chromosome List File is generated!\n");
+ printf("Extracted Sequences File is generated!\n");
+ }
}
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);
}