parquet

package
v0.14.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColumnNames added in v0.14.0

func ColumnNames(path string) ([]string, error)

ColumnNames returns the leaf column names declared in the parquet footer. Reads only the file metadata, so it's cheap regardless of file size.

func GenusFromSpecies

func GenusFromSpecies(species string) string

func ReadAll

func ReadAll[T any](path string) ([]T, error)

ReadAll reads all rows from a parquet file into a slice of T. Column projection is performed based on the struct's parquet tags.

func ReadFiltered

func ReadFiltered[T any](path string, fn func(T) bool) ([]T, error)

ReadFiltered reads rows from a parquet file, keeping only those where fn returns true. Column projection is performed based on the struct's parquet tags.

func ReadStreamFiltered

func ReadStreamFiltered[T any](path string, fn func(T) bool, limit int) ([]T, error)

ReadStreamFiltered reads rows from a parquet file, applying the predicate during deserialization and returning only matching rows. If limit > 0, reading stops as soon as limit matching rows have been collected.

Types

type AMRRow

type AMRRow struct {
	Name                      string  `parquet:"Name"`
	ProteinID                 string  `parquet:"Protein id"`
	ContigID                  string  `parquet:"Contig id"`
	Start                     int64   `parquet:"Start"`
	Stop                      int64   `parquet:"Stop"`
	Strand                    string  `parquet:"Strand"`
	GeneSymbol                string  `parquet:"Element symbol"`
	ElementName               string  `parquet:"Element name"`
	Scope                     string  `parquet:"Scope"`
	ElementType               string  `parquet:"Type"`
	ElementSubtype            string  `parquet:"Subtype"`
	Class                     string  `parquet:"Class"`
	Subclass                  string  `parquet:"Subclass"`
	Method                    string  `parquet:"Method"`
	TargetLength              int64   `parquet:"Target length"`
	ReferenceSequenceLength   int64   `parquet:"Reference sequence length"`
	Coverage                  float64 `parquet:"% Coverage of reference"`
	Identity                  float64 `parquet:"% Identity to reference"`
	AlignmentLength           int64   `parquet:"Alignment length"`
	ClosestReferenceAccession string  `parquet:"Closest reference accession"`
	ClosestReferenceName      string  `parquet:"Closest reference name"`
	HMMAccession              string  `parquet:"HMM accession"`
	HMMDescription            string  `parquet:"HMM description"`
	HierarchyNode             string  `parquet:"Hierarchy node"`
	Genus                     string  `parquet:"genus"`
	Species                   string  `parquet:"species"`
}

AMRRow mirrors every column in the AMRFinderPlus v4.2.5 results parquet. The parquet tags are byte-for-byte identical to the AMRFP TSV header line, so downstream tooling sees the same column names regardless of source. Pre-v4 files (e.g. the old v3.12.8 dump) will not deserialize correctly.

type AssemblyRow

type AssemblyRow struct {
	SampleAccession   string `parquet:"sample_accession"`
	RunAccession      string `parquet:"run_accession"`
	AssemblyAccession string `parquet:"assembly_accession"`
	SylphSpecies      string `parquet:"sylph_species"`
	HQFilter          string `parquet:"hq_filter"`
	AsmFastaOnOSF     int64  `parquet:"asm_fasta_on_osf"`
	Dataset           string `parquet:"dataset"`
	ScientificName    string `parquet:"scientific_name"`
	AWSUrl            string `parquet:"aws_url"`
	OSFTarballURL     string `parquet:"osf_tarball_url"`
}

type AssemblyStatsRow

type AssemblyStatsRow struct {
	SampleAccession string  `parquet:"sample_accession"`
	TotalLength     int64   `parquet:"total_length"`
	Number          int64   `parquet:"number"`
	MeanLength      float64 `parquet:"mean_length"`
	Longest         int64   `parquet:"longest"`
	Shortest        int64   `parquet:"shortest"`
	N50             int64   `parquet:"N50"`
	N90             int64   `parquet:"N90"`
}

type CheckM2Row

type CheckM2Row struct {
	SampleAccession      string  `parquet:"sample_accession"`
	CompletenessGeneral  float64 `parquet:"Completeness_General"`
	Contamination        float64 `parquet:"Contamination"`
	CompletenessSpecific float64 `parquet:"Completeness_Specific"`
	GenomeSize           float64 `parquet:"Genome_Size"`
	GCContent            float64 `parquet:"GC_Content"`
}

type ENARow

type ENARow struct {
	RunAccession       string `parquet:"run_accession"`
	SampleAccession    string `parquet:"sample_accession"`
	Country            string `parquet:"country"`
	CollectionDate     string `parquet:"collection_date"`
	InstrumentPlatform string `parquet:"instrument_platform"`
	InstrumentModel    string `parquet:"instrument_model"`
	ReadCount          int64  `parquet:"read_count"`
	BaseCount          int64  `parquet:"base_count"`
	LibraryStrategy    string `parquet:"library_strategy"`
	StudyAccession     string `parquet:"study_accession"`
	FastqFTP           string `parquet:"fastq_ftp"`
}

type MLSTRow

type MLSTRow struct {
	Sample  string `parquet:"sample"`
	Scheme  string `parquet:"mlst_scheme"`
	ST      string `parquet:"mlst_st"`
	Status  string `parquet:"mlst_status"`
	Score   int32  `parquet:"mlst_score"`
	Alleles string `parquet:"mlst_alleles"`
}

type RunRow

type RunRow struct {
	RunAccession    string `parquet:"run_accession"`
	SampleAccession string `parquet:"sample_accession"`
	Pass            int64  `parquet:"pass"`
}

type SylphRow

type SylphRow struct {
	SampleAccession    string  `parquet:"sample_accession"`
	RunAccession       string  `parquet:"run_accession"`
	AdjustedANI        float64 `parquet:"Adjusted_ANI"`
	TaxonomicAbundance float64 `parquet:"Taxonomic_abundance"`
	SequenceAbundance  float64 `parquet:"Sequence_abundance"`
	MedianCov          int64   `parquet:"Median_cov"`
	Species            string  `parquet:"Species"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL