Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task :vcf2bam FAILED #239

Open
liyaron opened this issue Sep 17, 2023 · 16 comments
Open

Task :vcf2bam FAILED #239

liyaron opened this issue Sep 17, 2023 · 16 comments

Comments

@liyaron
Copy link

liyaron commented Sep 17, 2023

When I try ./gradlew vcf2bam, it always reports an error

[ant:javac] /lustre/sdb/zhangyaoz/lyr/software/jvarkit/src/main/java/com/github/lindenb/jvarkit/tools/vcf2bam/VcfToBam.java:27: error: cannot access Cigar
[ant:javac] import htsjdk.samtools.Cigar;
[ant:javac] ^
[ant:javac] bad class file: /lustre/sdb/zhangyaoz/lyr/software/jvarkit/lib/com/github/samtools/htsjdk/4.0.1/htsjdk-4.0.1.jar(htsjdk/samtools/Cigar.class)
[ant:javac] class file has wrong version 61.0, should be 52.0
[ant:javac] Please remove or make sure it appears in the correct subdirectory of the classpath.

Task :vcf2bam FAILED

FAILURE: Build failed with an exception.

  • Where:
    Build file '/lustre/sdb/zhangyaoz/lyr/software/jvarkit/build.gradle' line: 731

  • What went wrong:
    Execution failed for vcf2bam com.github.lindenb.jvarkit.tools.vcf2bam.VcfToBam.

Compile failed; see the compiler error output for details.

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

BUILD FAILED in 2s
1 actionable task: 1 executed

@lindenb
Copy link
Owner

lindenb commented Sep 17, 2023

what version of java are you using ?

@Warrenkevin
Copy link

@lindenb Greetings Pierre, I am having the same exact issue. I was wondering what version of the Java should I be using?

@lindenb
Copy link
Owner

lindenb commented Nov 14, 2023

at least java 17

@lindenb
Copy link
Owner

lindenb commented Nov 14, 2023

but you can always use the precompiled jar: https://github.com/lindenb/jvarkit/#download

@Warrenkevin
Copy link

@lindenb Thank you, it worked! :) I do have some clarifying questions, I am very new bash.

Q1: I built my manifest for the ancestral allele similar to how yours (see Manifest Example) but I keep getting an error (see Error message). I was wondering why this is?

Manifest Example:

"10|chr10    ANCESTOR_for_chromosome:GRCh37:10: 77,662,404-77,718,023  /usr3/graduate/warrenkb/Candidate_Genes_AA/Human_Ancestral_Condition_chr10.fa"

Error Message

[warrenkb@scc1 jvarkit]$ java -jar dist/jvarkit.jar vcfancestralalleles \

-m /usr3/graduate/warrenkb/Candidate_Genes_AA/manifest.txt
usr3/graduate/warrenkb/Candidate_Genes_AA/Human_Ancestral_Condition/ALKBH1_37.vcf |
bcftools annotate -x '^INFO/AA'
[SEVERE][VcfAncestralAllele]Cannot read non-existent file: file:///usr3/graduate/warrenkb/Candidate_Genes_AA/manifest.txt
htsjdk.samtools.SAMException: Cannot read non-existent file: file:///usr3/graduate/warrenkb/Candidate_Genes_AA/manifest.txt
at htsjdk.samtools.util.IOUtil.assertFileIsReadable(IOUtil.java:498)
at com.github.lindenb.jvarkit.io.IOUtils.openPathForReading(IOUtils.java:360)
at com.github.lindenb.jvarkit.io.IOUtils.openPathForBufferedReading(IOUtils.java:374)
at com.github.lindenb.jvarkit.tools.onekgenomes.VcfAncestralAllele.loadManifest(VcfAncestralAllele.java:171)
at com.github.lindenb.jvarkit.tools.onekgenomes.VcfAncestralAllele.beforeVcf(VcfAncestralAllele.java:298)
at com.github.lindenb.jvarkit.jcommander.OnePassVcfLauncher.doWork(OnePassVcfLauncher.java:123)
at com.github.lindenb.jvarkit.util.jcommander.Launcher.instanceMain(Launcher.java:819)
at com.github.lindenb.jvarkit.util.jcommander.Launcher.instanceMainWithExit(Launcher.java:982)
at com.github.lindenb.jvarkit.tools.onekgenomes.VcfAncestralAllele.main(VcfAncestralAllele.java:314)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at com.github.lindenb.jvarkit.tools.jvarkit.JvarkitCentral$Command.execute(JvarkitCentral.java:276)
at com.github.lindenb.jvarkit.tools.jvarkit.JvarkitCentral.run(JvarkitCentral.java:749)
at com.github.lindenb.jvarkit.tools.jvarkit.JvarkitCentral.main(JvarkitCentral.java:760)
[SEVERE][OnePassVcfLauncher]initialization failed
[INFO][Launcher]vcfancestralalleles Exited with failure (-1)
Failed to read from standard input: unknown file type

  • Notes: I created my manifest and saved it as a .txt file. Am I doing something wrong?

