Commit 92a5438a authored by Andreas Tille's avatar Andreas Tille
Browse files

New upstream version 1.2.0

parent a0624d40
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
all: vcflib/Makefile log
	cd src && $(MAKE)

wbamtools: vcflib/Makefile log
	cd src && $(MAKE) -f Makefile.bamtools

log: src/version_git.h
	wget -q http://hypervolu.me/freebayes/build/$(shell cat src/version_git.h | grep v | cut -f 3 -d\  | sed s/\"//g) &

+10 −5
Original line number Diff line number Diff line
@@ -93,7 +93,6 @@ Luckily, if you have access to https:// on port 443, then you can use this
## Compilation

FreeBayes requires g++ and the standard C and C++ development libraries.
Additionally, cmake is required for building the BamTools API.

    make

@@ -106,6 +105,12 @@ accomplished via

    sudo make install

Note that the freebayes-parallel script and the programs on which it depends are
not installed by this command.

Users can optionally build with [BamTools](https://github.com/pezmaster31/bamtools) instead of [SeqLib](https://github.com/walaj/SeqLib). Building with BamTools requires CMake.

    make wbamtools

## Usage

@@ -179,7 +184,7 @@ Note that any of the above examples can be made parallel by using the
scripts/freebayes-parallel script.  If you find freebayes to be slow, you
should probably be running it in parallel using this script to run on a single
host, or generating a series of scripts, one per region, and run them on a
cluster.
cluster. Be aware that the freebayes-parallel script contains calls to other programs  using relative paths from the scripts subdirectory; the easiest way to ensure a successful run is to invoke the freebayes-parallel script from within the scripts subdirectory.


## Calling variants: from fastq to VCF
@@ -404,7 +409,7 @@ As freebayes is haplotype-based, left-alignment is necessary only for the
determination of candidate polymorphic loci.  Once such loci are determined, 
haplotype observations are extracted from reads where:

1. putative variants lie within `--haplotype-window` bases of each other 
1. putative variants lie within `--haplotype-length` bases of each other 
(default 3bp),
2. the reference sequence has repeats (e.g. microsatellites or STRs are called 
as one haplotype),
@@ -444,7 +449,7 @@ detection window. We can then use these as "basis alleles" for the observation
of haplotypes, considering all other putative variants supported by the 
alignment to be sequencing errors:

    freebayes -f ref.fa --haplotype-window 500 \
    freebayes -f ref.fa --haplotype-length 500 \
        --haplotype-basis-alleles vars.vcf aln.bam >haps.vcf

These steps should allow us to read long haplotypes directly from input data 
@@ -454,7 +459,7 @@ The high error rate means that beyond a small window each read will contain a
completely different literal haplotype.  To a point, this property improves our 
signal to noise ratio and can effectively filter out sequencing errors at the 
point of the input filters, but it also decreases the effective observation 
depth will prevent the generation of any calls if a long `--haplotype-window` 
depth will prevent the generation of any calls if a long `--haplotype-length` 
is combined with high a sequencing error rate.


+1 −1
Original line number Diff line number Diff line
This is BibTeX, Version 0.99d (TeX Live 2015/dev/Debian)
This is BibTeX, Version 0.99d (TeX Live 2015/Debian)
Capacity: max_strings=35307, hash_size=35307, hash_prime=30011
The top-level auxiliary file: main.aux
The style file: genome_research.bst
+12 −20
Original line number Diff line number Diff line
@@ -180,6 +180,7 @@ const short Allele::currentQuality(void) const {
            return quality;
            break;
    }
    return 0;
}

const long double Allele::lncurrentQuality(void) const {
@@ -332,19 +333,19 @@ string stringForAlleles(vector<Allele> &alleles) {
    return out.str();
}

string json(vector<Allele*> &alleles) {
string tojson(vector<Allele*> &alleles) {
    stringstream out;
    vector<Allele*>::iterator a = alleles.begin();
    out << "[" << (*a)->json(); ++a;
    out << "[" << (*a)->tojson(); ++a;
    for (; a != alleles.end(); ++a)
        out << "," << (*a)->json();
        out << "," << (*a)->tojson();
    out << "]";
    return out.str();
}

string json(Allele*& allele) { return allele->json(); }
string tojson(Allele*& allele) { return allele->tojson(); }

string Allele::json(void) {
string Allele::tojson(void) {
    stringstream out;
    if (!genotypeAllele) {
        out << "{\"id\":\"" << readID << "\""
@@ -1415,9 +1416,9 @@ int referenceLengthFromCigar(string& cigar) {
        case 'M':
        case 'X':
        case 'D':
        case 'N':
            r += c->first;
            break;
        case 'N':
        case 'I':
        default:
            break;
@@ -1434,9 +1435,9 @@ int Allele::referenceLengthFromCigar(void) {
        case 'M':
        case 'X':
        case 'D':
        case 'N':
            r += c->first;
            break;
        case 'N':
        case 'I':
        default:
            break;
@@ -1448,30 +1449,21 @@ int Allele::referenceLengthFromCigar(void) {

// combines the two alleles into a complex variant, updates important data
void Allele::mergeAllele(const Allele& newAllele, AlleleType newType) {
    //cout << stringForAllele(*this) << endl << stringForAllele(newAllele) << endl;
    //cerr << stringForAllele(*this) << endl << stringForAllele(newAllele) << endl;
    type = newType;
    alternateSequence += newAllele.alternateSequence;
    length += newAllele.length; // hmmm
    basesRight = newAllele.basesRight;
    baseQualities.insert(baseQualities.end(), newAllele.baseQualities.begin(), newAllele.baseQualities.end());
    currentBase = base();
    // XXX note that we don't add Q values for intermingled gaps in combined alleles
    if (newAllele.type != ALLELE_REFERENCE) {
        quality = min(newAllele.quality, quality);
        lnquality = max(newAllele.lnquality, lnquality);
        //quality = minQuality(baseQualities);
        //lnquality = log(quality);
    } else {
    quality = averageQuality(baseQualities);
        lnquality = log(quality);
    lnquality = phred2ln(quality);
    basesRight += newAllele.referenceLength;
    }
    if (newAllele.type != ALLELE_REFERENCE) {
        repeatRightBoundary = newAllele.repeatRightBoundary;
    }
    cigar = mergeCigar(cigar, newAllele.cigar);
    referenceLength = referenceLengthFromCigar();
    //cout << stringForAllele(*this) << endl << endl;
}

void Allele::squash(void) {
+5 −5
Original line number Diff line number Diff line
@@ -96,10 +96,10 @@ class Allele {
    friend ostream &operator<<(ostream &out, Allele &a);
    friend ostream &operator<<(ostream &out, Allele* &a);

    friend string json(vector<Allele*> &alleles, long int &position);
    friend string json(vector<Allele*> &alleles);
    friend string json(Allele &allele, long int &position);
    friend string json(Allele* &allele);
    friend string tojson(vector<Allele*> &alleles, long int &position);
    friend string tojson(vector<Allele*> &alleles);
    friend string tojson(Allele &allele, long int &position);
    friend string tojson(Allele* &allele);

public:

@@ -262,7 +262,7 @@ public:
                                    //  this is used to update cached data in the allele prior to presenting the allele for analysis
                                    //  for the current base, just use allele.currentBase

    string json(void);
    string tojson(void);
    unsigned int getLengthOnReference(void);
    int referenceLengthFromCigar(void);

Loading