kma icon indicating copy to clipboard operation
kma copied to clipboard

Error in generate_introns.py.

Open zhengjiantao opened this issue 6 years ago • 2 comments

when I run this command : python $PRE/generate_introns.py --genome $path_fa --gtf $path_gtf --extend 25 --out results/kma

I got the following error: Traceback (most recent call last): File "/home/zhengjt/R/x86_64-pc-linux-gnu-library/3.4/kma/pre-process/generate_introns.py", line 154, in main() File "/home/zhengjt/R/x86_64-pc-linux-gnu-library/3.4/kma/pre-process/generate_introns.py", line 151, in main bed_to_introns(bed_out, args.genome, introns_out) File "/home/zhengjt/R/x86_64-pc-linux-gnu-library/3.4/kma/pre-process/generate_introns.py", line 55, in bed_to_introns seq = fasta[ref][int(start):int(stop)] File "/home/zhengjt/.local/lib/python2.7/site-packages/pyfasta/fasta.py", line 128, in getitem c = self.index[i] KeyError: 'MG4136_PATCH'

My fasta file is : Mus_musculus.GRCm38.75.dna.SORTED.fa part of file:

1 dna:chromosome chromosome:GRCm38:1:1:195471971:1 REF NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN

Help please... Thanks Advanced!

zhengjiantao avatar Dec 22 '18 07:12 zhengjiantao

It looks like your GTF references gene models that are on patch contigs. You might be using the wrong genome assembly then (your gene models in the GTF need to match the specific assembly coordinates and contig names). Maybe try a UCSC assembly with patches. Do your GTF chromosome names start with "chr"?

mdshw5 avatar Dec 24 '18 14:12 mdshw5

@mdshw5 Thanks you for your time! I‘ve solved it. Cause my gtf file have some new patch comments made in recent years and not in fasta file. So I got this error. After I delete these patch annotation and retain only main chr, I solve this problem perfectly. Happy! Thank you again for your reply! best wishes~

zhengjiantao avatar Dec 25 '18 01:12 zhengjiantao