****Q2: I am having a little trouble dissecting this code, can you help? How I understand it is and how I figure my code will look is a little something like this (see below). ****

$ java -jar dist/jvarkit.jar vcfancestralalleles \ ---------------------Stays the same

_-m /commun/data/pubdb/ftp.1000genomes.ebi.ac.uk/vol1/ftp/phase1/analysis_results/supporting/human_ancestor_GRCh37_e59/manifest.mf_ \ --------------------------------This is the location of my manifest. Does my manifest have to be as a .mf or will a .txt file work. I know that your directions say that it should be tab delimited file. 


_src/test/resources/gnomad.exomes.r2.0.1.sites.vcf.gz |\
bcftools annotate -x '^INFO/AA'_  -----------------------this is my VCF file of my candidate gene that is adding the ancestral allele to the VCF file. Is the correct? My VCF file is only a .vcf, not a .vcf.gz. Does that matter? 

@lindenb
Copy link
Owner

lindenb commented Nov 14, 2023

-m /usr3/graduate/warrenkb/Candidate_Genes_AA/manifest.txt
usr3/graduate/warrenkb/Candidate_Genes_AA/Human_Ancestral_Condition/ALKBH1_37.vcf 

first path starts with a '/' (full path) second is a relative path. Something is wrong here.

@lindenb
Copy link
Owner

lindenb commented Nov 14, 2023

Does my manifest have to be as a .mf or will a .txt file work

suffix is meaningless

@lindenb
Copy link
Owner

lindenb commented Nov 14, 2023

My VCF file is only a .vcf, not a .vcf.gz. Does that matter?

no

@Warrenkevin
Copy link

@lindenb Hi Pierre, thank you for that. I believe something may be wrong with my manifest?

I keep getting this error:

BUILD SUCCESSFUL in 47s
1 actionable task: 1 executed
[warrenkb@scc1 jvarkit]$ java -jar dist/jvarkit.jar vcfancestralalleles \

-m /usr3/graduate/warrenkb/Candidate_Genes_AA/Human_Ancestral_Condition/Manifest.txt
/usr3/graduate/warrenkb/Candidate_Genes_AA/Human_Ancestral_Condition/ALKBH1_37.vcf |
bcftools annotate -x '^INFO/AA'
[SEVERE][OnePassVcfLauncher]expected two columns

  • [1] "10|chr10� � ANCESTOR_for_chromosome:GRCh37:10: 77,662,404-77,718,023� � /usr3/graduate/warrenkb/Candidate_Genes_AA/Human_Ancestral_Condition_10.fa"
    com.github.lindenb.jvarkit.lang.JvarkitException$TokenErrors: expected two columns
  • [1] "10|chr10� � ANCESTOR_for_chromosome:GRCh37:10: 77,662,404-77,718,023� � /usr3/graduate/warrenkb/Candidate_Genes_AA/Human_Ancestral_Condition_10.fa"
    at com.github.lindenb.jvarkit.tools.onekgenomes.VcfAncestralAllele.loadManifest(VcfAncestralAllele.java:176)
    at com.github.lindenb.jvarkit.tools.onekgenomes.VcfAncestralAllele.beforeVcf(VcfAncestralAllele.java:298)
    at com.github.lindenb.jvarkit.jcommander.OnePassVcfLauncher.doWork(OnePassVcfLauncher.java:123)
    at com.github.lindenb.jvarkit.util.jcommander.Launcher.instanceMain(Launcher.java:819)
    at com.github.lindenb.jvarkit.util.jcommander.Launcher.instanceMainWithExit(Launcher.java:982)
    at com.github.lindenb.jvarkit.tools.onekgenomes.VcfAncestralAllele.main(VcfAncestralAllele.java:314)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at com.github.lindenb.jvarkit.tools.jvarkit.JvarkitCentral$Command.execute(JvarkitCentral.java:276)
    at com.github.lindenb.jvarkit.tools.jvarkit.JvarkitCentral.run(JvarkitCentral.java:749)
    at com.github.lindenb.jvarkit.tools.jvarkit.JvarkitCentral.main(JvarkitCentral.java:760)
    [INFO][Launcher]vcfancestralalleles Exited with failure (-1)
    Failed to read from standard input: unknown file type

