Search in sources :

Example 1 with TrapIndexer

use of com.github.lindenb.jvarkit.tools.trap.TrapIndexer in project jvarkit by lindenb.

the class TestNg01 method testVcfTrap.

@Test
public void testVcfTrap() throws IOException {
    final File dbFile = new File(TEST_RESULTS_DIR, "chr1.TraPv2.txt");
    PrintWriter pw = new PrintWriter(dbFile);
    pw.println("906010\tA\tG\tENSG00000186092\t0.029");
    pw.println("906010\tA\tG\tENSG00000186092\t1");
    pw.println("906010\tA\tG\tENSG00000186094\t0");
    pw.println("906010\tA\tG\tENSG00000186095\t0.0");
    pw.println("906011\tT\tC\tENSG00000186093\t0.99");
    pw.flush();
    pw.close();
    final File indexFile = new File(TEST_RESULTS_DIR, "chr1.TraPv2.dat");
    Assert.assertEquals(0, new TrapIndexer().instanceMain(new String[] { "-o", indexFile.getPath(), dbFile.getPath() }));
    final File manifestFile = new File(TEST_RESULTS_DIR, "jeter.manifest");
    pw = new PrintWriter(manifestFile);
    pw.println("1\t" + indexFile.getPath());
    pw.flush();
    pw.close();
    final File outvcf = new File(TEST_RESULTS_DIR, "jeter.vcf");
    Assert.assertEquals(0, new VcfTrap().instanceMain(new String[] { "-o", outvcf.getPath(), "-A", "TRAP", "-m", manifestFile.getPath(), "src/test/resources/gnomad.genomes.r2.0.1.sites.1.vcf.gz" }));
    Assert.assertTrue(streamVcf(outvcf).anyMatch(V -> V.hasAttribute("TRAP")));
    Assert.assertTrue(manifestFile.delete());
    Assert.assertTrue(indexFile.delete());
    Assert.assertTrue(dbFile.delete());
    Assert.assertTrue(outvcf.delete());
}
Also used : Arrays(java.util.Arrays) VCFFileReader(htsjdk.variant.vcf.VCFFileReader) VCFHeader(htsjdk.variant.vcf.VCFHeader) VcfFilterJdk(com.github.lindenb.jvarkit.tools.vcffilterjs.VcfFilterJdk) Test(org.testng.annotations.Test) VcfBurdenFisherH(com.github.lindenb.jvarkit.tools.burden.VcfBurdenFisherH) Vcf2Xml(com.github.lindenb.jvarkit.tools.vcf2xml.Vcf2Xml) VcfInjectPedigree(com.github.lindenb.jvarkit.tools.burden.VcfInjectPedigree) VcfToTable(com.github.lindenb.jvarkit.tools.misc.VcfToTable) ReferenceGenomeFactory(com.github.lindenb.jvarkit.util.bio.fasta.ReferenceGenomeFactory) VcfMultiToOneAllele(com.github.lindenb.jvarkit.tools.misc.VcfMultiToOneAllele) SAXParser(javax.xml.parsers.SAXParser) VcfNoCallToHomRef(com.github.lindenb.jvarkit.tools.misc.VcfNoCallToHomRef) VcfBurdenFisherV(com.github.lindenb.jvarkit.tools.burden.VcfBurdenFisherV) CloserUtil(htsjdk.samtools.util.CloserUtil) PrintWriter(java.io.PrintWriter) VcfBurdenFilterGenes(com.github.lindenb.jvarkit.tools.burden.VcfBurdenFilterGenes) Set(java.util.Set) PadEmptyFastq(com.github.lindenb.jvarkit.tools.misc.PadEmptyFastq) VcfMultiToOne(com.github.lindenb.jvarkit.tools.onesamplevcf.VcfMultiToOne) VcfOffsetsIndexFactory(com.github.lindenb.jvarkit.tools.vcflist.VcfOffsetsIndexFactory) Stream(java.util.stream.Stream) VcfBurdenFilterExac(com.github.lindenb.jvarkit.tools.burden.VcfBurdenFilterExac) VcfMoveFiltersToInfo(com.github.lindenb.jvarkit.tools.burden.VcfMoveFiltersToInfo) CloseableIterator(htsjdk.samtools.util.CloseableIterator) Bam2Raster(com.github.lindenb.jvarkit.tools.bam2graphics.Bam2Raster) SortVcfOnInfo(com.github.lindenb.jvarkit.tools.sortvcfonref.SortVcfOnInfo) TrapIndexer(com.github.lindenb.jvarkit.tools.trap.TrapIndexer) IterableAdapter(htsjdk.samtools.util.IterableAdapter) VcfTrap(com.github.lindenb.jvarkit.tools.trap.VcfTrap) ArrayList(java.util.ArrayList) FixVcfMissingGenotypes(com.github.lindenb.jvarkit.tools.misc.FixVcfMissingGenotypes) Assert(org.testng.Assert) SequenceOntologyTree(com.github.lindenb.jvarkit.util.so.SequenceOntologyTree) IOUtils(com.github.lindenb.jvarkit.io.IOUtils) VcfRebase(com.github.lindenb.jvarkit.tools.vcfrebase.VcfRebase) StreamSupport(java.util.stream.StreamSupport) Properties(java.util.Properties) Files(java.nio.file.Files) VCFBigWig(com.github.lindenb.jvarkit.tools.vcfbigwig.VCFBigWig) VcfGnomad(com.github.lindenb.jvarkit.tools.gnomad.VcfGnomad) IOException(java.io.IOException) File(java.io.File) DefaultHandler(org.xml.sax.helpers.DefaultHandler) VcfSetSequenceDictionary(com.github.lindenb.jvarkit.tools.misc.VcfSetSequenceDictionary) VcfCreateDictionary(com.github.lindenb.jvarkit.tools.misc.VcfCreateDictionary) NgsFilesSummary(com.github.lindenb.jvarkit.tools.ngsfiles.NgsFilesSummary) VcfBurdenRscriptV(com.github.lindenb.jvarkit.tools.burden.VcfBurdenRscriptV) AnnPredictionParserFactory(com.github.lindenb.jvarkit.util.vcf.predictions.AnnPredictionParserFactory) BufferedReader(java.io.BufferedReader) GroupByGene(com.github.lindenb.jvarkit.tools.groupbygene.GroupByGene) VCFFamilies(com.github.lindenb.jvarkit.tools.vcftrios.VCFFamilies) ReferenceGenome(com.github.lindenb.jvarkit.util.bio.fasta.ReferenceGenome) Algorithms(com.github.lindenb.jvarkit.util.Algorithms) Biostar84452(com.github.lindenb.jvarkit.tools.biostar.Biostar84452) VCFTrios(com.github.lindenb.jvarkit.tools.vcftrios.VCFTrios) URL(java.net.URL) LowResBam2Raster(com.github.lindenb.jvarkit.tools.bam2graphics.LowResBam2Raster) VCFBed(com.github.lindenb.jvarkit.tools.vcfbed.VCFBed) Random(java.util.Random) VcfToSql(com.github.lindenb.jvarkit.tools.vcf2sql.VcfToSql) MiniCaller(com.github.lindenb.jvarkit.tools.calling.MiniCaller) GoUtils(com.github.lindenb.jvarkit.tools.misc.GoUtils) FindAVariation(com.github.lindenb.jvarkit.tools.misc.FindAVariation) VcfXmlAmalgamation(com.github.lindenb.jvarkit.tools.vcfamalgation.VcfXmlAmalgamation) ImageIO(javax.imageio.ImageIO) BamToSql(com.github.lindenb.jvarkit.tools.misc.BamToSql) Gff2KnownGene(com.github.lindenb.jvarkit.tools.misc.Gff2KnownGene) VCFFixIndels(com.github.lindenb.jvarkit.tools.vcffixindels.VCFFixIndels) VCFStripAnnotations(com.github.lindenb.jvarkit.tools.vcfstripannot.VCFStripAnnotations) BufferedImage(java.awt.image.BufferedImage) Predicate(java.util.function.Predicate) BeforeClass(org.testng.annotations.BeforeClass) Collectors(java.util.stream.Collectors) IlluminaReadName(com.github.lindenb.jvarkit.tools.misc.IlluminaReadName) List(java.util.List) BackLocate(com.github.lindenb.jvarkit.tools.backlocate.BackLocate) VcfToSvg(com.github.lindenb.jvarkit.tools.misc.VcfToSvg) VariantContext(htsjdk.variant.variantcontext.VariantContext) Pattern(java.util.regex.Pattern) FastaSequenceReader(com.github.lindenb.jvarkit.util.bio.fasta.FastaSequenceReader) VcfList(com.github.lindenb.jvarkit.tools.vcflist.VcfList) SamReaderFactory(htsjdk.samtools.SamReaderFactory) VcfFilterNotInPedigree(com.github.lindenb.jvarkit.tools.burden.VcfFilterNotInPedigree) VcfFilterSequenceOntology(com.github.lindenb.jvarkit.tools.vcffilterso.VcfFilterSequenceOntology) FindAllCoverageAtPosition(com.github.lindenb.jvarkit.tools.misc.FindAllCoverageAtPosition) VcfToRdf(com.github.lindenb.jvarkit.tools.vcf2rdf.VcfToRdf) DataProvider(org.testng.annotations.DataProvider) AnnPredictionParser(com.github.lindenb.jvarkit.util.vcf.predictions.AnnPredictionParser) SAXParserFactory(javax.xml.parsers.SAXParserFactory) VcfLoopOverGenes(com.github.lindenb.jvarkit.tools.burden.VcfLoopOverGenes) VcfToHilbert(com.github.lindenb.jvarkit.tools.hilbert.VcfToHilbert) VcfStats(com.github.lindenb.jvarkit.tools.vcfstats.VcfStats) VcfRemoveUnusedAlt(com.github.lindenb.jvarkit.tools.misc.VcfRemoveUnusedAlt) FileInputStream(java.io.FileInputStream) CaseControlCanvas(com.github.lindenb.jvarkit.tools.burden.CaseControlCanvas) VcfCompareCallers(com.github.lindenb.jvarkit.tools.vcfcmp.VcfCompareCallers) ReferenceContig(com.github.lindenb.jvarkit.util.bio.fasta.ReferenceContig) SamReader(htsjdk.samtools.SamReader) FastqShuffle(com.github.lindenb.jvarkit.tools.fastq.FastqShuffle) BamTile(com.github.lindenb.jvarkit.tools.misc.BamTile) VcfBurdenMAF(com.github.lindenb.jvarkit.tools.burden.VcfBurdenMAF) FastaSequence(com.github.lindenb.jvarkit.util.bio.fasta.FastaSequence) ConcatSam(com.github.lindenb.jvarkit.tools.misc.ConcatSam) Bam2Wig(com.github.lindenb.jvarkit.tools.bam2wig.Bam2Wig) FileReader(java.io.FileReader) VcfTrap(com.github.lindenb.jvarkit.tools.trap.VcfTrap) File(java.io.File) PrintWriter(java.io.PrintWriter) TrapIndexer(com.github.lindenb.jvarkit.tools.trap.TrapIndexer) Test(org.testng.annotations.Test)

