YeoLab / eCLIP

Other
38 stars 26 forks source link

"R1 strand error 83/99" in overlap_peakfi_with_bam_PE.pl #21

Closed jy427 closed 2 years ago

jy427 commented 3 years ago

To one who may concern,

I got an error reminder when running 'input normalization', but I still got the output.

The command I use is as follows: perl overlap_peakfi_with_bam_PE.pl IP3-try_sort.rmDup.sort2.bam Input3-try_sort.rmDup.sort2.bam IP3-try_sort.rmDup.sort2.bed ip3_mapped_readnum.txt input3_mapped_readnum.txt merge_1.bed The error reminder showed

Use of uninitialized value $strand in concatenation (.) or string at overlap_peakfi_with_bam_PE.pl line 404, line 2435869. R1 strand error 83 Use of uninitialized value $strand in concatenation (.) or string at overlap_peakfi_with_bam_PE.pl line 404, line 2435872. R1 strand error 99

I checked one of the BAM files, and found that the second column contains 4 flags: 163, 147, 83 and 99, but line 307-313 of the script overlap_peakfi_with_bam_PE.pl does not include flag 83 and 99. my $frag_strand; if ($r1sam_flag == 147 || $r1sam_flag == 16) { $frag_strand = "-"; } elsif ($r1sam_flag == 163 || $r1sam_flag == 0) { $frag_strand = "+"; } else { print STDERR "R1 strand error $r1sam_flag\n"; } I tried to modify the code, enabling it to process flag 83 & 99, and run it without any error this time. my $frag_strand = ''; if ($r1sam_flag == 147 || $r1sam_flag == 16 || $r1sam_flag == 83) { $frag_strand = "-"; } elsif ($r1sam_flag == 163 || $r1sam_flag == 0 || $r1sam_flag == 99) { $frag_strand = "+";

Now there may exist three solutions: -Add support for flag 83 & 99 in the script -Remove these two flags from original .bam files before running this script -Simply neglect the error reminder which one would be the best?

byee4 commented 3 years ago

83 and 99 refer to first in pair reads. Please have a look at this issue and see if it helps clarify the problem: https://github.com/YeoLab/eclip/issues/8