Commit 18f9a566 authored by Michael R. Crusoe's avatar Michael R. Crusoe 🏳️‍🌈
Browse files

New upstream version 1.0.0+dfsg

parent 564aed27
Loading
Loading
Loading
Loading
+21 −7
Original line number Diff line number Diff line
@@ -128,8 +128,16 @@ LEFTALIGN = smithwaterman/LeftAlign.o
FSOM = fsom/fsom.o
FILEVERCMP = filevercmp/filevercmp.o

INCLUDES = -Itabixpp/htslib -I$(INC_DIR) -L. -Ltabixpp/htslib
LDFLAGS = -L$(LIB_DIR) -lvcflib -lhts -lpthread -lz -lm -llzma -lbz2
# Work out how to find htslib
# Use the one we ship in tabixpp unless told otherwise by the environment
HTS_LIB ?= $(VCF_LIB_LOCAL)/tabixpp/htslib/libhts.a
HTS_INCLUDES ?= -I$(VCF_LIB_LOCAL)/tabixpp/htslib
HTS_LDFLAGS ?= -L$(VCF_LIB_LOCAL)/tabixpp/htslib -lhts -lbz2 -lm -lz -llzma -pthread


INCLUDES = $(HTS_INCLUDES) -I$(INC_DIR) 
LDFLAGS = -L$(LIB_DIR) -lvcflib $(HTS_LDFLAGS) -lpthread -lz -lm -llzma -lbz2



all: $(OBJECTS) $(BINS) scriptToBin
@@ -167,7 +175,7 @@ intervaltree: pre
	cd intervaltree && $(MAKE) && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/

$(TABIX): pre
	cd tabixpp && $(MAKE) && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
	cd tabixpp && INCLUDES="$(HTS_INCLUDES)" LIBPATH="-L. $(HTS_LDFLAGS)" HTSLIB="$(HTS_LIB)" $(MAKE) && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/

$(SMITHWATERMAN): pre
	cd smithwaterman && $(MAKE) && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/ && cp *.o $(VCF_LIB_LOCAL)/$(OBJ_DIR)/
@@ -223,8 +231,14 @@ clean:
	rm -rf $(LIB_DIR)
	rm -rf $(INC_DIR)
	rm -rf $(OBJ_DIR)
	cd tabixpp && make clean
	cd smithwaterman && make clean
	cd fastahack && make clean
	cd tabixpp && $(MAKE) clean
	cd smithwaterman && $(MAKE) clean
	cd fastahack && $(MAKE) clean
	cd multichoose && $(MAKE) clean
	cd fsom && $(MAKE) clean
	cd libVCFH && $(MAKE) clean
	cd test && $(MAKE) clean
	cd filevercmp && $(MAKE) clean
	cd intervaltree && $(MAKE) clean
	
.PHONY: clean all test pre
+79 −90
Original line number Diff line number Diff line
@@ -167,11 +167,9 @@ Uses allele frequencies in the AF info column to estimate phylogeny at multialle
        -t, --tag-parsed FLAG   Tag records which are split apart of a complex allele
                                with this flag
    
    If multiple alleleic primitives (gaps or mismatches) are specified in
    a single VCF record, split the record into multiple lines, but drop all
    INFO fields.  "Pure" MNPs are split into multiple SNPs unless the -m
    flag is provided.  Genotypes are phased where complex alleles have been
    decomposed, provided genotypes in the input.
If multiple alleleic primitives (gaps or mismatches) are specified in a single VCF record, split the record into multiple lines, but drop all INFO fields.
"Pure" MNPs are split into multiple SNPs unless the -m flag is provided.
Genotypes are phased where complex alleles have been decomposed, provided genotypes in the input.

    
### vcfaltcount
@@ -190,27 +188,23 @@ Counts the number of alternate alleles in the record.

Intersect the records in the VCF file with targets provided in a BED file.
Intersections are done on the reference sequences in the VCF file.
    If no VCF filename is specified on the command line (last argument) the VCF
    read from stdin.
If no VCF filename is specified on the command line (last argument) the VCF read from stdin.

    
### vcfannotategenotypes
    
    usage: vcfannotategenotypes <annotation-tag> <vcf file> <vcf file>

    annotates genotypes in the first file with genotypes in the second adding the
    genotype as another flag to each sample filed in the first file.
    annotation-tag is the name of the sample flag which is added to store the
    annotation.  also adds a 'has\_variant' flag for sites where the second file has
    a variant.
