Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void update_read_name_for_Trinity(char* name, int comment_length, const char* comment) {
- // see if already in the old format:
- int name_len = strlen(name);
- if (name[name_len -2 ] == '/'
- &&
- (name[name_len - 1] == '1' || name[name_len - 1] == '2') ) {
- // already as expected.
- return;
- }
- // see if in the new format
- else if (comment_length > 1
- &&
- comment[1] == ':'
- &&
- (comment[0] == '1' || comment[0] == '2') ) {
- // recognized as new format. Convert to old format that trinity likes.
- name[name_len] = '/';
- name[name_len+1] = comment[0];
- name[name_len + 2] = '\0';
- }
- else {
- fprintf(stderr, "Error, not recognizing read name formatting: [%s]\n\nIf your data come from SRA, be sure to dump the fastq file like so:\n\n\tSRA_TOOLKIT/fastq-dump --defline-seq '@$sn[_$rn]/$ri' --split-files file.sra \n\n", name);
- exit(2);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement