Documentation
¶
Overview ¶
Package convert contains functions for converting data between standard file formats. This is a high level package that avoids circular dependencies.
Index ¶
- func BedGraphToWig(inFile string, reference map[string]chromInfo.ChromInfo, missing float64) map[string]wig.Wig
- func BedReadUpdateWig(w map[string]wig.Wig, b bed.Bed)
- func BedReadsToWig(b []bed.Bed, reference map[string]chromInfo.ChromInfo) map[string]wig.Wig
- func BedToFasta(b []bed.Bed, ref []fasta.Fasta) []fasta.Fasta
- func BedValuesToWig(inFile string, reference map[string]chromInfo.ChromInfo, Missing float64, ...) map[string]wig.Wig
- func EnsemblToUCSC(in string) string
- func PairwiseFaToVcf(f []fasta.Fasta, chr string, out *fileio.EasyWriter, substitutionsOnly bool, ...)
- func SamToBed(s sam.Sam) bed.Bed
- func SamToBedFrag(s sam.Sam, fragLength int, reference map[string]chromInfo.ChromInfo) bed.Bed
- func SamToBedWithDeletions(s sam.Sam) []bed.Bed
- func SingleBedToFasta(b bed.Bed, ref []fasta.Fasta) fasta.Fasta
- func ThreeWayFaToVcf(f []fasta.Fasta, chr string, out *fileio.EasyWriter)
- func UCSCToEnsembl(in string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BedGraphToWig ¶
func BedGraphToWig(inFile string, reference map[string]chromInfo.ChromInfo, missing float64) map[string]wig.Wig
BedGraphToWig uses bedGraph entries to construct a slice of Wig data structures where the Wig value is equal to the DataValue for the range of the bedGraph entry. Regions with no bedGraph entries will be set to the value set by Missing (default 0 in cmd).
func BedReadsToWig ¶
BedReadsToWig returns a slice of Wig structs where the wig scores correspond to the number of input bed entries that overlap the position.
func BedToFasta ¶
BedToFasta extracts sub-Fastas out of a reference Fasta slice comprised of the sequences of input bed regions.
func BedValuesToWig ¶
func BedValuesToWig(inFile string, reference map[string]chromInfo.ChromInfo, Missing float64, method string, useRange bool, annotationField int) map[string]wig.Wig
BedValuesToWig uses bed entries from an input file to construct a Wig data structure where the Wig value is equal to the float64-casted name of an overlapping bed entry. Regions with no bed entries will be set to the value set by Missing (default 0 in the cmd). useRange sets the wig value to the bed value across the range of the bed region, not just at the midpoint, as is default.
func EnsemblToUCSC ¶
EnsemblToUCSC converts ensembl-style human chromosome names to the standard UCSC format chromosome names.
func PairwiseFaToVcf ¶
func PairwiseFaToVcf(f []fasta.Fasta, chr string, out *fileio.EasyWriter, substitutionsOnly bool, retainN bool)
PairwiseFaToVcf takes in a pairwise multiFa alignment and writes Vcf entries for segregating sites with the first entry as the reference and the second fasta entry as the alt allele. This will have to be done by chromosome, as a pairwise multiFa will only have two entries, thus containing one chromosome per file.
func SamToBed ¶
SamToBed extracts the position information from a Sam entry and returns it as a bed entry.
func SamToBedFrag ¶
SamToBedFrag converts a Sam entry into a bed based on the fragment length from which the aligned read was derived. Uses a chromInfo map to ensure fragments are called within the ends of the chromosomes.
func SamToBedWithDeletions ¶ added in v1.0.1
SamToBedWithDeletions extracts the position from a Sam entry and returns it in a slice of bed. If there are deletions in the cigar, it will return multiple bed entries corresponding to each separate alignment segment.
func SingleBedToFasta ¶
SingleBedToFasta extracts a sub-Fasta from a reference Fasta sequence at positions specified by an input bed.
func ThreeWayFaToVcf ¶ added in v1.0.1
func ThreeWayFaToVcf(f []fasta.Fasta, chr string, out *fileio.EasyWriter)
ThreeWayFaToVcf takes in a three-way multiFa alignment and writes Vcf entries for segregating sites with the first entry as the reference and the last two fasta entries as the alt alleles. This is done by chromosome since a multiFa contains only one chromosome per file. This function only checks for substitutions, not indels.
func UCSCToEnsembl ¶
UCSCToEnsembl converts UCSC-style chromosome names to ensembl-format names.
Types ¶
This section is empty.