Annotates genotypes in the first file with genotypes in the second adding the genotype as another flag to each sample filed in the first file.
Annotation-tag is the name of the sample flag which is added to store the annotation.
Also adds a 'has\_variant' flag for sites where the second file has a variant.
    
    
### vcfbreakmulti
    
    usage: vcfbreakmulti [options] [file]
    
    If multiple alleles are specified in a single record, break the record into
    multiple lines, preserving allele-specific INFO fields.
If multiple alleles are specified in a single record, break the record into multiple lines, preserving allele-specific INFO fields.
    
    
### vcfcheck
@@ -239,16 +233,18 @@ reflect positional change.
        -r --region REGION  A region specifier of the form chrN:x-y to bound the merge

Combines VCF files positionally, combining samples when sites and alleles are identical.
Any number of VCF files may be combined.  The INFO field and other columns are taken from
one of the files which are combined when records in multiple files match.  Alleles must
have identical ordering to be combined into one record.  If they do not, multiple records
will be emitted.
Any number of VCF files may be combined.
The INFO field and other columns are taken from one of the files which are combined when records in multiple files match.
Alleles must
have identical ordering to be combined into one record.
If they do not, multiple records will be emitted.


### vcfcommonsamples
    
    usage: vcfcommonsamples <vcf file> <vcf file> outputs each record in the
    first file, removing samples not present in the second
    usage: vcfcommonsamples <vcf file> <vcf file>
    
Outputs each record in the first file, removing samples not present in the second.
    
    
### vcfcountalleles
@@ -270,9 +266,9 @@ in the file.
    
    usage: vcfentropy [options] <vcf file>
    
    options: -f, --fasta-reference  FASTA reference file to use to obtain
primer sequences -w, --window-size      Size of the window over which to
calculate entropy
    options:
        -f, --fasta-reference  FASTA reference file to use to obtain primer sequences
        -w, --window-size      Size of the window over which to calculate entropy
    
Anotates the output VCF file with, for each record, EntropyLeft,
EntropyRight, EntropyCenter, which are the entropies of the sequence of the
@@ -307,18 +303,15 @@ given window size to the left, right, and center of the record.

Operators can be any of: =, !, <, >, |, &

    Any number of filters may be specified.  They are combined via logical AND
    unless --or is specified on the command line.  Obtain logical negation through
    the use of parentheses, e.g. "! ( DP = 10 )"
Any number of filters may be specified.  They are combined via logical AND unless --or is specified on the command line.
Obtain logical negation through the use of parentheses, e.g. "! ( DP = 10 )"

    For convenience, you can specify "QUAL" to refer to the quality of the site, even
    though it does not appear in the INFO fields.
For convenience, you can specify "QUAL" to refer to the quality of the site, even though it does not appear in the INFO fields.

    
### vcffixup

Count the allele frequencies across alleles present in each record in the 
VCF file.  (Similar to vcftools --freq.)
Count the allele frequencies across alleles present in each record in the VCF file. (Similar to vcftools --freq.)

Uses genotypes from the VCF file to correct AC (alternate allele count), AF
(alternate allele frequency), NS (number of called), in the VCF records.  For
@@ -334,10 +327,9 @@ was not called as polymorphic.
    
    usage: vcfflatten [file]
    
    Removes multi-allelic sites by picking the most common alternate.  Requires
    allele frequency specification 'AF' and use of 'G' and 'A' to specify the
    fields which vary according to the Allele or Genotype. VCF file may be
    specified on the command line or piped as stdin.
Removes multi-allelic sites by picking the most common alternate.
Requires allele frequency specification 'AF' and use of 'G' and 'A' to specify the fields which vary according to the Allele or Genotype.
VCF file may be specified on the command line or piped as stdin.
    
    
### vcfgeno2haplo
@@ -355,10 +347,9 @@ was not called as polymorphic.
### vcfgenotypecompare
    
    usage: vcfgenotypecompare <other-genotype-tag> <vcf file>
    adds statistics to the INFO field of the vcf file describing the
    amount of discrepancy between the genotypes (GT) in the vcf file and the
    genotypes reported in the <other-genotype-tag>.  use this after
    vcfannotategenotypes to get correspondence statistics for two vcfs.
    
Adds statistics to the INFO field of the vcf file describing the amount of discrepancy between the genotypes (GT) in the vcf file and the genotypes reported in the <other-genotype-tag>.
Use this after vcfannotategenotypes to get correspondence statistics for two vcfs.
    
    
### vcfgenotypes
@@ -414,27 +405,28 @@ Adds a field (id) which contains an allele-specific numerical index.

