Intron clustering error

142 views
Skip to first unread message

Bio Comp

unread,
Oct 28, 2020, 2:33:33 AM10/28/20
to leafcutter-users
Dear leafcutter users

Hello this is KyoungJun Lee who is new to leafcutter.
There is an index error during intron clustering but I could not catch the reason.
the command was:
python leafcutter_cluster_regtools.py --checkchrom -j juncs23.txt -m 50 -o ko23 -l 500000

and the result was shown as below:

scanning E100004016_L01_1_.junc...
scanning E100004016_L01_2_.junc...
scanning E100004016_L01_3_.junc...
scanningE100004016_L01_4_.junc...
scanning E100004016_L01_25.junc...
scanningE100004016_L01_33.junc...
Parsing...
chrX:-..chr22:-..chr11:-..chr15:-..chr18:+..chr3:-..chr16:+..chr5:-..chr20:+..chr19:-..chr13:+..chr8:-..chrY:+..Traceback (most recent call last):
  File "leafcutter_cluster_regtools.py", line 534, in <module>
    main(options, libl)
  File "leafcutter_cluster_regtools.py", line 14, in main
    pool_junc_reads(libl, options)
  File "leafcutter_cluster_regtools.py", line 72, in pool_junc_reads
    clu = cluster_intervals(read_ks)[0]
  File "leafcutter_cluster_regtools.py", line 337, in cluster_intervals
    current = E[0]
IndexError: list index out of range

Despite the --checkchrom option, it still give the same error. could you give any suggestion?
Thank you in advance.

KyoungJun

countja...@gmail.com

unread,
Nov 1, 2020, 6:17:49 PM11/1/20
to leafcutter-users
Hi KyoungJun,

this is a known issue and I've made a pull request to fix it: https://github.com/davidaknowles/leafcutter/pull/162 

The issue is caused by regtools assigning a "?" in the stand field to a small minority of your junctions.

Currently, there are two solutions:

1) rerun regtools junctions extract using the correct stranding parameter for your libraries (-s 1 or -s 2, see regtools documentation)

2) manually remove lines in your junction file with "?" by using something like 'grep -v "?" file.junc > new_file.junc'


best wishes,

Jack

Елена Шарова

unread,
Nov 8, 2020, 8:56:54 PM11/8/20
to leafcutter-users
-s 1 or 2 for stranded libraries doesn't help - I tried. I still receive  errors

Елена Шарова

unread,
Nov 8, 2020, 10:21:42 PM11/8/20
to leafcutter-users
I tried to ignore non-canonical chromosomes by adding -checkchrom  
IOError: No such file o directory 'heckchrom'

countja...@gmail.com

unread,
Nov 9, 2020, 9:07:36 AM11/9/20
to leafcutter-users
Hi,

firstly you need two dashes for adding arguments with more than one letter so it should be "--checkchrom".

secondly, if you still get errors with regtools -s 1 or -2, manually remove the "?" lines from your junctions. 

If your junction files are all files ending in .junc you could do this:

for i in *junc; do
grep -v "?" $i > ${i}.trimmed.junc
done

best wishes,

Jack

Елена Шарова

unread,
Nov 9, 2020, 1:06:31 PM11/9/20
to leafcutter-users
I don't have lines with "?"  - I checked it
Two dashes works - thanks a lot!

countja...@gmail.com

unread,
Nov 9, 2020, 1:11:02 PM11/9/20
to leafcutter-users
wonderful to hear!
Reply all
Reply to author
Forward
0 new messages