mzml

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidScanID means an invalid scan id is supplied
	ErrInvalidScanID = errors.New("MzML: invalid scan id")
	// ErrInvalidScanIndex means an invalid scan index is supplied
	ErrInvalidScanIndex = errors.New("MzML: invalid scan index")
	// ErrUnknownUnit means the file contains a unit that the software cannot handle
	ErrUnknownUnit = errors.New("MzML: can't handle unit")
)

Functions

This section is empty.

Types

type CVParam

type CVParam struct {
	Accession     string `xml:"accession,attr,omitempty"`
	Name          string `xml:"name,attr,omitempty"`
	Value         string `xml:"value,attr,omitempty"`
	UnitCvRef     string `xml:"unitCvRef,attr,omitempty"`
	UnitAccession string `xml:"unitAccession,attr,omitempty"`
	UnitName      string `xml:"unitName,attr,omitempty"`
}

CVParam contains values and attributes of a mzML Controlled Vocabulary term (http://www.peptideatlas.org/tmp/mzML1.1.0.html)

type DataProcessing

type DataProcessing struct {
	ID             string             `xml:"id,attr,omitempty"`
	ProcessingMeth []ProcessingMethod `xml:"processingMethod"`
}

DataProcessing contains info for the correspondingly named tag in mzML

type MzML

type MzML struct {
	// contains filtered or unexported fields
}

MzML wraps the contents of the mzML file

func Read

func Read(reader io.Reader) (MzML, error)

Read reads mzML file from an io.Reader

func (*MzML) AppendDataProcessing

func (f *MzML) AppendDataProcessing(proc DataProcessing) error

AppendDataProcessing adds info to the DataProcessing tag of the mzML file

func (*MzML) AppendSoftwareInfo

func (f *MzML) AppendSoftwareInfo(id string, version string) error

AppendSoftwareInfo adds info to the SoftwareList tag of the mzML file

func (*MzML) Centroid

func (f *MzML) Centroid(scanIndex int) (bool, error)

Centroid returns true if the spectrum contains centroid peaks

func (*MzML) GetPrecursors

func (f *MzML) GetPrecursors(scanIndex int) ([]XMLprecursor, error)

GetPrecursors returns the mzML precursors struct for a given scanIndex

func (*MzML) IonInjectionTime

func (f *MzML) IonInjectionTime(scanIndex int) (float64, error)

IonInjectionTime returns the ion injection time of a spectrum in ms, or NaN is not found

func (*MzML) MSInstruments

func (f *MzML) MSInstruments() ([]string, error)

MSInstruments returns the CV terms of the MS instrument

func (*MzML) MSLevel

func (f *MzML) MSLevel(scanIndex int) (int, error)

MSLevel returns the MS level of a scan

func (*MzML) NumSpecs

func (f *MzML) NumSpecs() int

NumSpecs returns the number of spectra

func (*MzML) ReadScan

func (f *MzML) ReadScan(scanIndex int) ([]Peak, error)

ReadScan reads a single scan n is the sequence number of the scan in the mzML file, This is not the same as the scan number that is specified in the mzML file! To read a scan using the mzML number, use ReadScan(f, ScanIndex(f, scanNum))

func (*MzML) RetentionTime

func (f *MzML) RetentionTime(scanIndex int) (float64, error)

RetentionTime returns the retention time of a spectrum

func (*MzML) ScanID

func (f *MzML) ScanID(scanIndex int) (string, error)

ScanID converts a scan index (used to access the scan data) into a scan id (used in the mzML file)

func (*MzML) ScanIndex

func (f *MzML) ScanIndex(scanID string) (int, error)

ScanIndex converts a scan identifier (the string used in the mzML file) into an index that is used to access the scans

func (*MzML) TotalIonCurrent

func (f *MzML) TotalIonCurrent(scanIndex int) (float64, error)

TotalIonCurrent returns the total ion current, or NaN if not found

func (*MzML) UpdateScan

func (f *MzML) UpdateScan(scanIndex int, p []Peak,
	updateMz bool, updateIntens bool) error

UpdateScan sets the mz/intensity info of a scan

func (*MzML) Write

func (f *MzML) Write(writer io.Writer) error

type Peak

type Peak struct {
	Mz     float64
	Intens float64
}

Peak contains the actual ms peak info

type ProcessingMethod

type ProcessingMethod struct {
	Count       int         `xml:"order,attr"`
	SoftwareRef string      `xml:"softwareRef,attr,omitempty"`
	CvPar       []CVParam   `xml:"cvParam,omitempty"`
	UserPar     []userParam `xml:"userParam,omitempty"`
}

ProcessingMethod contains info for the correspondingly named tag in mzML

type XMLprecursor

type XMLprecursor struct {
	SpectrumRef     string          `xml:"spectrumRef,attr,omitempty"`
	IsolationWindow isolationWindow `xml:"isolationWindow,omitempty"`
	SelectedIonList selectedIonList `xml:"selectedIonList"`
	Activation      activation      `xml:"activation"`
}

XMLprecursor contains info for the correspondingly named tag in the mzML file

Jump to

Keyboard shortcuts

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