Should I look to see how my manifest is created?

@lindenb
Copy link
Owner

lindenb commented Nov 14, 2023

attach your manifest in that issue please.

@Warrenkevin
Copy link

@lindenb Here is a copy of my manifest.

Manifest Example .txt

@lindenb
Copy link
Owner

lindenb commented Nov 14, 2023

this is a windows file.


file manifest.txt
manifest.txt: ISO-8859 text, with CRLF line terminators

not a text file, not a tab delimited file. https://unix.stackexchange.com/questions/108271/

@Warrenkevin
Copy link

Warrenkevin commented Nov 15, 2023

@lindenb HI Pierre, my apologies, I uploaded the wrong one. This is the correct one. I am still running into the same issue. How I made the the file was in a text editor, converting it into plain text and then saving is as UTF-8. Is my Manifest still wrong?

Manifest_Example.zip

@lindenb
Copy link
Owner

lindenb commented Nov 15, 2023

it's not a tab delimited file. You used spaces.
$ unzip -p tmp.zip Manifest_Example | tr " " "."
10|chr10 . .ANCESTOR_for_chromosome:GRCh37:10:.77,662,404-77,718,023 . ./usr3/graduate/warrenkb/Candidate_Genes_AA/Human_Ancestral_Condition_10.fa
14|chr14 . .ANCESTOR_for_chromosome:GRCh37:14:.53,939,736-53,968,761. ./usr3/graduate/warrenkb/Candidate_Genes_AA/Human_Ancestral_Condition_14.fa$

a return is missing for the last line and it's always a windows file ( CRLF line terminators )



~$ unzip -p tmp.zip  Manifest_Example | file -
/dev/stdin: Unicode text, UTF-8 text, with CRLF line terminators

@Warrenkevin
Copy link

@lindenb Hi Pierre, I believe I have fixed the issue (e.g., replaced the spaces with tabs):

Manifest_Example.zip

I wanted to share my code with you and the error that I keep getting. I recently changed the file name to mirror the .fa files and am getting the following error:

[SEVERE][VcfAncestralAllele]Cannot read non-existent file: file:///usr3/graduate/warrenkb/Candidate_Genes_AA/Human_Ancestral_Condition_10.fa
htsjdk.samtools.SAMException: Cannot read non-existent file: file:///usr3/graduate/warrenkb/Candidate_Genes_AA/Human_Ancestral_Condition_10.fa

I was wondering is it because I changed the path and maybe the system has not caught up with it yet? Here is my code.

[warrenkb@scc1 human_ancestor]$ module load htslib/1.17
[warrenkb@scc1 human_ancestor]$ module load samtools/1.17
[warrenkb@scc1 human_ancestor]$ module load bcftools/1.17
[warrenkb@scc1 human_ancestor]$ module load java/17.0.8
[warrenkb@scc1 human_ancestor]$ cd jvarkit
[warrenkb@scc1 jvarkit]$ java -jar dist/jvarkit.jar vcfancestralalleles
-m /usr3/graduate/warrenkb/Candidate_Genes_AA/human_ancestor/Manifest_Example \ usr3/graduate/warrenkb/Candidate_Genes_AA/human_ancestor/ALKBH1_37.vcf |
bcftools annotate -x '^INFO/AA'

Everything looks about right.

@lindenb
Copy link
Owner

lindenb commented Nov 16, 2023

what is the output of

ls /usr3/graduate/warrenkb/Candidate_Genes_AA/Human_Ancestral_Condition_10.fa

if it's "file not found", then the path is not correct...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants