Skip to content

Instantly share code, notes, and snippets.

@MatteoLacki
Created November 28, 2018 13:50
Show Gist options
  • Save MatteoLacki/55d7f20722d38c79591d7f26e7b2475f to your computer and use it in GitHub Desktop.
Save MatteoLacki/55d7f20722d38c79591d7f26e7b2475f to your computer and use it in GitHub Desktop.
test gist
//The printspectrum tool prints out the spectrum (mz and intensity values) of a
//Thermo RAW File
//
// Every line of the output is a peak registered by the mass spectrometer
// characterized by an m/z value in Da and an intensity in the mass spectrometer's unit of abundance
package main
import (
"bitbucket.org/proteinspector/ms"
"bitbucket.org/proteinspector/ms/unthermo"
"flag"
"fmt"
"log"
)
func main() {
var filename string
var scans int
//Parse arguments
flag.StringVar(&filename, "raw", "small.RAW", "name of the RAW file")
flag.Parse()
//open RAW file
file, err := unthermo.Open(filename)
if err != nil {
log.Fatal(err)
}
scans = file.NScans()
defer file.Close()
//Print the number of scans.
fmt.Println(scans)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment