Created
November 28, 2018 13:50
-
-
Save MatteoLacki/55d7f20722d38c79591d7f26e7b2475f to your computer and use it in GitHub Desktop.
test gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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