For bed-vcf intersection, alleles which fall into the targets are retained.
    
    For vcf-vcf intersection and union, unify on equivalent alleles within window-size bp
    as determined by haplotype comparison alleles.
For vcf-vcf intersection and union, unify on equivalent alleles within window-size bp as determined by haplotype comparison alleles.
    
    
### vcfkeepgeno
    
    usage: vcfkeepgeno <vcf file> [FIELD1] [FIELD2] ...
    outputs each record in the vcf file, removing FORMAT fields not listed
    on the command line from sample specifications in the output
    
Outputs each record in the vcf file, removing FORMAT fields not listed on the command line from sample specifications in the output.
    
    
### vcfkeepinfo
    
    usage: vcfkeepinfo <vcf file> [FIELD1] [FIELD2] ...
    outputs each record in the vcf file, removing INFO fields not listed on the command line
    
 Outputs each record in the vcf file, removing INFO fields not listed on the command line.
    
    
### vcfkeepsamples
    
    usage: vcfkeepsamples <vcf file> [SAMPLE1] [SAMPLE2] ...
    outputs each record in the vcf file, removing samples not listed on the command line

Outputs each record in the vcf file, removing samples not listed on the command line.
    
    
### vcfleftalign
@@ -453,9 +445,9 @@ alignments.
        -r, --reference FILE  Use this reference as a basis for realignment.
        -w, --window N        Use a window of this many bp when left aligning (150).

    Left-aligns variants in the specified input file or stdin.  Window size is determined
    dynamically according to the entropy of the regions flanking the indel.  These must have
    entropy > 1 bit/bp, or be shorter than ~5kb.
Left-aligns variants in the specified input file or stdin.
Window size is determined dynamically according to the entropy of the regions flanking the indel.
These must have entropy > 1 bit/bp, or be shorter than ~5kb.


### vcflength
@@ -495,12 +487,11 @@ Use `vcfallelicprimitives` to decompose records while preserving format.
        -f, --fasta-reference  FASTA reference file to use to obtain primer sequences
        -l, --primer-length    The length of the primer sequences on each side of the variant
    
    For each VCF record, extract the flanking sequences, and write them to stdout as FASTA
    records suitable for alignment.  This tool is intended for use in designing validation
    experiments.  Primers extracted which would flank all of the alleles at multi-allelic
    sites.  The name of the FASTA "reads" indicates the VCF record which they apply to.
    The form is >CHROM_POS_LEFT for the 3' primer and >CHROM_POS_RIGHT for the 5' primer,
    for example:
For each VCF record, extract the flanking sequences, and write them to stdout as FASTA records suitable for alignment.
This tool is intended for use in designing validation experiments.
Primers extracted which would flank all of the alleles at multi-allelic sites.
The name of the FASTA "reads" indicates the VCF record which they apply to.
The form is >CHROM_POS_LEFT for the 3' primer and >CHROM_POS_RIGHT for the 5' primer, for example:
    
    >20_233255_LEFT
    CCATTGTATATATAGACCATAATTTCTTTATCCAATCATCTGTTGATGGA
@@ -519,8 +510,8 @@ Use `vcfallelicprimitives` to decompose records while preserving format.
        -p, --random-seed N  use this random seed
    
Randomly sample sites from an input VCF file, which may be provided as stdin.
    Scale the sampling probability by the field specified in KEY.  This may be
    used to provide uniform sampling across allele frequencies, for instance.
Scale the sampling probability by the field specified in KEY.
This may be used to provide uniform sampling across allele frequencies, for instance.
    
    
### vcfremap
@@ -553,7 +544,8 @@ allele observation) for each genotype.
### vcfremovesamples
    
    usage: vcfremovesamples <vcf file> [SAMPLE1] [SAMPLE2] ...
    outputs each record in the vcf file, removing samples listed on the command line

Outputs each record in the vcf file, removing samples listed on the command line.
    
    
### vcfroc
@@ -565,17 +557,17 @@ allele observation) for each genotype.
        -w, --window-size N       compare records up to this many bp away (default 30)
        -r, --reference FILE      FASTA reference file
    
    Generates a pseudo-ROC curve using sensitivity and specificity estimated against
    a putative truth set.  Thresholding is provided by successive QUAL cutoffs.
