pachterlab / kma

Keep Me Around: Intron Retention Detection
GNU General Public License v2.0
29 stars 20 forks source link

Error in generate_introns.py. #23

Open zhengjiantao opened 5 years ago

zhengjiantao commented 5 years ago

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!

mdshw5 commented 5 years ago

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"?

zhengjiantao commented 5 years ago

@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~