MIAOKUI / PSI

PSI calculation script
4 stars 4 forks source link

awk: cmd. line:1: (FILENAME=- FNR=14435) fatal: division by zero attempted #3

Open elisonigit opened 3 years ago

elisonigit commented 3 years ago

Hi,

So I am trying to use PSI.sh with a .bam file with nanopore reads(minimap2 aligner). I have created the bed file with regtools and I have followed the pipeline you mention in order to create the exonic part annotation.

I have tried all the PSI.sh scripts and I always end up with the same error. awk: cmd. line:1: (FILENAME=- FNR=14435) fatal: division by zero attempted

I tried to run it step by step and it crushes after the following command: paste exonic_parts.inclusion exonic_parts.exclusion|awk -v "len=$readLength" 'BEGIN{OFS="\t"; print "exon_ID" , "length" , "inclusion" , "exclusion" , "PSI"}{NIR=$6/($4+len-1) ; NER=$8/(len-1)}{print $5,$4,$6,$8,(NIR+NER<=0)? "NA":NIR / (NIR + NER)}' > exonic_parts.psi

My exonic_parts.inclusion file looks like this: 10 0000dabb-6d7b-41e5-b432-02438a3f7537 0 1 0,0,0 1 10 0000dabb-6d7b-41e5-b432-02438a3f7537 27 28 0,0,0 1 10 0001d84a-0fd4-4119-98fa-0abebfdd86b5 52 52 0,0,0 1 10 000289ad-bc34-479d-8f62-1c3af5bf2eb6 27 -261 0,0,0 1 10 000289ad-bc34-479d-8f62-1c3af5bf2eb6 60 -228 0,0,0 1 10 000289ad-bc34-479d-8f62-1c3af5bf2eb6 60 -228 0,0,0 1 1 00009fd5-05bc-4a5f-87e9-5e8b51fc7ab4 39 31 0,0,0 1 1 00009fd5-05bc-4a5f-87e9-5e8b51fc7ab4 60 52 0,0,0 1 10 000cb766-461e-4bc8-838b-09b3c44b8380 60 61 0,0,0 1 10 00132733-2de0-4238-b534-05b35ac5c77c 0 -132732 0,0,0 1

and the exonic_parts.exclusion like this: 001:ENSRNOT00000000006 0 001:ENSRNOT00000000008 0 001:ENSRNOT00000000009 0 001:ENSRNOT00000000010 0 001:ENSRNOT00000000011 0 001:ENSRNOT00000000013 0 001:ENSRNOT00000000015 0 001:ENSRNOT00000000018 0 001:ENSRNOT00000000022 0 001:ENSRNOT00000000025 0

The exonic_parts.gff file looks like this: 1 dexseq_prepare_annotation.py exonic_part 312155 312360 . + . 001:ENSRNOT00000046586+ENSRNOT00000044669+ENSRNOT00000073861 1 dexseq_prepare_annotation.py exonic_part 312361 312361 . + . 002:ENSRNOT00000046586 1 dexseq_prepare_annotation.py exonic_part 312365 312376 . + . 003:ENSRNOT00000046586 1 dexseq_prepare_annotation.py exonic_part 312378 312383 . + . 004:ENSRNOT00000046586 1 dexseq_prepare_annotation.py exonic_part 315197 315431 . + . 005:ENSRNOT00000044669 1 dexseq_prepare_annotation.py exonic_part 315435 315479 . + . 006:ENSRNOT00000044669 1 dexseq_prepare_annotation.py exonic_part 315933 316354 . + . 007:ENSRNOT00000073698+ENSRNOT00000044669 1 dexseq_prepare_annotation.py exonic_part 316355 316406 . + . 008:ENSRNOT00000044669 1 dexseq_prepare_annotation.py exonic_part 316408 316737 . + . 009:ENSRNOT00000044669 1 dexseq_prepare_annotation.py exonic_part 317591 317815 . + . 010:ENSRNOT00000044669

and the intron.bed file like this: 1 3551674 3552803 JUNC00000075 2 + 1 3552962 3560850 JUNC00000076 2 + 1 3560977 3561885 JUNC00000077 2 + 1 3562020 3562393 JUNC00000078 3 + 1 3562520 3563982 JUNC00000079 3 + 1 3611679 3614245 JUNC00000085 1 + 1 3618356 3624702 JUNC00000087 3 + 1 3624944 3625803 JUNC00000089 1 + 1 14515854 14516329 JUNC00001366 1 + 1 14516498 14516790 JUNC00001367 1 +

Thank you advance. Any help would be very much appreciated.