Skip to content

Commit

Permalink
distiguish between paired and already paired in readlist
Browse files Browse the repository at this point in the history
  • Loading branch information
tony-kuo committed Feb 19, 2020
1 parent 9558370 commit 5f2ec63
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions eagle-rc.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static int listonly;
static int readlist;
static int reclassify;
static int refonly;
static int paired;
static int paired, already_paired;
static int pao;
static int isc;
static int nodup;
Expand Down Expand Up @@ -349,7 +349,7 @@ static void bam_write(const char *bam_file, const char *output_prefix, char *oth
out = NULL;
char *name = (char *)aln->data;

if (paired) is_read2 = 0;
if (paired || already_paired) is_read2 = 0;
char key[strlen(name) + 3];
snprintf(key, strlen(name) + 3, "%s\t%d", name, is_read2);

Expand Down Expand Up @@ -433,6 +433,7 @@ static int readlist_read(FILE *file) {

int n;
int is_read2 = 0;
if (flag[0] == '-') already_paired = 1;

char *s, token[strlen(flag) + 1];
for (s = flag; sscanf(s, "%[^,]%n", token, &n) == 1; s += n + 1) {
Expand Down Expand Up @@ -729,6 +730,7 @@ int main(int argc, char **argv) {
reclassify = 0;
refonly = 0;
paired = 0;
already_paired = 0;
pao = 0;
isc = 0;
nodup = 0;
Expand Down Expand Up @@ -866,7 +868,7 @@ int main(int argc, char **argv) {
print_status("# Classified list: %s\t%i reads\t%s", filename, nreads, asctime(time_info));

if (paired) combine_pe();
if (paired || reclassify) readinfo_classify();
if (reclassify) readinfo_classify();
if (!listonly) bam_write(bam_file, output_prefix, other_bam, 0);
}
else {
Expand Down

0 comments on commit 5f2ec63

Please sign in to comment.