Skip to content

Flair correct crashing on one specific read conversion on hsa chr7; v3.0.0.b1 #620

@semmrich

Description

@semmrich

We are running an ONT long-read RNA-Seq cohort of 82 samples with matching short-read RNA-Seq data to produce a FLAIR transcriptome. Below the center code of the sbatch script:

flair align \
  -r "$ONT_FASTQ" \
  -g "$GENOME" \
  -o "${OD}/${SAMPLE}" \
  -t ${SLURM_CPUS_PER_TASK:-8}

flair correct \
  -q "${OD}/${SAMPLE}.bed" \
  -f "$GTF" \
  --junction_tab "$SJ_TAB" \
  -o "${OD}/${SAMPLE}" \
  -t ${SLURM_CPUS_PER_TASK:-8}

One sample crashed on one bad line in a temp.bed file, below the complete error msg:

total alignments in bam file (includes unaligned reads): 14594009
total alignments in bam file (includes unaligned reads): 14594009
total non-secondary alignments: 14594009
total non-secondary alignments: 14594009
total primary alignments with quality >= 0: 13316995
total primary alignments with quality >= 0: 13316995
total supplementary alignments with quality >= 0: 1277014
total supplementary alignments with quality >= 0: 1277014
Flair align took 5:17:28
Flair align took 5:17:28
Read skipped: Conversion of 1cbacdf8-8a75-4f57-a94d-c5bf70a940ea chr7:44961701-44961929 to junctions failed
Error: juncsToBed12 ss1/ss2. Please report problem at https://github.com/BrooksLabUCSC/flair/issues
multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/home/storage/resources/tools/flair_3.0.0b1/lib/python3.12/site-packages/flair/ssPrep.py", line 430, in ssPrep
    correctReads(readsBed, intervalTree, junctionBoundaryDict, chrom, resolveStrand, workingDir, chrom, errFile)
  File "/home/storage/resources/tools/flair_3.0.0b1/lib/python3.12/site-packages/flair/ssPrep.py", line 308, in correctReads
    minSize = min(sizes)
              ^^^^^^^^^^
TypeError: 'NoneType' object is not iterable

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/storage/resources/tools/flair_3.0.0b1/lib/python3.12/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
                    ^^^^^^^^^^^^^^^^^^^
  File "/home/storage/resources/tools/flair_3.0.0b1/lib/python3.12/site-packages/flair/ssPrep.py", line 432, in ssPrep
    raise Exception("** correctReads FAILED for %s" % (readsBed)) from ex
Exception: ** correctReads FAILED for /home/storage/projects/isoforms/ens115_assembly/FLAIR_v3/6405d1f8-a413-446c-8fa2-2bb9c37c1710/chr7_temp_reads.bed
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/storage/resources/tools/flair_3.0.0b1/lib/python3.12/site-packages/flair/flair_cli.py", line 85, in main
    flair_module_run(opts, args.module, args.module_args)
  File "/home/storage/resources/tools/flair_3.0.0b1/lib/python3.12/site-packages/flair/flair_cli.py", line 52, in flair_module_run
    correct()
  File "/home/storage/resources/tools/flair_3.0.0b1/lib/python3.12/site-packages/flair/flair_correct.py", line 175, in correct
    for i in p.imap(ssPrep,cmds):
             ^^^^^^^^^^^^^^^^^^^
  File "/home/storage/resources/tools/flair_3.0.0b1/lib/python3.12/multiprocessing/pool.py", line 873, in next
    raise value
Exception: ** correctReads FAILED for /home/storage/projects/isoforms/ens115_assembly/FLAIR_v3/6405d1f8-a413-446c-8fa2-2bb9c37c1710/chr7_temp_reads.bed
Exception ignored in: <function Pool.__del__ at 0x7f0bb0dab240>
Traceback (most recent call last):
  File "/home/storage/resources/tools/flair_3.0.0b1/lib/python3.12/multiprocessing/pool.py", line 271, in __del__
    self._change_notifier.put(None)
  File "/home/storage/resources/tools/flair_3.0.0b1/lib/python3.12/multiprocessing/queues.py", line 399, in put
    self._writer.send_bytes(obj)
  File "/home/storage/resources/tools/flair_3.0.0b1/lib/python3.12/multiprocessing/connection.py", line 200, in send_bytes
    self._send_bytes(m[offset:offset + size])
  File "/home/storage/resources/tools/flair_3.0.0b1/lib/python3.12/multiprocessing/connection.py", line 427, in _send_bytes
    self._send(header + buf)
  File "/home/storage/resources/tools/flair_3.0.0b1/lib/python3.12/multiprocessing/connection.py", line 384, in _send
    n = write(self._handle, buf)
        ^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 9] Bad file descriptor

