lindenb / jvarkit

Java utilities for Bioinformatics
https://jvarkit.readthedocs.io/
Other
482 stars 133 forks source link

Problem : CHROM header line #125

Closed vicbp1 closed 5 years ago

vicbp1 commented 5 years ago

Dear Pierre I have a problem using fixvcfmissinggenotypes

I am using (just for a test) two exome vcf samples, merging with vcf-merge and indexing the file resulting in a vcf ver4.2 I have indexed the bam files (in the same directory) and them I tried to identify the missing values

my bam list is : /home/path/bam_files/V21_R1.fastq.bam /home/path/bam_files/V23_R1.fastq.bam

when I run java -jar ./dist/fixvcfmissinggenotypes.jar -f list_2bams_list.txt < twosamples_test.vcf.gz > 2samples_test_nonmissing.vcf

I received the following error:

mple_nonmissing.vcf [SEVERE][Launcher]Your input file has a malformed header: We never saw the required CHROM header line (starting with one #) for the input VCF file htsjdk.tribble.TribbleException$InvalidHeader: Your input file has a malformed header: We never saw the required CHROM header line (starting with one #) for the input VCF file at htsjdk.variant.vcf.VCFCodec.readActualHeader(VCFCodec.java:115) at htsjdk.variant.vcf.VCFIteratorBuilder$VCFReaderIterator.(VCFIteratorBuilder.java:177) at htsjdk.variant.vcf.VCFIteratorBuilder.open(VCFIteratorBuilder.java:97) at com.github.lindenb.jvarkit.util.vcf.VCFUtils.createVCFIteratorFromInputStream(VCFUtils.java:289) at com.github.lindenb.jvarkit.util.vcf.VCFUtils.createVCFIterator(VCFUtils.java:327) at com.github.lindenb.jvarkit.util.jcommander.Launcher.openVCFIterator(Launcher.java:514) at com.github.lindenb.jvarkit.util.jcommander.Launcher.doVcfToVcf(Launcher.java:561) at com.github.lindenb.jvarkit.util.jcommander.Launcher.doVcfToVcf(Launcher.java:583) at com.github.lindenb.jvarkit.tools.misc.FixVcfMissingGenotypes.doWork(FixVcfMissingGenotypes.java:346) at com.github.lindenb.jvarkit.util.jcommander.Launcher.instanceMain(Launcher.java:736) at com.github.lindenb.jvarkit.util.jcommander.Launcher.instanceMainWithExit(Launcher.java:894) at com.github.lindenb.jvarkit.tools.misc.FixVcfMissingGenotypes.main(FixVcfMissingGenotypes.java:358)


I tried to repeated the experiment with the examples of the program for rotavirus but the error is still the same.

Can you help me with that? Thank you for your time

lindenb commented 5 years ago

that's because the example is outdated (sorry), look at the options at the top. The option is not -f but -B

 find src/test/resources/ -name "S*.bam" > jeter.list
java -jar dist/fixvcfmissinggenotypes.jar -B jeter.list  src/test/resources/rotavirus_rf.vcf.gz
vicbp1 commented 5 years ago

Dear Pierre,

Thank you for the response. I have success with the example, but I have a problem with my data

following that comand and having my bam files with the same name as the samples of the vcf and the index bam with .bam.bai, I have this new issue java -jar /home/path/jvarkit/dist/fixvcfmissinggenotypes.jar -B list_2bams.txt twosamples.vcf.gz [INFO][FixVcfMissingGenotypes]Reading header for list_2bams.txt [SEVERE][FixVcfMissingGenotypes]No BAM index available for list_2bams.txt [INFO][Launcher]fixvcfmissinggenotypes Exited with failure (-1)

Do you have any recomendation?

Thank you for your time

lindenb commented 5 years ago

you have to index your bams with 'samtools index '

vicbp1 commented 5 years ago

they are indexed and they are in the same path of the bam using samtools index sample_R1_fastq.bam

samtools index sample_R3_fastq.bam

and generating the sample_R1_fastq.bam.bai and sample_R3_fastq.bam

but I still have the same error.

lindenb commented 5 years ago

use 'list_2bams.list' , not 'list_2bams.txt"

vicbp1 commented 5 years ago

now it works!

Thank you so much for your time!