Aggregations

IOUtils (com.github.lindenb.jvarkit.io.IOUtils)1 BackLocate (com.github.lindenb.jvarkit.tools.backlocate.BackLocate)1 Bam2Raster (com.github.lindenb.jvarkit.tools.bam2graphics.Bam2Raster)1 LowResBam2Raster (com.github.lindenb.jvarkit.tools.bam2graphics.LowResBam2Raster)1 Bam2Wig (com.github.lindenb.jvarkit.tools.bam2wig.Bam2Wig)1 Biostar84452 (com.github.lindenb.jvarkit.tools.biostar.Biostar84452)1 CaseControlCanvas (com.github.lindenb.jvarkit.tools.burden.CaseControlCanvas)1 VcfBurdenFilterExac (com.github.lindenb.jvarkit.tools.burden.VcfBurdenFilterExac)1 VcfBurdenFilterGenes (com.github.lindenb.jvarkit.tools.burden.VcfBurdenFilterGenes)1 VcfBurdenFisherH (com.github.lindenb.jvarkit.tools.burden.VcfBurdenFisherH)1 VcfBurdenFisherV (com.github.lindenb.jvarkit.tools.burden.VcfBurdenFisherV)1 VcfBurdenMAF (com.github.lindenb.jvarkit.tools.burden.VcfBurdenMAF)1 VcfBurdenRscriptV (com.github.lindenb.jvarkit.tools.burden.VcfBurdenRscriptV)1 VcfFilterNotInPedigree (com.github.lindenb.jvarkit.tools.burden.VcfFilterNotInPedigree)1 VcfInjectPedigree (com.github.lindenb.jvarkit.tools.burden.VcfInjectPedigree)1 VcfLoopOverGenes (com.github.lindenb.jvarkit.tools.burden.VcfLoopOverGenes)1 VcfMoveFiltersToInfo (com.github.lindenb.jvarkit.tools.burden.VcfMoveFiltersToInfo)1 MiniCaller (com.github.lindenb.jvarkit.tools.calling.MiniCaller)1 FastqShuffle (com.github.lindenb.jvarkit.tools.fastq.FastqShuffle)1 VcfGnomad (com.github.lindenb.jvarkit.tools.gnomad.VcfGnomad)1