Generates a pseudo-ROC curve using sensitivity and specificity estimated against a putative truth set.
Thresholding is provided by successive QUAL cutoffs.
    
    
### vcfsamplediff
    
    usage: vcfsamplediff <tag> <sample> <sample> [ <sample> ... ] <vcf file>
    tags each record where the listed sample genotypes differ with <tag>
    
Tags each record where the listed sample genotypes differ with <tag>
The first sample is assumed to be germline, the second somatic.
    Each record is tagged with <tag>={germline,somatic,loh} to specify the type of
    variant given the genotype difference between the two samples.
Each record is tagged with <tag>={germline,somatic,loh} to specify the type of variant given the genotype difference between the two samples.
    
    
### vcfsamplenames
@@ -593,13 +585,10 @@ Prints the names of the samples in the VCF file.
    application: 
        vcfsom -a output.som -f "AF DP ABP" test.vcf >results.vcf
    
    vcfsomtrains and/or applies a self-organizing map to the input VCF data
    on stdin, adding two columns for the x and y coordinates of the winning
    neuron in the network and an optional euclidean distance from a given
    node (--center).
vcfsom trains and/or applies a self-organizing map to the input VCF data on stdin, adding two columns for the x and y coordinates of the winning neuron in the network and an optional euclidean distance from a given node (--center).
    
    If a map is provided via --apply,  map will be applied to input without
    training.  Automated filtering to an estimated FP rate is 
If a map is provided via --apply,  map will be applied to input without training.
Automated filtering to an estimated FP rate is 
    
    options:
    
+2 −2
Original line number Diff line number Diff line
#!/usr/bin/env python

from __future__ import print_function
import sys

for line in sys.stdin:
@@ -13,4 +13,4 @@ for line in sys.stdin:
    span = len(fields[3]) # handle multi-base alleles
    end = start + span
    name = fields[2]
    print "\t".join(map(str, [chrom, start, end, name]))
    print("\t".join(str(x) for x in [chrom, start, end, name]))
+10 −10
Original line number Diff line number Diff line
#!/usr/bin/env python

from __future__ import print_function
import sys
import re
import sqlite3

if len(sys.argv) < 2:
    print "usage", sys.argv[0], " [dbname]"
    print "reads VCF on stdin, and writes output to a sqlite3 db [dbname]"
    print("usage {} [dbname]").format(sys.argv[0])
    print("reads VCF on stdin, and writes output to a sqlite3 db [dbname]")
    exit(1)

dbname = sys.argv[1]
@@ -24,7 +24,7 @@ for line in sys.stdin:
        n = re.search("Number=(.*?),", line)
        t = re.search("Type=(.*?),", line)
        if i and n and t:
            id = i.groups()[0]
            iden = i.groups()[0]
            number = n.groups()[0]
            if number == "A":
                number = -1
@@ -34,8 +34,8 @@ for line in sys.stdin:
            else:
                number = int(number)
            typestr = t.groups()[0]
            infotypes[id] = typestr
            infonumbers[id] = number
            infotypes[iden] = typestr
            infonumbers[iden] = number
        else:
            continue
    elif line.startswith('##'):
@@ -78,13 +78,13 @@ conn.execute(tablecmd)

for line in sys.stdin:
    fields = line.split('\t')
    chrom, pos, id, ref, alts, qual, filter, info = fields[:8]
    chrom, pos, iden, ref, alts, qual, filt, info = fields[:8]
    alts = alts.split(",")
    altindex = 0
    chrom = "\'" + chrom + "\'"
    id = "\'" + id + "\'"
    iden = "\'" + iden + "\'"
    ref = "\'" + ref + "\'"
    filter = "\'" + filter + "\'"
    filt = "\'" + filt + "\'"
    for alt in alts:
        alt = "\'" + alt + "\'"
        info_values = {}
@@ -115,7 +115,7 @@ for line in sys.stdin:
                    value = "0"
            ordered_insertion.append(value)
        cmd = "insert into alleles values (" \
            + ", ".join([chrom, pos, id, ref, alt, qual, filter]) \
            + ", ".join([chrom, pos, iden, ref, alt, qual, filt]) \
            + ", " \
            + ", ".join(ordered_insertion) + ")"
        conn.execute(cmd)
+3 −4
Original line number Diff line number Diff line
#!/usr/bin/env python
#

from __future__ import print_function
import sys

for line in sys.stdin:
    if line.startswith("#"):
        print line.strip()
        print(line.strip())
    else:
        fields = line.strip().split("\t")
        fields[2] = "."
        print "\t".join(fields)
        print("\t".join(fields))
Loading