steuernb / NLR-Annotator

NLR-Annotator upload
GNU General Public License v3.0
56 stars 24 forks source link

NLR-Parser | Exception in thread "main" java.lang.reflect.InvocationTargetException | Cause : java.lang.IllegalStateException #6

Closed fohebert closed 4 years ago

fohebert commented 4 years ago

Hi,

First of all, thanks for that awesome program. Can't wait to make it work. Here's my problem :

I have ~36,000 CDS (nucl) sequences that are part of a complex plant genome. I would like to screen those for NLR. First, I used the chopping script, which worked perfectly fine. Next, I tried to run NLR-Parser.jar on the chopped FASTA file. Since the number of sequences is quite large, I tried to use multiple CPUs. Here's my code :

# ENVIRONNMENTAL VARIABLES
NLR='/project/def-idjoly/shared/prg/NLR-annotator'
file='cs10.cds.chopped.fasta'

# RUNNING THE PROGRAM
java -jar ${NLR}/NLR-Parser.jar \
         -y /project/def-idjoly/shared/prg/meme/bin/mast \
         -x ${NLR}/meme.xml \
         -t 20  \
         -i 02.results/split_files/${file} \
         -c 02.results/split_files/${file%.fasta}.nlr.xml

When running this on a cluster (Compute Canada), I get the following error:

Using meme.xml from /project/def-idjoly/shared/prg/NLR-annotator
DEBUG: Temporary directory is /scratch/belial/02.NLR-annotator.example/temp_mast1
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.IllegalStateException: No match found
        at java.util.regex.Matcher.group(Matcher.java:536)
        at nlr_parser.MastEntry.<init>(MastEntry.java:31)
        at nlr_parser.MastXMLReader.readEntry(MastXMLReader.java:97)
        at nlr_parser.MastFile.readEntries(MastFile.java:44)
        at nlr_parser.MastFile.<init>(MastFile.java:39)
        at nlr_parser.MastParallelExecuter.executeMastDNA(MastParallelExecuter.java:148)
        at nlr_parser.NLRParser.<init>(NLRParser.java:46)
        at nlr_parser.NLRParser.main(NLRParser.java:193)
        ... 5 more

And it stalls there forever. I have to kill the job to make it stop.

I am definitely not an expert in java coding, so I'm a bit lost here, but it seems to be related to a regular expression pattern not found? I tried running mast on its own and it worked fine, i.e. the program was running on 1 CPU and not crashing, not outputting any error.

Any idea on what the problem could be? Any help would be tremendously appreciated!

Many thanks, FO

steuernb commented 4 years ago

Hi, thanks for giving it a try! If you have CDS, you can just run NLR-Parser. You do not need to chop the sequences up. That's only for long genomic fragments like chromosomes. What is the version of MAST you are using? If your version is newer than 2.9, you need an updated version of NLR-Parser (here: https://github.com/steuernb/NLR-Annotator/blob/nlr_parser3/NLR-Parser3.jar) Can you test the program on a set of few known NLRs, please? If that works, we need to figure out where the problems in the data set are.

fohebert commented 4 years ago

Totally my mistake, I thought I had the newer version already. I downloaded it and ran the parser on my sequences. I actually used the whole genome sequence and started all over again from the start. It worked super fine until the last step, i.e. NLR-Annotator.jar.

This is the commands that I used:

# Step 1
java -jar ${NLR}/ChopSequence.jar -i ${file} -o 02.results/${file%.fasta}.chopped.fasta

# Step 2
java -jar ${NLR}/NLR-Parser3.jar -t 20 -y ~/shared/prg/meme/bin/mast \
          -x ${NLR}/meme.xml \
          -i 02.results/${file%.fasta}.chopped.fasta \
          -c 02.results/${file%.fasta}.nlr.xml

# Step 3
java -jar ${NLR}/NLR-Annotator.jar -i 02.results/cs10.nlr.xml -o 02.results/${file%.fasta}.out.nlr.txt

And this is the message that I get when the script reaches STEP-3:

Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.NumberFormatException: For input string: ""
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
        at java.lang.Integer.parseInt(Integer.java:592)
        at java.lang.Integer.parseInt(Integer.java:615)
        at nlr_parser.MastMotifHit.<init>(MastMotifHit.java:66)
        at nlr_parser.MastMotifHitList.<init>(MastMotifHitList.java:59)
        at nlr_annotator.NLR_Annotator.readXML(NLR_Annotator.java:488)
        at nlr_annotator.NLR_Annotator.<init>(NLR_Annotator.java:70)
        at nlr_annotator.NLR_Annotator.main(NLR_Annotator.java:1921)
        ... 5 more
shankarkshakya commented 4 years ago

I got the same error pointed out by fohebert when running NLR-Annotator. Any lead on this issue? Thanks.

steuernb commented 4 years ago

Hi, could you please give me the meme version you are using? Could you try with this version of the jar file? https://github.com/steuernb/NLR-Annotator/blob/nlr_parser3/NLR-Annotator.jar, please? If the latter gives the same error, lets use this sequence for further debugging: ftp://ftp.arabidopsis.org/home/tair/Sequences/whole_chromosomes/TAIR10_chr1.fas - just to make sure there is no issue with your data set.

steuernb commented 4 years ago

I think I could reproduce it. This error comes up when you use the NLR-Parser3 together with the NLR-Annotator of the other branch. My appologies, I did not make that clear in the documentation. I will update it today. Could you please let me know if that solves your issue?

shankarkshakya commented 4 years ago

Hi Steuernb, Its working now. Thanks.

steuernb commented 4 years ago

does it work for you as well, @fohebert?

fohebert commented 4 years ago

Yes ! It works super good. Thanks so much for your time and your help, it's truly appreciated.

steuernb commented 4 years ago

Thanks! :-)