Interestingly, when running FLAIR v2.0.0 the same sample mate pair run through just fine.

Below I have peeked the temp.bed file in question and grepped the bad line just FYI:

head ~/debug/chr7_temp_reads.bed 
chr7	22458	26167	7d85b770-6d81-43a2-8da2-be85dfeb6576	1	-	22458	26167	217,95,2	21520,1733,	0,1976,
chr7	23597	25308	6687fce4-fed3-4a1d-8117-b196cc47eeab	1	+	23597	25308	27,158,119	2413,845,	0,866,
chr7	27533	27733	fba4a588-fc89-4296-abd4-c846680e78e5	0	-	27533	27733	99,99,99	1200,	0,
chr7	27533	27733	60490037-541c-40fb-95ae-05ce47027a44	0	-	27533	27733	99,99,99	1200,	0,
chr7	28427	30322	75ad9edc-0a54-4acc-9aea-a67b42b88a9a	0	+	28427	30322	99,99,99	11895,	0,
chr7	31059	31248	31239e31-0b72-4d38-9c5e-c11d80320754	0	-	31059	31248	99,99,99	1189,	0,
chr7	33565	33753	f709bf34-d8fc-48ce-9b61-823bc3acbf63	28	-	33565	33753	99,99,99	1188,	0,
chr7	35091	35286	8c2ab4eb-5f0a-40c7-8738-0f84b7699b4d	11	+	35091	35286	99,99,99	1195,	0,
chr7	35091	36580	8abb608c-654d-489b-b776-ffff90648765	1	+	35091	36580	27,158,119	3195,205,445,	0,724,1044,
chr7	35377	36569	a2ddeddd-f164-4946-80cd-0f5fe4b32e55	3	-	35377	36569	99,99,99	11192,	0,

grep '1cbacdf8-8a75-4f57-a94d-c5bf70a940ea' /home/storage/projects/isoforms/ens115_assembly/FLAIR_v3/00105P01/isoforms/00105P01.bed
chr7	44961701	44961929	1cbacdf8-8a75-4f57-a94d-c5bf70a940ea	60	+	44961701	44961929	99,99,99	2	19,179,	0,49,

tail ~/debug/chr7_temp_reads.bed 
chr7	158976705	158977372	ca9f40a5-9b94-4784-a64a-983168913987	60	+	158976705	158977372	99,99,99	1	667,	0,
chr7	158976705	158977372	d39f28d3-30bc-4c73-aabd-e7087e955eb4	60	+	158976705	158977372	99,99,99	1	667,	0,
chr7	158976705	158977375	2c96b8d4-0d1d-4279-9449-df99b80aa563	60	+	158976705	158977375	99,99,99	1	670,	0,
chr7	158976709	158977380	2da1bf53-7d14-4a29-91d9-f462b0660f70	60	+	158976709	158977380	99,99,99	1	671,	0,
chr7	158976725	158977374	f12082cd-9448-4d83-ba09-828ff9bd441a	60	-	158976725	158977374	99,99,99	1	649,	0,
chr7	158976935	158977022	f6080973-4ded-4372-b34b-2ed3669ef80a	21	+	158976935	158977022	99,99,99	1	87,	0,
chr7	158976942	158977326	bcfcd96d-3ca5-4df2-a263-ed93d128bb78	60	-	158976942	158977326	99,99,99	1	384,	0,
chr7	158977108	158977450	f28f606a-1c2c-4045-b649-ffe02ee865e4	60	+	158977108	158977450	99,99,99	1	342,	0,
chr7	158977119	158977885	8b24eae8-b8cf-4e1a-a67b-5c330478ba36	60	+	158977119	158977885	27,158,119	2	24,608,	0,158,
chr7	159070336	159070598	2ce8e690-75ca-496a-827c-9917e2918543	60	+	159070336	159070598	99,99,99	1	262,	0,

Hope this helps.

FLAIR is awesome, Thx so much for this superb tool!

Viele Grüße aus ffm Deutschland :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions